[R] KS test from ctest package

David Middleton dajm at deeq.demon.co.uk
Fri Apr 9 17:44:32 CEST 1999


Brian

Many thanks for the rapid response.  Here are the inevitable follow
up questions!

>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.

I am aware that the KS test assumes samples from a continuous distribution.
Fish length obviously is a continuous variable, though it is apparent that
measuring to the nearest 0.5cm (or 1cm in some cases) does introduce a
certain discretization.  In the case I'm considering lengths to the nearest
0.5cm are the highest precision available.  I wonder, therefore, whether there
are guidelines regarding the precision required before a continuous variable
yields continuous measurements?  Possibly some criterion based on the ratio
of precision to range?  In this case the fact that there are repeated values
for the length measurements suggests there has been inherent creation of size
classes.

> 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.

Sokal and Rohlf do give an approximate KS 2 sample test for large sample
sizes.  Again D is the maximum absolute difference between cumulative
relative frequencies but the difference is only calculated once per
measurement class, rather than for each individual measurement.  Their example
has sample sizes of 400-500.  Is there any published guidance for the sample
size that is considered "large enough"?

I hope that these questions are not too general for the R list - unfortunately
my access to a statistical publications is somewhat limited at present.  I do
note with satisfaction that it will be relatively easy to code the approximate
test in R.

Thanks

David Middleton, dajm at deeq.demon.co.uk
Falkland Islands Fisheries Department


-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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