Fisher's Exact Test
VerifiedCategorical
Run this test straight away on a free built-in teaching dataset — no data of your own needed — or bring your own. Either opens the guided workspace: variable setup, assumption diagnostics, results with effect sizes and confidence intervals, figures, and APA-ready reporting.
Loading teaching datasets…
Or use your own dataset
Loading your datasets…
Always-exact test of independence for 2×2 or small r×c contingency tables.
Conditions on both marginal totals and enumerates the hypergeometric probability of every table at least as extreme as the observed under the null of independence. Reports the exact two-sided p, plus the exact odds ratio with 95% CI (mid-p or conditional ML). The small-sample-safe replacement for χ² when Cochran's expected-count rule is violated; computationally heavy for large tables (Monte-Carlo Fisher is the workaround for r × c > 2 × 5).
Worked example
Is a rare side-effect linked to the drug when the cell counts are tiny?
40 patients cross-classified by drug (yes/no) and side-effect (yes/no). As expected counts fell below 5, Fisher's exact test replaces chi-square.
The side-effect was more common on the drug (8/20 vs 1/20), Fisher's exact p = .02.
Fisher's exact test showed the side-effect was significantly more frequent on the drug (8/20 vs 1/20), p = .02.
Try it yourself: Load this ready-made sample and follow the run above.
When to use it
- Small-sample 2×2 (exposure × outcome)A case-control study with 20 cases and 25 controls assesses a rare exposure (exposed n = 8).
- Rare-event study with sparse cellsDrug safety surveillance: 300 treated patients (3 adverse events) vs 300 control (1 adverse event).
When NOT to — use instead
- Paired same-subject dataFisher assumes INDEPENDENT subjects in cells. → Exact McNemar's Test (small-sample binary paired)
- Continuous outcomeFisher is for binary × binary or small categorical tables. → Independent Samples t-test
- Large 2×2 with all expected counts ≥ 5When asymptotic χ² is valid AND the table is large, χ² is faster and conventional. → Chi-Square Test of Independence
- Very large r × c table (> 2 × 5 with N > 200)Fisher's exact is computationally infeasible for big tables. → G-Test (Likelihood-Ratio \u03c7\u00b2)
Hypotheses
Parameter tested: odds ratio (2×2) or joint distribution (r × c)
Assumptions (and what to do if they fail)
Check: Report r, c, and N.
If violated: Very large r × c tables are computationally expensive for the exact form.
Check: Under multinomial sampling, both marginals are random — but Fisher's conditioning is still valid and conservative.
If violated: Conservative conditioning does not invalidate the p-value; it may reduce power.
Ready to run a Fisher's Exact Test on your own data?
Guided setup, automatic assumption checks, effect sizes, figures and an APA write-up.
Run this test →