正規性の検定:コルモゴロフ・スミルノフ検定

ks.test() http://stat.ethz.ch/R-manual/R-patched/library/stats/html/ks.test.html ・帰無仮説(H0):『データは正規分布からの標本である』。 ・検定ベクトルデータに同値(タイ)があると警告。
> x<-rnorm(5)

> x
[1]  0.8114400 -0.6457658 -1.2677898  1.5175834  1.0135291

> ks.test(x,"pnorm")

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.3914, p-value = 0.3323
alternative hypothesis: two-sided

> ks.test(x,"pnorm",mean=10)

        One-sample Kolmogorov-Smirnov test

data:  x
D = 1, p-value < 2.2e-16
alternative hypothesis: two-sided

> ks.test(x,"pnorm",mean=0,sd=0.01)

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.6, p-value = 0.03008
alternative hypothesis: two-sided

> x<-rnorm(1000)

> head(x,n=10)
 [1]  1.7491420 -1.7332134 -0.6978815 -0.2208874  0.5493549 -0.3235681  0.7636587 -0.8633816 -0.8442523
[10] -0.1090063

> ks.test(x,"pnorm")

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.0333, p-value = 0.2163
alternative hypothesis: two-sided

> ks.test(x,"pnorm",mean=10)

        One-sample Kolmogorov-Smirnov test

data:  x
D = 1, p-value < 2.2e-16
alternative hypothesis: two-sided

> ks.test(x,"pnorm",mean=0,sd=0.01)

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.5156, p-value < 2.2e-16
alternative hypothesis: two-sided

> ks.test(x,"pnorm",mean=0,sd=1)

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.0333, p-value = 0.2163
alternative hypothesis: two-sided

> x<-c(-0.1,-0.04,0,0.03,0.1)

> ks.test(x,"pnorm")

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.4602, p-value = 0.1747
alternative hypothesis: two-sided

> x<-c(-0.1,-0.04,0,0.03,0.1,0.1)

> ks.test(x,"pnorm")

        One-sample Kolmogorov-Smirnov test

data:  x
D = 0.4602, p-value = 0.1575
alternative hypothesis: two-sided

 警告メッセージ: 
In ks.test(x, "pnorm") :
   コルモゴロフ・スミノフ検定において、タイは現れるべきではありません 
参考文献 ・石田基広.『改訂2版 R言語逆引きハンドブック』.C&R研究所.pp703アプリケーション R Core Team (2013). R: A language and environment for statistical computing. R Foundation for Statistical Computing, Vienna, Austria. URL http://www.R-project.org/.