Skip to content
Prev 85702 / 398506 Next

Problems with ks.test

7 repetitions is not nearly enough to get a good estimate of the 
variability of the test statistic.
Try this:

nrep <- 500
pvals <- tstvals <- numeric(nrep)

for (i in seq(nrep)) {
   tmp <-  ks.test(rexp(2500,0.4),"pexp",0.4)
   pvals[i] <- tmp$p.value
   tstvals[i] <- tmp$statistic
}

hist(pvals)
hist(tstvals)
round(quantile(pvals,pr=seq(0.05,.95,.05)),2)
At 2:36 PM +0000 2/3/06, Emanuele Mazzola wrote: