help with kolmogorov smirnov test
Agnes Gault wrote:
Hello! I am an 'R beginner'. I am trying to check if my data follow a negative binomial function. the command i've typed in is:
> nbdo=rnegbin(58,mu=27.82759,theta=0.7349851) > ks.test(do$DO,nbdo)
Each time i do that, p given is different
The p-values are different each time because you are using a two-sample test, where one of the samples is randomly generated (and thus will be different each time). ks.test offers a one-sample test against a specified distribution, but this will still have problems with the ties. --- James Reilly Department of Statistics, University of Auckland Private Bag 92019, Auckland, New Zealand