2
$\begingroup$

I have a data set and keep getting $D=1$ when I use the KS-Test. It doesn't matter what distribution I use. For example, consider the following:

ks.test(data,"pnorm")
ks.test(data,"pexp")

For these, I get:

  D = 1, p-value < 2.2e-16
  alternative hypothesis: two-sided 

The data I have looks exponential. Yet the KS-Test shows the opposite. Why?

$\endgroup$
  • 1
    $\begingroup$ It's impossible to tell without a look at your data. Can you show a density plot or box plot or something? $\endgroup$ – Peter Flom - Reinstate Monica Mar 11 '13 at 15:27
  • 2
    $\begingroup$ It appears to me you are misusing ks.test. According to its manual page, you need to supply parameters for the named distribution. Without them, pnorm will default to a standard normal distribution and pexp will default to an exponential with rate $1$. But beware! It is invalid to supply parameters that have been estimated from the data themselves--see the last paragraph of the "Details" section. $\endgroup$ – whuber Mar 11 '13 at 16:22

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.