[R] ks.test() with 2 samples vs. 1 sample an distr. function

tonja.krueger at web.de tonja.krueger at web.de
Wed Nov 15 10:46:43 CET 2017


Dear all,
I have a question concerning the ks.test() function. I tryed to calculate the example given on the German wikipedia page.
xi <- c(9.41,9.92,11.55,11.6,11.73,12,12.06,13.3)
I get the right results when I calculate: ks.test(xi,pnorm,11,1)
Now the question: shouldn't I obtain the same or a very similar result if I commpare the sample and a calculated sample from the distribution?
p<- c(0.125, 0.250, 0.375, 0.500, 0.625, 0.750, 0.875, 0.9999)
x <- qnorm(p,11,1)
ks.test(xi,x)
Why don't I?
Thanks for helping me!
Tonja



More information about the R-help mailing list