Pairwise posthoc Test for Multiple Comparisons of Mean Rank Sums for Unreplicated Blocked Data (NemenyiTest)
Description
Calculate pairwise comparisons using Nemenyi posthoc test for
unreplicated blocked data. This test is usually conducted posthoc after
significant results of the friedman.test
. The statistics refer to
upper quantiles of the studentized range distribution (Tukey
).
Usage
1 2 3 4 5 6 7 8 9  posthoc.friedman.nemenyi.test(y, ...)
## Default S3 method:
posthoc.friedman.nemenyi.test(y, groups, blocks,
...)
## S3 method for class 'formula'
posthoc.friedman.nemenyi.test(formula, data, subset,
na.action, ...)

Arguments
y 
either a numeric vector of data values, or a data matrix. 
groups 
a vector giving the group for the corresponding elements of 
blocks 
a vector giving the block 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. 
Details
A oneway ANOVA with repeated measures that is also referred to as ANOVA with unreplicated block design can also be conducted via the friedman.test
. The consequent posthoc pairwise multiple comparison test according to Nemenyi is conducted with this function.
If y is a matrix, than the columns refer to the treatment and the rows indicate the block.
See vignette("PMCMR")
for details.
Let R_j and n_j denote the sum of Friedmanranks and the sample size of the jth group, respectively, then a difference between two groups is significant on the level of α, if the following inequality is met:
R_i / n_i  R_j / n_j > q(∞; k; α) / 2^0.5 * (k (k + 1) / (6 n))^0.5
with k the number of groups (or treatments) and n the total number of data.
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. 
p.adjust.method 
Defaults to "none" 
Note
This function does not test for ties.
Author(s)
Thorsten Pohlert
References
Janez Demsar (2006), Statistical comparisons of classifiers over multiple data sets, Journal of Machine Learning Research, 7, 130.
P. Nemenyi (1963) Distributionfree Multiple Comparisons. Ph.D. thesis, Princeton University.
Lothar Sachs (1997), Angewandte Statistik. Berlin: Springer. Pages: 668675.
See Also
friedman.test
,
kruskal.test
,
posthoc.kruskal.nemenyi.test
,
Tukey
Examples
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16  ##
## Sachs, 1997, p. 675
## Six persons (block) received six different diuretics (A to F, treatment).
## The responses are the Naconcentration (mval)
## in the urine measured 2 hours after each treatment.
##
y < matrix(c(
3.88, 5.64, 5.76, 4.25, 5.91, 4.33, 30.58, 30.14, 16.92,
23.19, 26.74, 10.91, 25.24, 33.52, 25.45, 18.85, 20.45,
26.67, 4.44, 7.94, 4.04, 4.4, 4.23, 4.36, 29.41, 30.72,
32.92, 28.23, 23.35, 12, 38.87, 33.12, 39.15, 28.06, 38.23,
26.65),nrow=6, ncol=6,
dimnames=list(1:6,c("A","B","C","D","E","F")))
print(y)
friedman.test(y)
posthoc.friedman.nemenyi.test(y)
