Calculate pairwise multiple comparisons between group levels according to Dunn.
1 2 3 4 5 6 7 8 9  posthoc.kruskal.dunn.test(x, ...)
## Default S3 method:
posthoc.kruskal.dunn.test( x, g, p.adjust.method =
p.adjust.methods, ...)
## S3 method for class 'formula'
posthoc.kruskal.dunn.test(formula, data, subset,
na.action, p.adjust.method = p.adjust.methods, ...)

x 
a numeric vector of data values, or a list of numeric data vectors. 
g 
a vector or factor object giving the group for the
corresponding elements of 
formula 
a formula of the form 
data 
an optional matrix or data frame (or similar: see

subset 
an optional vector specifying a subset of observations to be used. 
na.action 
a function which indicates what should happen when
the data contain 
p.adjust.method 
Method for adjusting p values
(see 
... 
further arguments to be passed to or from methods. 
For onefactorial designs with samples that do not meet the assumptions for onewayANOVA and subsequent posthoc tests, the KruskalWallisTest kruskal.test
can be employed that is also referred to as the Kruskalâ€“Wallis oneway analysis of variance by ranks. Provided that significant differences were detected by this global test, one may be interested in applying posthoc tests according to Dunn for pairwise multiple comparisons of the ranked data.
See vignette("PMCMR")
for details.
A list with class "PMCMR"
method 
The applied method. 
data.name 
The name of the data. 
p.value 
The twosided pvalue of the standard normal distribution. 
statistic 
The estimated quantile of the standard normal distribution. 
p.adjust.method 
The applied method for pvalue adjustment. 
A tie correction will be employed according to Glantz (2012).
Thorsten Pohlert
O.J. Dunn (1964). Multiple comparisons using rank sums. Technometrics, 6, 241252.
S. A. Glantz (2012), Primer of Biostatistics. New York: McGraw Hill.
kruskal.test
,
friedman.test
,
posthoc.friedman.nemenyi.test
,
pnorm
,
p.adjust
1 2 3 4 5 6 7 8 9 10  ##
require(stats)
data(InsectSprays)
attach(InsectSprays)
kruskal.test(count, spray)
posthoc.kruskal.dunn.test(count, spray, "bonferroni")
detach(InsectSprays)
rm(InsectSprays)
## Formula Interface
posthoc.kruskal.dunn.test(count ~ spray, data = InsectSprays, p.adjust="bonf")

Questions? Problems? Suggestions? Tweet to @rdrrHQ or email at ian@mutexlabs.com.
All documentation is copyright its authors; we didn't write any of that.