I've tried using R operating Fisher's exact test to test for independence of the 2 datasets below and struggling to interpret the Fisher report. Please have a look at the data and the Fisher's test below.
Dataset 1: is a 2x3 contingency table
Consider then an experiment where we have 2 categorical variables: Group (I and II) & Outcome (Worse, Same, and Improve). These results might follow the administration of a new drug. We collect data and find out the frequencies as shown in the table below.
You can reproduce Dataset 1, and run the Fisher's test using the codes:
obs <- rbind(c(33, 44, 25),
c(11, 28, 30))
rownames(obs) <- c("Group I", "Group II")
colnames(obs) <- c("Worse", "Same", "Improve")
obs
## Worse Same Improve
## Group I 33 44 25
## Group II 11 28 30
fisher.test(obs)
## Fisher's Exact Test for Count Data
## data: obs
## p-value = 0.01049
## alternative hypothesis: two.sided
Dataset 2: is a 2x2 contingency table
Consider then an experiment where we have 2 categorical variables: Group (I and II) & Outcome (Worse and Improve). These results might follow the administration of a new drug. We collect data and find out the frequencies as shown in the table below.
vals <- matrix(c(3, 1, 3, 2),
nrow = 2,
dimnames = list(Group = c("Group I", "Group II"),
Outcome = c("Worsened", "Improved")))
## Outcome
## Group Worsened Improved
## Group I 3 3
## Group II 1 2
fisher.test(vals)
##
## Fisher's Exact Test for Count Data
##
## data: vals
## p-value = 1
## alternative hypothesis: true odds ratio is not equal to 1
## 95 percent confidence interval:
## 0.06060903 156.52286969
## sample estimates:
## odds ratio
## 1.852496
As you can see that I receive 2 different report templates for the two contingency tables a (2x3) and a (2x2). I have 3 questions:
- Why the report of a 2x2 includes the Odds Ratio (OR) and the Confidence Interval, which I believe is a CI of the Odds Ratio, while the 2x3 doesn't have the OR in there?
Does that mean testing for independence using the value of OR can be applied ONLY for 2x2 contingency tables?? - Could you help me interpret the Fisher's test report and point out the connection between the values of p-value, Odds ratio, and the Confidence Intervals?
- In what case will we be using "one-sided Fisher's exact test"? What is the purpose of pointing out a Fisher's test should be one-sided or two-sided?
- Can a table that's NOT 2x2 be tested using a "one-sided Fisher's exact test"?