Fisher's Exact Test Notes
Fisher's Exact Test
3.7 Fisher's Exact Test
- This method calculates the exact probability of the statistic.
- Usually used for 2x2 tables, but it can be applied to larger tables.
Fisher's Exact Test for 2x2 Cases
- The test relies on the hypergeometric distribution.
The Hypergeometric Distribution
Suppose a box contains blue marbles and red marbles.
We perform trials where a marble is chosen, its color noted, and then the marble is placed back (sampling with replacement).
Let denote the number of blue marbles chosen in trials; then, using the binomial distribution:
(3.6)
- where and
If we modify this so that we have sampling without replacement, then the probability of "success" on each trial differs, and we have:
(3.7)Which is the probability mass function (PMF) of the hypergeometric distribution.
Let , then and .
(3.8)
- with and (3.9)
Then we say .
If is large compared with , (3.8) reduces to (3.6) and (3.9) reduces to and respectively.
I.e., under these conditions, sampling without replacement becomes the same as sampling with replacement.
Example 3.8
Box of 20 marbles, 12 red, 8 blue. Ten are taken without replacement. Find .
Let denote the number of blue marbles; then .
Note that
Then
Fisher's Exact Test for the 2x2 Case
- Hypotheses:
- H₀: there is no association between the two variables.
- H₁: depends on the question.
| Cat. A₁ | Cat. A₂ | Totals | |
|---|---|---|---|
| Cat. B₁ | a | b | a + b |
| Cat. B₂ | c | d | c + d |
| Totals | a + c | b + d | n |
- Corresponding expected frequencies do not satisfy the assumption.
- Assuming H₀ and the given totals, the probability of obtaining this particular arrangement of data is calculated using the hypergeometric distribution, i.e.,
- Fisher's Exact Test: use this formula to calculate exact probabilities of outcomes observed and more extreme than observed (depends on H₁). This gives us a p-value.
- Note: "More extreme outcomes" must satisfy the row and column totals.