The problem is that the row and column labels for the matrix make the results difficult to understand. ‡
In the following, since there are no column labels, the columns will be labeled V1 to V7 by default. This will make it easy to evaluate the comparisons between them.
if(!require(PMCMR)){install.packages("PMCMR")}
Input =("
0.9753954 0.9771529 0.9789104 0.9789104 0.9806678 0.9771529 0.9806678
0.9736380 0.9806678 0.9806678 0.9806678 0.9841828 0.9771529 0.9771529
0.9753954 0.9841828 0.9806678 0.9771529 0.9806678 0.9771529 0.9718805
0.9771529 0.9859402 0.9789104 0.9789104 0.9824253 0.9824253 0.9841828
0.9736380 0.9806678 0.9771529 0.9824253 0.9824253 0.9806678 0.9771529
0.9701230 0.9789104 0.9736380 0.9806678 0.9841828 0.9824253 0.9753954
0.9912127 0.9912127 0.9859402 0.9859402 0.9859402 0.9841828 0.9824253
0.9789104 0.9806678 0.9859402 0.9859402 0.9841828 0.9806678 0.9789104
0.9806678 0.9841828 0.9876977 0.9824253 0.9841828 0.9859402 0.9841828
0.9789104 0.9771529 0.9753954 0.9789104 0.9666081 0.9613357 0.9630931
")
Matrix = as.matrix(read.table(textConnection(Input)))
Matrix
### V1 V2 V3 V4 V5 V6 V7
### [1,] 0.9753954 0.9771529 0.9789104 0.9789104 0.9806678 0.9771529 0.9806678
### [2,] 0.9736380 0.9806678 0.9806678 0.9806678 0.9841828 0.9771529 0.9771529
### [3,] 0.9753954 0.9841828 0.9806678 0.9771529 0.9806678 0.9771529 0.9718805
### [4,] 0.9771529 0.9859402 0.9789104 0.9789104 0.9824253 0.9824253 0.9841828
### [5,] 0.9736380 0.9806678 0.9771529 0.9824253 0.9824253 0.9806678 0.9771529
### [6,] 0.9701230 0.9789104 0.9736380 0.9806678 0.9841828 0.9824253 0.9753954
### [7,] 0.9912127 0.9912127 0.9859402 0.9859402 0.9859402 0.9841828 0.9824253
### [8,] 0.9789104 0.9806678 0.9859402 0.9859402 0.9841828 0.9806678 0.9789104
### [9,] 0.9806678 0.9841828 0.9876977 0.9824253 0.9841828 0.9859402 0.9841828
### [10,] 0.9789104 0.9771529 0.9753954 0.9789104 0.9666081 0.9613357 0.9630931
library(PMCMR)
posthoc.friedman.nemenyi.test(Matrix)
### Pairwise comparisons using Nemenyi multiple comparison test
with q approximation for unreplicated blocked data
### data: Matrix
### V1 V2 V3 V4 V5 V6
### V2 0.088 - - - - -
### V3 0.310 0.998 - - - -
### V4 0.185 1.000 1.000 - - -
### V5 0.027 1.000 0.958 0.991 - -
### V6 0.804 0.830 0.987 0.946 0.576 -
### V7 0.987 0.436 0.804 0.645 0.207 0.996
###
### P value adjustment method: none
The output above is a table of p-values, each comparing two groups. If you are using p = 0.05 as your cutoff, the only significant comparison is V1 vs. V5 (p = 0.027). The rest of the p-values are all greater than 0.05.
It may be useful to translate this matrix of p-values to a compact letter display. In this output, groups sharing a letter are not significantly different. For this I'll use the fullPTable
function in the rcompanion
package † and multcompLetters
from multcompView
.
if(!require(multcompView)){install.packages("multcompView")}
if(!require(PMCMR)){install.packages("PMCMR")}
if(!require(rcompanion)){install.packages("rcompanion")}
library(PMCMR)
library(rcompanion)
library(multcompView)
PT = posthoc.friedman.nemenyi.test(Matrix)$p.value
PT1 = fullPTable(PT)
PT1
library(multcompView)
multcompLetters(PT1)
### V1 V2 V3 V4 V5 V6 V7
### "a" "ab" "ab" "ab" "b" "ab" "ab"
V1 and V5 are the only two groups not sharing a letter.
Addition: PMCMRplus package
There are a few different post-hoc tests available for Friedman's test in PMCMRplus package. Functions begin with frdAllPairs. The Nemenyi test appears to produce results similar to those above. For this example, it was necessary to add row labels to the matrix.
if(!require(PMCMRplus)){install.packages("PMCMRplus")}
library(PMCMRplus)
rownames(Matrix) = LETTERS[1:10]
frdAllPairsNemenyiTest(Matrix)
# Pairwise comparisons using Nemenyi-Wilcoxon-Wilcox all-pairs test for a two-way balanced complete block design
#
# V1 V2 V3 V4 V5 V6
# V2 0.088 - - - - -
# V3 0.310 0.998 - - - -
# V4 0.185 1.000 1.000 - - -
# V5 0.027 1.000 0.958 0.991 - -
# V6 0.804 0.830 0.987 0.946 0.576 -
# V7 0.987 0.436 0.804 0.645 0.207 0.996
#
# P value adjustment method: single-step
‡ Note: This answer addresses the primary question: conducting and interpreting Nemenyi test. It does not weigh in on the discussion in the comments, as to whether the generation of this data makes sense or if Friedman's test is the applicable test in this case.
† Caveat: I am the author of this package.
Accuracies Matrix
set up? $\endgroup$