# Load necessary libraries
library(PMCMRplus)
library(scmamp)
Nemenyi post-hoc test
Define your data matrix
<- matrix(c(
y 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, LETTERS[1:6])) ),
Perform the Nemenyi post-hoc test
<- nemenyiTest(y)) (nemenyi_result
Nemenyi test
data: y
Critical difference = 3.2853, k = 6, df = 30
<-nemenyi_result$diff.matrix) (matrixz
A B C D E F
[1,] 0.0000000 2.5000000 2.8333333 0.3333333 3.1666667 4.166667
[2,] 2.5000000 0.0000000 0.3333333 -2.1666667 0.6666667 1.666667
[3,] 2.8333333 0.3333333 0.0000000 -2.5000000 0.3333333 1.333333
[4,] 0.3333333 -2.1666667 -2.5000000 0.0000000 2.8333333 3.833333
[5,] 3.1666667 0.6666667 0.3333333 2.8333333 0.0000000 1.000000
[6,] 4.1666667 1.6666667 1.3333333 3.8333333 1.0000000 0.000000
Generate Critical Difference Plot
::plotCD(matrixz, main = "Critical Difference Plot", xlab = "Treatments", ylab = "Mean Ranks") scmamp