Kolmogorov-Smirnov Test

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?

• It's impossible to tell without a look at your data. Can you show a density plot or box plot or something? – Peter Flom - Reinstate Monica Mar 11 '13 at 15:27
• 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. – whuber Mar 11 '13 at 16:22