Skip to content
Prev 488 / 523 Next

[RsR] About the inconsistency p-value of two sample Kolmogorov–Smirnov test in R and Matlab

Both MATLAB and R generate the same test statistic, but differ in their
p-values. For a p-value that small, you're getting to the point where
the probabilities involved are on the order of a random bit flip in your
computer's memory, so I wouldn't worry about that too much. A quick look
at the R documentation suggests that the approximation used can break
down for small sample sizes and that an exact test is only possible with
more data. MATLAB didn't provide as much detail about how they converted
the test statistic to p-value.

In other words, don't worry about it. You should be trying to interpret
p values as a precise number anyway, especially on such a small sample.


Best,

Phillip
On 19/11/2019 22:35, Zhou, Xionghui wrote: