# Is there a multiple-sample version or alternative to the Kolmogorov-Smirnov Test?

I am comparing the size distribution of trees in six pairs of plots where one plot received a treatment and the other a control. Using a Kolmogorov-Smirnov test on each pair of plots I find that $p$ ranges from $0.0003707$ to $0.75$. Are there any appropriate methods for dealing with all of the replicates together, such as a multi-sample extension of the KS test, or is there an appropriate follow up test? Or should I just conclude something like "The size distribution differ significantly $(p < 0.05$) in 2 pairs of plots and marginally ($p = 0.59$) in one pair of plots."

• What is it you want to compare about these distributions, that they differ in central tendency, or that they differ in shape? I tend to think of KS as being more about the shape / nature of a distribution, but something like the Friedman test can determine that the samples differ in central tendency. Aug 31 '12 at 19:07

There actually are some multiple sample KS Tests. E.g., an r-sample Kolmogorov-Smirnov-Test with $r\geq 2$ which, I believe, has good power. A preprint of that beautiful paper is available here. I also know of K-Sample Analogues of the Kolmogorov-Smirnov and Cramer-V. Mises Tests (but they have less power as far as I know).

• Well, the disadvantage of that "beautiful" paper by Böhm and Hornik is that there is no publicly available implementation available as far as I can tell. The maths is complex enough that you wouldn't like to implement it yourself. I mailed the authors and asked them but they did not reply. Note that Hornik is a member of the R Core Developers group... If someone knows about an implementation, pls post a link here! Aug 11 '15 at 14:12

There is an R package kSamples that gives you, among other things, a non-parametric k-sample Anderson-Darling test. The null hypothesis is that all k samples came from the same distribution which does not need to be specified. Maybe you can use this.

Little example on comparing Normal and Gamma-distributed samples scaled so that they have the same mean and variance:

library("kSamples")
set.seed(142)
samp.num <- 100
alpha <- 2.0; theta <- 3.0  # Gamma parameters shape and scale, using Wikipedia notation
gam.mean <- alpha * theta # mean of the Gamma
gam.sd <- sqrt(alpha) * theta # S.D. of the Gamma
norm.data <- rnorm(samp.num, mean=gam.mean, sd=gam.sd)  # Normal with the same mean and SD as the Gamma
gamma.data <- rgamma(samp.num, shape=alpha, scale=theta)
norm.data2 <- rnorm(samp.num, mean=gam.mean, sd=gam.sd)
norm.data3 <- rnorm(samp.num, mean=gam.mean, sd=gam.sd)