[R] KS test from ctest package

Kurt Hornik Kurt.Hornik at ci.tuwien.ac.at
Sat Apr 10 20:03:32 CEST 1999

>>>>> Prof Brian D Ripley writes:

> On Thu, 8 Apr 1999, David Middleton wrote:
>> This question is mainly aimed at Kurt Hornik as author of the ctest package,
>> but I'm cc'ing it to r-help as I suspect there will be other valuable
>> opinions out there.
>> I have been attempting 2 sample Kolmogorov-Smirnov tests using the ks.test
>> function from the ctest package (ctest v.0.9-15, R v.0.63.3 win32).  I am
>> comparing fish length-frequency distributions.  My main reference for the KS 
>> test at present is Sokal & Rohlf, Biometry (2nd edn), pages 440-445).
>> The individuals in my samples are measured to the nearest 0.5cm and so in
>> most samples there are several identical length values.  It appears that the
>> KS test statistic D is being overestimated (and the p value therefore
>> underestimated).

> If the data are discretized the KS test does not have the standard
> (distribution-free) distribution. `Distribution-free' here means
> independent samples from a continuous distribution. So the KS test is
> not IMHO appropriate in your problem. My view is that the function
> should warn you off, and not give a p-value if it finds ties. It might
> be good to construct the exact statistic, though.

The new version of ctest tries to be more intelligent about ties.  It
gives a warning and hopefully also the right differences between the two

r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch

More information about the R-help mailing list