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

tonja.krueger at web.de
2017-11-15T09:46:43Z

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