I get an error when I try to run the Dunntest on my data and I can't figure out what's causing it.
I have 4 groups with ordinal discrete data, the Kruskal-Wallis test suggest a significant difference between groups but I can't run the dunntest afterwards.
Any help is appreciated.
> mast_cells
# A tibble: 20 × 2
group score
<ord> <dbl>
1 1 1
2 1 1
3 1 1
4 1 1
5 1 1
6 2 3
7 2 4
8 2 2
9 2 1
10 2 3
11 3 2
12 3 1
13 3 2
14 3 3
15 3 3
16 4 3
17 4 2
18 4 3
19 4 2
20 4 2
> mast_cells$group <- ordered(mast_cells$group ,
+ levels = c("1", "2", "3", "4"))
> kruskal.test( score ~ group, data = mast_cells)
Kruskal-Wallis rank sum test
data: score by group
Kruskal-Wallis chi-squared = 9.1875, df = 3, p-value = 0.0269
> library(FSA)
> dunnTest(score ~ group,
+ data = mast_cells,
+ method="Benjamini-Yekuteili")
Error in if (tmp$Eclass != "factor") { : the condition has length > 1
>