Re: [Rd] ks.test calculations incorrect (PR#7330)

From: Peter Dalgaard <p.dalgaard_at_biostat.ku.dk>
Date: Tue 02 Nov 2004 - 08:33:40 EST

tavery@mun.ca writes:  

> Full_Name: t. avery
> Version: 2.0.0
> OS: windows xp / Linux
> Submission from: (NULL) (131.162.134.159)
>
>
> ks.test does not produce the correct output.
> If given the script:
>
> d1 <- c(53.63984674,0.383141762,1.915708812,0.383141762,10.72796935,6.896551724,20.30651341,5.747126437,0)
> d1
>
> d2 <- c(76.43312102,15.2866242,3.821656051,1.27388535,0,0.636942675,1.27388535,0.636942675,0.636942675)
> d2
>
> ks.test(d1,d2,alternative="two.sided",exact)
>
> The output generates:
> Two-sample Kolmogorov-Smirnov test
>
> data: dd and ddd
> D = 0.3333, p-value = 0.6994
> alternative hypothesis: two.sided
>
> Warning message:
> cannot compute correct p-values with ties in: ks.test(dd, ddd, alternative =
> "two.sided", exact)
>
> Which is far from the correct D value of:
>
> D = 0.404934475 with a p-value < 0.01

According to what definition? Referring to what distribution? Reference?

Considering that D is the distance between two CDFs, both of which take values in (0:9)/9, I do find it a bit unconvincing that you claim that D should be something that is not a whole number of ninths...  

> I recommend that noone use this test. I have tested it with various datasets
> from publications and texts using by-hand calculations.

Well, I'm no fan of the KS test either, but you have to work harder to convince us that there's a problem in R's implementation!

-- 
   O__  ---- Peter Dalgaard             Blegdamsvej 3  
  c/ /'_ --- Dept. of Biostatistics     2200 Cph. N   
 (*) \(*) -- University of Copenhagen   Denmark      Ph: (+45) 35327918
~~~~~~~~~~ - (p.dalgaard@biostat.ku.dk)             FAX: (+45) 35327907

______________________________________________
R-devel@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel
Received on Tue Nov 02 08:57:44 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:45:26 EST