What Is Fisher's Exact Test?
Fisher's exact test is a hypothesis test that gives the exact p-value for an association between 2 yes/no variables in a 2 × 2 table, without any large-sample approximation.
The test suits small samples and tables with expected counts below 5, where the chi-square test breaks down. Ronald A. Fisher introduced the test in 1935 in The Design of Experiments. It is not the Fisher z test, which compares correlations. For tests on means, use the Z Test Calculator.
How Fisher's Exact Test Works (Hypergeometric Probability)
Fisher's exact test fixes the row and column totals and calculates the probability of every possible table with the hypergeometric distribution.
The cells are labelled a and b (group 1, outcome yes/no) and c and d (group 2). The two-sided p-value adds the probabilities of every table that is no more likely than the observed table.
When to Use Fisher's Exact Test
Use Fisher's exact test in 3 situations:
- A 2 × 2 table of two yes/no variables.
- Small samples, such as a pilot trial with 20 patients.
- Expected counts below 5 in one or more cells.
How to Use the Fisher Exact Test Calculator
To use the Fisher exact test calculator, follow 3 steps:
- Enter the 4 cell counts: a and b for group 1, c and d for group 2.
- Choose the alternative: odds ratio ≠ 1, < 1 or > 1.
- Set α.
The mosaic draws the table with tile areas equal to the counts, and the bar chart shows the probability of every possible value of cell a. Gold bars are the tables added into the p-value, and the red bar is your table.
Interpreting the Results (P-Value and Odds Ratio)
A p-value at or below α means the outcome is associated with group, and the odds ratio shows the direction and strength of the association. The odds ratio is OR = (a × d) / (b × c). OR = 8 means the odds of "yes" are 8 times higher in group 1. When a cell holds 0, the calculator adds 0.5 to every cell (the Haldane correction) to keep the odds ratio finite.
One-Sided vs. Two-Sided Fisher Exact Test
A one-sided Fisher test checks for an association in one stated direction, and a two-sided test checks both directions. The one-sided p-value adds the tables at least as extreme in the stated direction. Choose the side before looking at the data.
Fisher Exact Test Example: Small Treatment Trial
23 patients: 9 of 12 improve on treatment and 3 of 11 improve on placebo.
- Tablea = 9, b = 3, c = 3, d = 8
- Odds ratio(9 × 8) / (3 × 3) = 8.0
- P(observed table)0.0268
- Two-sided p-value0.0391
- One-sided p-value(OR > 1) 0.0296
- DecisionReject H₀ at α = 0.05: improvement is associated with treatment.
The Lady Tasting Tea: Where the Test Came From
Fisher's exact test grew out of the "lady tasting tea" experiment. Muriel Bristol, a scientist at Rothamsted, claimed she could tell whether milk was poured into a cup before or after the tea. Fisher designed a test with 8 cups, 4 of each kind. Guessing all 8 correctly by chance has probability 1 / C(8, 4) = 1/70 = 0.014. Reports say she identified every cup.
Fisher's Exact Test vs. Chi-Square Test
Use Fisher's exact test for small 2 × 2 tables, and the chi-square test for large tables or tables larger than 2 × 2. With large samples the two give nearly the same p-value. Analyse larger tables with the chi-square calculator.
FAQs
Can I use Fisher's exact test on tables larger than 2×2?
Yes, the Freeman–Halton extension applies Fisher's exact test to larger tables. This calculator covers 2 × 2 tables; R's fisher.test and SPSS run the extension. For large samples, the chi-square test is faster and gives a similar answer.
Is Fisher's exact test too conservative?
Yes, Fisher's exact test is slightly conservative, so its true Type I error rate falls below α. The discreteness of the counts causes this. The mid-p version, which counts only half the probability of the observed table, gives a less conservative p-value.
Can I use it when my sample is large?
Yes, Fisher's exact test works with large samples, but the chi-square test or the two-proportion z-test gives almost the same p-value faster. Compare two large groups' percentages with the two-proportion z-test.
How is it different from the Fisher z test?
Fisher's exact test analyses a 2 × 2 table of counts, while the Fisher z test compares correlation coefficients. Both carry Fisher's name. Test or compare correlations with the Fisher z test calculator.
How do I report Fisher's exact test in APA format?
Report Fisher's exact test with both proportions, the odds ratio and the exact p-value. Example: "More patients improved on treatment (9/12) than on placebo (3/11), Fisher's exact test p = .039, OR = 8.0."