Kolmogorov-Smirnov test in R
I think it would be better to use mean=mean(x)
and sd=sd(x)
like
ks.test(x, "pnorm", mean=mean(x), sd=sd(x))
As pointed out in the ks.test
help, you have to give to the ks.test
function the arguments of pnorm
. If you do not precise mean and standard variation, the test is done on a standard gaussian distribution.
Here you should write:
ks.test(x, "pnorm", 1, 2) #or ks.test(x, "pnorm", mean=1, sd=2)