Reputation: 2900
I have a contingency table like this in R:
Input:
data <- matrix(c(2, 20, 16, 7, 20, 23), nrow = 2, byrow = TRUE,
dimnames = list(G1 = c("A", "B"),
G2 = c("1", "2", "3")))
Output:
G2
1 2 3
G1 A 2 20 16
B 7 20 23
I applied a chi-square test and also a fisher test. Now, I want to perform a pairwise comparison inside each level for each group. For example:
For level A in G1, is there a difference between 1 and 2 in G2? At the end, I want to be able to have a table like this for:
G1-A:
Contrast | p-value
1-2 xxx
1-3 xxx
2-3 xxx
G1-B:
Contrast | p-value
1-2 xxx
1-3 xxx
2-3 xxx
I tried different packages in R, but none of them give me what I want. Am I trying something that doesn't make sense? Or could anyone help me with how to calculate this, please?
Upvotes: 1
Views: 79