Learn R Programming

PMCMR (version 4.0)

posthoc.kruskal.nemenyi.test: Pairwise Test for Multiple Comparisons of Mean Rank Sums (Nemenyi-Tests)

Description

Calculate pairwise multiple comparisons between group levels. These tests are sometimes referred to as Nemenyi-tests for multiple comparisons of (mean) rank sums of independent samples.

Usage

posthoc.kruskal.nemenyi.test(x, ...)

## S3 method for class 'default': 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 x. Ignored if x is a list.
formula
a formula of the form response ~ group where response gives the data values and group a vector or factor of the corresponding groups.
data
an optional matrix or data frame (or similar: see model.frame) containing the variables in the formula formula. By default the variables are taken from environment(formul
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 NAs. Defaults to getOption("na.action").
...
further arguments to be passed to or from methods.
dist
the method for determining the p-value. The default distribution is "Tukey", else "Chisq".

Value

  • A list with class "PMCMR"
  • methodThe applied method.
  • data.nameThe name of the data.
  • p.valueThe p-value according to the studentized range distribution.
  • statisticThe estimated upper quantile of the studentized range distribution. (or quantile of Chisq distribution)
  • p.adjust.methodDefaults to "none"

Details

For one-factorial designs with samples that do not meet the assumptions for one-way-ANOVA and subsequent post-hoc tests, the Kruskal-Wallis-Test kruskal.test can be employed that is also referred to as the Kruskal–Wallis one-way analysis of variance by ranks. Provided that significant differences were detected by this global test, one may be interested in applying post-hoc tests according to Nemenyi for pairwise multiple comparisons of the ranked data.

See vignette("PMCMR") for details.

References

Lothar Sachs (1997), Angewandte Statistik. Berlin: Springer. Pages: 395-397, 662-664.

See Also

kruskal.test, friedman.test, posthoc.friedman.nemenyi.test, Tukey, Chisquare

Examples

Run this code
##
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")

Run the code above in your browser using DataLab