[R] Problems with ks.test

From: Emanuele Mazzola <mathematician4_at_hotmail.com>
Date: Sat 04 Feb 2006 - 01:36:43 EST


Hi everybody,

while performing ks.test for a standard exponential distribution on samples of dimension 2500, generated everytime as new, i had this strange behaviour:

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.0147, p-value = 0.6549
alternative hypothesis: two.sided

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.019, p-value = 0.3305
alternative hypothesis: two.sided

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.0171, p-value = 0.4580
alternative hypothesis: two.sided

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.0143, p-value = 0.6841
alternative hypothesis: two.sided

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.0145, p-value = 0.6684
alternative hypothesis: two.sided

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.0123, p-value = 0.8435
alternative hypothesis: two.sided

>data<-rexp(2500,0.4)
>ks.test(data,"pexp",0.4)

        One-sample Kolmogorov-Smirnov test

data: data
D = 0.0186, p-value = 0.3532
alternative hypothesis: two.sided

It seems kind of strange to me that max p-value obtained is 0.8435 and all the best i can have from the rest is a 0.66-0.68. I'm probably not so expert in running this kind of test, but am I doing something wrong?
I would expect p values ranging from 0.75 (to be kind) to 0.9, 0.95. How is this possible?

Thank you in advance for your answers.
See you soon
EM



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Sat Feb 04 01:53:16 2006

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:42:21 EST