Exact test of association for small contingency tables — the correct choice when chi-square's expected-count rule fails.
Test AssociationBivariatealso known as: Fisher–Irwin test
✓ When to use
2×2 tables with any expected cell count < 5 (or any observed zero).
Small pilot studies, rare events (e.g., serious incidents by shift type).
Whenever you want exact rather than asymptotic p-values for a 2×2 association.
✗ When NOT to use
Large tables with healthy counts — chi-square is standard and effect sizes are more conventional (extensions of Fisher to r×c exist but get computationally heavy).
Paired categorical data — McNemar's exact test.
You need covariate adjustment — exact logistic regression.
Data requirements
Dependent / outcome variable
One dichotomous variable.
Independent / grouping variable
Another dichotomous variable (classic 2×2 case).
Design
Independent observations.
Sample size guidance
Any size — that is the point; it remains valid at n = 10.
Assumptions
Independence of observations.
Fixed margins in the strict derivation (hypergeometric model); in practice applied broadly to small 2×2 tables.
Categories mutually exclusive.
Hypotheses
H₀ — No association between the two dichotomies (odds ratio = 1).
H₁ — An association exists (odds ratio ≠ 1).
The concept
Holding the row and column totals fixed, the number of ways to fill the table follows the hypergeometric distribution. Fisher's test sums the exact probabilities of the observed table and every table at least as extreme — no large-sample approximation is involved, which is why sparse cells cause no trouble.
Report the odds ratio with its exact CI as the effect size. For a 12-vs-2 events pattern the OR can be dramatic even when percentages look modest — ORs exaggerate relative to risk ratios when the outcome is common; interpret accordingly.
Worked example
Safety incidents in a plant: night shift 6 incidents among 20 workers, day shift 1 among 25. Expected counts are far below 5 — chi-square is invalid.
Result: Fisher's exact p = .034, OR = 10.3, 95% CI [1.1, 95.6] — night shift shows significantly higher incident odds, though the CI is wide.
How to run it
tab <- matrix(c(6, 14, 1, 24), nrow = 2, byrow = TRUE,
dimnames = list(shift = c("Night","Day"),
incident = c("Yes","No")))
fisher.test(tab) # exact p and OR with CI
from scipy import stats
table = [[6, 14], [1, 24]]
odds, p = stats.fisher_exact(table, alternative="two-sided")
print(odds, p)
Analyze → Descriptive Statistics → Crosstabs; set rows/columns.
Statistics → Chi-square (Fisher appears automatically for 2×2); for larger sparse tables use Exact → Exact test.
Read 'Fisher's Exact Test' row: report the two-sided exact p, plus the OR (Statistics → Risk).
For a 2×2 with cells a,b,c,d: single-table probability = HYPGEOM.DIST(a, a+b, a+c, n, FALSE).
A full two-sided Fisher p requires summing probabilities of all tables as extreme or more — tedious; practical advice is to use R/Python/SPSS.
OR in a cell: =(a*d)/(b*c).
Interpreting the output
Report the exact two-sided p (state if one-sided and why).
Odds ratio + exact CI as effect size; CI excluding 1 = significant.
Percentages per group carry the practical message.
Wide CIs are honest reflections of small samples — do not over-claim.
APA-style reporting
Fisher's exact test indicated a significant association between shift and safety incidents, p = .034; the odds of an incident were higher on the night shift (30.0%) than the day shift (4.0%), OR = 10.3, 95% CI [1.1, 95.6].
Common mistakes
Running chi-square anyway on a sparse table and reporting the warning-flagged p.
Defaulting to one-sided p to reach significance.
Interpreting a huge OR from tiny cells without showing the CI.