This follows on from the previous question on differences between K-S manual test and K-S test with R.
My frequency sample was
a=c(0,1,1,4,9).
Then the observed sample is
obs=c(2,3,4,4,4,4,5,5,5,5,5,5,5,5,5)
The expected sample is then
exp=c(1,1,1,2,2,2,3,3,3,4,4,4,5,5,5)
I hope you agree.
First, I use ks.test, like another time:
ks.test(obs,exp)
data: oss and att
D = 0.4667, p-value = 0.07626
Then, I use the ks.test the other way:
The expected distribution can be the uniform. Do you agree?
And then:
ks.test(obs, "punif", 0,5)
data: obs
D = 0.6667, p-value = 3.239e-06
Question
- Why do the two approaches give different results?
multinomialtag because it will provide useful related links at the right of this page. – whuber♦ May 2 '11 at 16:18