[R] Kolmogorov-Smirnov Test - what are the exact alternative hypotheses?

From: B Dittmann <herrdittmann_at_yahoo.co.uk>
Date: Wed 01 Feb 2006 - 06:00:48 EST


Hi everyone,

I have performed the Kolmogorov-Smirnov test (ks.test) with R the first time.

What I am not sure about is the exact alternative hypotheses (H1) given any H0.

According to Conover (1971) Practical Nonparametric Statistics, chapter 6, the following one-sample tests can be performed:

(1) Two-sided test

    H0: F(x) = F*(x)
    H1: F(x) =/= F*(x) [for at least one x]

(2) one-sided test

    (2.a): "less"    

    H0: F(x) =< F*(x)
    H1: F(x) > F*(x) [for at least one x]

    (2.b): "greater"

    H0: F(x) >= F*(x)
    H1: F(x) < F*(x) [for at least one x]

with F(x) being the empirical distribution of sample data and F*(x) the hypothesised distribution. F*(x) requires full specification, which can be achieved by "fitdistr(..., F*(x)).

The KS Test on R tests a sample performs a 2-sided test as default mode. The choice for "alternative" seems to allow for a choice of H0 different to the standard of two-sided.

Suppose one would chooses "less" or "greater" as "alternative". Does the KS test automatically set the correct H1? Whenever I perform the test, the alternative hypothesis is not being stated, that is why I am not certain whether I would be correct to make this assumption.

Here is an example of the output for a test: P*(x) is a lognormal distribution, fully specified with meanlog and sdlog.


> ks.test(spread,plnorm, meanlog=2.359, sdlog=0.588, alternative =
"greater")

        One-sample Kolmogorov-Smirnov test

data: spread
D^+ = 0.035, p-value = 0.0462
alternative hypothesis: greater

Warning message:
cannot compute correct p-values with ties in: ks.test(spread, plnorm, meanlog = 2.359, sdlog = 0.588, alternative = "greater")


In the above test I am testing one-sided, i.e. (2.b) above. Does ks.test automatically set H1 such that "F(x) < F*(x) for at least one x"?

Thank you for your help.

Bernd Dittmann



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Feb 01 06:09:04 2006

This archive was generated by hypermail 2.1.8 : Wed 01 Feb 2006 - 08:31:16 EST