Pairwise Test for Multiple Comparisons of Mean Rank Sums (NemenyiTests)
Description
Calculate pairwise multiple comparisons between group levels. These tests are sometimes referred to as Nemenyitests for multiple comparisons of (mean) rank sums of independent samples.
Usage
1 2 3 4 5 6 7 8 9 10  posthoc.kruskal.nemenyi.test(x, ...)
## Default S3 method:
posthoc.kruskal.nemenyi.test( x, g, dist =
c("Tukey", "Chisquare"), ...)
## S3 method for class 'formula'
posthoc.kruskal.nemenyi.test(formula, data, subset,
na.action, dist =
c("Tukey", "Chisquare"), ...)

Arguments
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 
... 
further arguments to be passed to or from methods. 
dist 
the method for determining the pvalue. The default distribution is 
Details
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 Nemenyi for pairwise multiple comparisons of the ranked data.
See vignette("PMCMR")
for details.
Value
A list with class "PMCMR"
method 
The applied method. 
data.name 
The name of the data. 
p.value 
The pvalue according to the studentized range distribution. 
statistic 
The estimated upper quantile of the studentized range distribution. (or quantile of Chisq distribution) 
p.adjust.method 
Defaults to "none" 
Note
Only for method = "Chisq" a tie correction is employed.
Author(s)
Thorsten Pohlert
References
Lothar Sachs (1997), Angewandte Statistik. Berlin: Springer. Pages: 395397, 662664.
See Also
kruskal.test
,
friedman.test
,
posthoc.friedman.nemenyi.test
,
Tukey
,
Chisquare
Examples
1 2 3 4 5 6 7 8 9 10 11  ##
require(stats)
data(InsectSprays)
attach(InsectSprays)
kruskal.test(count, spray)
posthoc.kruskal.nemenyi.test(count, spray)
posthoc.kruskal.nemenyi.test(count, spray, "Chisq")
detach(InsectSprays)
rm(InsectSprays)
## Formula Interface
posthoc.kruskal.nemenyi.test(count ~ spray, data = InsectSprays, dist="Tukey")

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker. Vote for new features on Trello.