[R] how to interpret KS test

David Winsemius dwinsemius at comcast.net
Fri Aug 20 15:36:47 CEST 2010


On Aug 20, 2010, at 9:19 AM, Izidine Pinto wrote:

> Dear R users
> I am using KS test to compare two different distribution for the same
> variable (temperature)  for two different time periods.
> H0: the two distributions are equal
> H1: the two distributions are different
>
> ks.test (temp12, temp22)
>
>    Two-sample Kolmogorov-Smirnov test
>
> data:  temp12 and temp22
> D = 0.2047, p-value < 2.2e-16
> alternative hypothesis: two-sided
>
> Warning message:
> In ks.test(temp12, temp22) : cannot compute correct p-values with ties

This question comes up so often there should probably be a FAQ, but I  
just checked and there is not one (yet).

It's only a warning, but it does mean that you need to check the  
distribution of your values to see how far they depart fro the  
theoretical ideal of continuous functions for which the KS test was  
developed. There are alternatives to the ordinary KS test from  
wilcox.test and the help page refers you to wilcox_test in package  
coin with a note that it handles situations with ties.


(With a p-value that is numerically equivalent to zero, it seems  
unlikely that the final answer will be materially different than what  
you are now looking at.)

-- 
David

> I don't rally know how to interpret the  output from R.
>
> Any help is appreciated.
>
-- 

David Winsemius, MD
West Hartford, CT



More information about the R-help mailing list