R语言如何进行正态性分析
(2015-10-12 09:54:54)分类: R学习 |
1、shapiro.test命令,这个不需要安装包
data<-scan();
#输入数据
shapiro.test(data)
#Shapiro-Wilk normality test
2、安装包
source("http://bioconductor.org/biocLite.R")
biocLite("nortest")
library(nortest)
lillie.test(data) #Lilliefors
(Kolmogorov-Smirnov) normality test
或
ad.test(data)
# Anderson-Darling normality
test
或
cvm.test(data) #Cramer-von
Mises normality test
或
pearson.test(data)
# Pearson chi-square normality
test
或
sf.test(data)
#Shapiro-Francia normality test
以上所有检验,若P值大于0.05
则是正态分布,若小于0.05,则不符合正态分布