Fisher's exact test is a statistical significance test for 2×2 contingency tables. Unlike the chi-square test, it calculates the exact probability of observing the data, making it ideal for small sample sizes where chi-square approximations may be unreliable.
See the assumptions guide for a decision flowchart on choosing the right test.
| Fisher's Exact | Chi-Square |
|---|---|
| Exact p-value | Approximate p-value |
| Any sample size | Large samples preferred |
| 2×2 tables only | Any table size |
| Computationally intensive | Fast calculation |
A small pilot study tests a new treatment:
| Improved | No Change | |
|---|---|---|
| Treatment | 8 | 2 |
| Placebo | 3 | 7 |
With only 20 patients, Fisher's exact test gives p = 0.035, indicating a significant effect.
The test calculates the probability of obtaining the observed distribution (and more extreme ones) by considering all possible arrangements of the data while keeping row and column totals fixed. For the full mathematical derivation including the hypergeometric formula, see the Fisher's Exact Test documentation.
Two-tailed test: Tests for any association (most common)
One-tailed test: Tests for association in a specific direction
CrossTabs.com automatically calculates Fisher's exact p-value for all 2×2 tables:
A clinical trial tests whether a rare adverse event differs between drug and placebo groups. With only 20 patients:
| Adverse Event | No Event | Total | |
|---|---|---|---|
| Drug | 4 | 6 | 10 |
| Placebo | 1 | 9 | 10 |
| Total | 5 | 15 | 20 |
Why not chi-square? Expected count for Drug + Adverse Event = (10 × 5)/20 = 2.5, which is below 5. Chi-square approximation is unreliable here.
Fisher's exact test calculates the exact probability using the hypergeometric distribution: p = C(5,4)×C(15,6) / C(20,10) and sums all tables as extreme or more extreme.
Result: Two-sided p = 0.303. The adverse event rate does not significantly differ between groups.
| Criterion | Use Fisher's Exact | Use Chi-Square |
|---|---|---|
| Any expected count < 5 | ✓ Required | ✗ Unreliable |
| Total N < 20 | ✓ Recommended | ✗ Unreliable |
| Large sample (N > 100) | ✓ Valid but slow | ✓ Preferred (faster) |
| Tables larger than 2×2 | ✓ Valid (computationally intensive) | ✓ Preferred |
| Need exact p-value | ✓ Always exact | ✗ Approximation only |
Use Fisher's exact test when any expected cell count is less than 5, or when the total sample size is less than 20. Fisher's exact test calculates the exact probability rather than relying on the chi-square approximation, making it more reliable for small samples.
Yes, Fisher's exact test can be extended to tables larger than 2×2 (called the Freeman-Halton test), but it becomes computationally intensive. For large tables with adequate expected frequencies, chi-square is generally preferred.