0
$\begingroup$

I performed a Friedman's test, which showed that there are differences among my treatments. Thus, I choose to perform the Nemenyi's post-hoc test in order to infer which treatments statistically differ among them. Thus, I used the posthoc.friedman.nemenyi.test from the PMCMR package to perform pairwise comparisons between treatments.

Now, I want to divide my treatments into groups, like the example below.

Treatment 1    a
Treatment 2    ab
Treatment 3     b
Treatment 4      c

My question is: Given the p-values of a multiple-comparison post-hoc test, how can I split my treatments into groups as the above example?


Note: This question is very similar to How to obtain the results of a Tukey HSD post-hoc test in a table showing grouped pairs?. However, I want to get this information for the Nemenyi's test instead of the Tukey's test.

$\endgroup$
  • $\begingroup$ What do you mean by "How can I do that?"? Are you asking for code? (Note that questions that are only about how to use software are off topic here.) $\endgroup$ – gung Oct 15 '18 at 18:49
  • $\begingroup$ This is virtually the same question as pointed in my reference (that was answered here in Cross Validated). I want an algorithm (or the idea of an algorithm) to perform such a task, not the code itself. I edited the question for a clearer objective. $\endgroup$ – Iago Carvalho Oct 15 '18 at 18:52
1
$\begingroup$

After a little more of research, I found a R code that solved this question. However, I still don't know how it works.


It is possible to use the multcompLetters function of the multcompView package along with the fullPTable function of the rcompanion package.

Thus, the following code outputs the grouped treatments:

if(!require(multcompView)){install.packages("multcompView")}
if(!require(PMCMR)){install.packages("PMCMR")}
if(!require(rcompanion)){install.packages("rcompanion")}

library(PMCMR)
library(rcompanion)
library(multcompView)

pTable  = posthoc.friedman.nemenyi.test(input)$p.value
pTableComplete = fullPTable(pTable)
multcompLetters(pTableComplete)
$\endgroup$

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.