I am curious about the appropriate statistical test to compare the results from a chi-squared proportion test in R.
In the below code, using a chi-squared proportions test in R, it is shown that the difference between "1" Responses for Group A1 and A2 is significant at > 95%. The difference is 90% 1s vs 10% 1s
It is also shown that the difference between "1" Responses for Group B1 and B2 is significant at > 95%. The difference is 80% 1s vs 20% 1s
However, I am now interested in comparing the resulting differences: the difference between Group A1 and A2, against the difference between Group B1 and B2.
What is the most appropriate test of whether the 90%:10% result from comparing Group A1 and A2, is different from the 80%:20% result from comparing Group B1 and B2? Or is there a single test that should pull in all this information at once?
RESPONSE = c(1,1,1,1,0,1,1,1,1,1,0,0,0,0,0,1,0,0,0,0,1,1,0,1,1,1,1,1,0,1,0,0,0,1,1,0,0,0,0,0)
GROUP = c(rep("Group A1",10),rep("Group A2",10),rep("Group B1",10),rep("Group B2",10))
Data = cbind.data.frame(RESPONSE,GROUP)
table(Data)
#> table(Data)
# GROUP
#RESPONSE Group A1 Group A2 Group B1 Group B2
# 0 1 9 2 8
# 1 9 1 8 2
#Proportion test Group A1 vs A2
prop.test(c(9,1),c(10,10))
#Proportion Group A1 = 0.9
#Proportion Group A2 = 0.1
#P-Value = 0.001745
#Proportion test Group B1 vs B2
prop.test(c(8,2),c(10,10))
#Proportion Group B1 = 0.8
#Proportion Group B2 = 0.2
#P-Value = 0.02535