Rmarkdown给我加载qq-plot函数的错误

时间:2017-11-30 11:09:47

标签: r r-markdown

当我运行我的代码时,每次操作都是打开的,当我尝试用PDF格式化它时,它会给我一个错误。我需要安装其他一些软件包吗?

##Normality of the variables

#QQ-plot

```{r}
par(mfrow=c(2,2))
with(Melanoma, qqPlot(age, dist="norm", id.method="y", id.n=2, 
  labels=rownames(Melanoma), main="qq-plot Age"))
with(Melanoma, qqPlot(thickness, dist="norm", id.method="y", id.n=2, 
  labels=rownames(Melanoma), main="qq-plot Thickness"))
with(Melanoma, qqPlot(time, dist="norm", id.method="y", id.n=2, 
  labels=rownames(Melanoma), main="qq-plot Time"))
```
The variable "age" seems to follow a normal distribution, we can't say the same thing for the ariables "thickness" and "time".
#Saphiro-Wilk test
In order to be more precise I performed a Saphiro-Wilk test
```{r}
normalityTest(~age, test="shapiro.test", data=Melanoma)
```

```{r}
normalityTest(~thickness, test="shapiro.test", data=Melanoma)
```

```{r}
normalityTest(~time, test="shapiro.test", data=Melanoma)
```
We can see that, only the variables "time" and "age" seems to follow a normal distribution.

0 个答案:

没有答案