{asbio}R Documentation

Multiple pairwise comparison procedure to accompany a Kruskal-Wallis test


Replaces the defunct KW.multi.comp. As with ANOVA we can examine multiple pairwise comparisons from a Kruskal-Wallis test after we have rejected our omnibus null hypothesis. However we will need to account for the fact that these comparisons will be non-orthogonal. A conservative multiple comparison method used here is based on the Bonferroni inequality.

Usage, x, conf)



The response variable. A vector of quantitative responses.


An explanatory variable. A vector of factor levels.


The level of desired confidence, 1 - P(type I error).


Returns a list of class = "pairw". The utility print function returns a descriptive head and a six column summary dataframe containing:

1) the type of contrast (names are taken from levels in x),

2) the mean rank difference,

3) the lower confidence bound of the true mean rank difference,

4) the upper confidence bound of the true mean rank difference,

5) the hypothesis decision given the prescribed significance level,

6) the adjusted P-value.


Ken Aho and Richard Boyce. Richard provided an adjustment for ties. Thanks to Paule Bodson-Clermont for pointing out issues with the default behaviour of rank, leading to incorrect answers from given missing vaues.


Kutner, M. H., Nachtsheim, C. J., Neter, J., and W. Li (2005) Applied Linear Statistical Models, 5th edition. McGraw-Hill, Boston.

See Also

pairw.anova, pairw.fried, plot.pairw

Examples <- data.frame(rye = c(50, 49.8, 52.3, 44.5, 62.3, 74.8, 72.5, 80.2, 
47.6, 39.5, 47.7,50.7), nutrient = factor(c(rep(1, 4), rep(2, 4), rep(3, 4))))
kw <- with(, = rye, x = nutrient, conf = .95))
plot(kw, loc.meas = median, int = "IQR")
# you can also try: plot(kw, type = 2)

[Package asbio version 1.7 Index]