Description Usage Arguments Details Value Note Author(s) References See Also Examples
View source: R/posthoc.friedman.nemenyi.test.R
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
).
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, ...)

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. 
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.
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" 
This function does not test for ties.
Thorsten Pohlert
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.
friedman.test
,
kruskal.test
,
posthoc.kruskal.nemenyi.test
,
Tukey
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)

A B C D E F
1 3.88 30.58 25.24 4.44 29.41 38.87
2 5.64 30.14 33.52 7.94 30.72 33.12
3 5.76 16.92 25.45 4.04 32.92 39.15
4 4.25 23.19 18.85 4.40 28.23 28.06
5 5.91 26.74 20.45 4.23 23.35 38.23
6 4.33 10.91 26.67 4.36 12.00 26.65
Friedman rank sum test
data: y
Friedman chisquared = 23.333, df = 5, pvalue = 0.0002915
Pairwise comparisons using Nemenyi multiple comparison test
with q approximation for unreplicated blocked data
data: y
A B C D E
B 0.1880    
C 0.0917 0.9996   
D 0.9996 0.3388 0.1880  
E 0.0395 0.9898 0.9996 0.0917 
F 0.0016 0.6363 0.8200 0.0052 0.9400
P value adjustment method: none
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.