[R] KS test and theoretical distribution

francogrex francogrex at mail.com
Thu Oct 6 17:06:41 CEST 2011


> x <- runif(100)
> y <- runif(100)
> ks.test(x,y)

       Two-sample Kolmogorov-Smirnov test

data:  x and y 
D = 0.11, p-value = 0.5806
alternative hypothesis: two-sided 

ok I expected that, but:

> ks.test(runif(100), "runif")

        One-sample Kolmogorov-Smirnov test

data:  runif(100) 
D = 0.9106, p-value < 2.2e-16
alternative hypothesis: two-sided 

How come? 

--
View this message in context: http://r.789695.n4.nabble.com/KS-test-and-theoretical-distribution-tp3878640p3878640.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list