I have a CSV file with two columns: group and weight. I'm able to do a Kruskal–Wallis test:
kruskal.test(Weight~Group, data=Data.df)
I want to calculate pairwise multiple comparisons with the control group (there are different treatments). I have tried dunn.test.control
, but I only get errors. I don't think I'm using the command correctly.
Any idea what I'm doing wrong? Feel free to show an example!
You will get a better response if you include some data (or illustrate your issue using data already available in R (see
data()
), show the code that was not working and the error message(s), and indicate what package the function giving you trouble comes from sincedunn.test.control
is not included with R but in thePMCMR
package. For example, we can use theiris
data set included in R (?iris
for info):Shows that there is a significant difference. Now the Dunn test:
No error message so you probably did not specify the test correctly. But this is not a pairwise test. You probably want
Notice the warning message. The test runs, but exact probabilities cannot be computed because there are tied ranks. Two of the comparisons are so small that ties are not a factor unless your sample size is small. I prefer the version of the test in
DescTools
since it also shows the mean rank difference between each pair: