I'm trying to perform pairwise chi-squared comparisons with RVAideMemoire::chisq.multcomp, but i'm getting implausible output.
Basically, i want to check if there are differences in diabetes prevalence across classes A, B and C. Here's an example.
data <- tibble(diabetes=sample(x=c(0,1), size=100, replace = TRUE), class=sample(x=c("A", "B", "C"), size=100, replace = TRUE))
chisq.test(table(data$diabetes, data$class))
chisq.multcomp(table(data$diabetes, data$class))
```
After running chisq.multcomp i get
>Pairwise comparisons using chi-squared tests
>>data: table(data$diabetes,data$class)
>>> 12 14 14 17 17
>>>14 0.80 - - - -
>>>14 0.80 1.00 - - -
>>>17 0.76 0.80 0.80 - -
>>>17 0.76 0.80 0.80 1.00 -
>>>26 0.29 0.29 0.29 0.51 0.51
>>>
>>>P value adjustment method: fdr
I'd expect the output to be a 3x3 matrix with pairwise p values.
Any explanations for that?