Fisher's Exact Test Calculator
Free Fisher's exact test calculator. 2ร2 contingency table, exact p-value, odds ratio, relative risk
Why This Statistical Analysis Matters
Why: Statistical calculator for analysis.
How: Enter inputs and compute results.
Fisher's Exact Test โ 2ร2 Contingency Table
Exact p-value (no approximation). Preferred for small samples over chi-square. Odds ratio, relative risk, 95% CI.
Real-World Scenarios โ Click to Load
2ร2 Table
Labels (optional)
2ร2 Table Heatmap
P-value Distribution (All Possible Tables)
Red bars: tables with P โค P(observed) (included in two-sided p-value).
Odds Ratio & 95% CI
Woolf method. CI excludes 1 โ significant association.
Calculation Breakdown
For educational and informational purposes only. Verify with a qualified professional.
Key Takeaways: Small Samples vs Chi-Square
- Fisher's exact test: Exact p-value for 2ร2 tables. Uses hypergeometric distribution โ no approximation.
- When to use Fisher instead of chi-square: Any expected cell count < 5, or total N < 20. Chi-square fails for small samples.
- Chi-square can be anti-conservative for small tables โ p-values too small, inflating Type I error. Fisher is always valid.
- P(table): (a+b)!(c+d)!(a+c)!(b+d)! / (a!b!c!d!N!). One-sided sums P in one direction; two-sided sums P for tables with P โค P(observed).
- Odds ratio: OR = (aรd)/(bรc). 95% CI via Woolf. OR = 1 means no association.
- Rule of thumb: N < 20 or any expected < 5 โ use Fisher. N โฅ 40 and all expected โฅ 5 โ chi-square is fine.
Did You Know?
Fisher vs Chi-Square: Decision Table
| Condition | Use |
|---|---|
| Any expected < 5 | Fisher exact |
| Total N < 20 | Fisher exact |
| N โฅ 40, all expected โฅ 5 | Chi-square OK |
| Zero cells | Fisher exact (chi-square fails) |
Fisher vs Chi-Square: Decision Table
| Condition | Use |
|---|---|
| Any expected < 5 | Fisher exact |
| Total N < 20 | Fisher exact |
| N โฅ 40, all expected โฅ 5 | Chi-square OK |
| Zero cells | Fisher exact |
Formulas
P(table) = (a+b)!(c+d)!(a+c)!(b+d)! / (a!b!c!d!N!)
Hypergeometric probability
OR = (aรd) / (bรc)
Odds ratio
95% CI: ln(OR) ยฑ 1.96 ร โ(1/a + 1/b + 1/c + 1/d)
Woolf method
RR = (a/(a+b)) / (c/(c+d))
Relative risk
One-Sided vs Two-Sided
One-sided: Test direction (e.g., group A has higher proportion than B). Sum P for tables as extreme or more extreme in that direction. Two-sided: Test for any association. Sum P for all tables with P โค P(observed). Two-sided is default when direction is not pre-specified.
Frequently Asked Questions
When should I use Fisher exact instead of chi-square?
When any expected cell count is < 5, or total N < 20. Fisher exact is always valid; chi-square is an approximation for large samples.
What does the odds ratio mean?
OR > 1: higher odds of the outcome in row 1 vs row 2. OR < 1: lower odds. OR = 1: no association.
What is relative risk?
RR = (proportion in row 1) / (proportion in row 2). RR > 1 means group 1 has higher proportion.
What if I have a zero cell?
Fisher exact works with zeros. Odds ratio may be 0 or โ; 95% CI may be undefined.
What is the Lady Tasting Tea experiment?
Fisher's 1935 experiment: 8 cups, 4 with milk-first. Lady claimed she could tell. Test: could she guess all 4 correctly by chance?
2ร2 Table Layout
| Group A | Group B | Total | |
|---|---|---|---|
| Yes | a | b | a+b |
| No | c | d | c+d |
| Total | a+c | b+d | N |
Official Data Sources
Limitations
- โข Only for 2ร2 tables. For larger tables, use Fisher-Freeman-Halton or chi-square.
- โข Computationally intensive for very large tables (many possible tables).
- โข Odds ratio CI (Woolf) assumes log OR is approximately normal; may fail with zeros.
- โข Two-sided p-value can be conservative (slightly larger than chi-square).
Applications
Clinical Trials
Drug vs placebo, treatment outcome.
Genetics
Gene-disease association.
A/B Testing
Low traffic conversion tests.
Epidemiology
Exposure vs disease.
Chart Interpretation
The heatmap shows cell counts in the 2ร2 table. The p-value distribution chart shows all possible tables with the same margins โ red bars are tables with P โค P(observed) (included in two-sided p-value). The odds ratio CI bar shows the 95% confidence interval for the odds ratio.
Worked Example: Lady Tasting Tea
Fisher's classic experiment: 8 cups total, 4 with milk added first, 4 with tea first. Lady correctly identifies all 4 milk-first cups. Table: a=4, b=0, c=0, d=4. P(observed) = 1/70 โ 0.0143. One-sided p-value = 0.0143 (she did better than chance). Two-sided = 0.0286. Significant at ฮฑ=0.05 โ evidence she could tell the difference.
Disclaimer: This calculator provides statistical guidance. For medical or clinical decisions, consult a qualified professional.
Related Calculators
Chi-Square Calculator
Perform chi-square goodness-of-fit and independence tests. ฯยฒ statistic, p-value, degrees of freedom, and Cramรฉr's V.
StatisticsCritical Value Calculator
Find critical values for z, t, chi-square, and F distributions given significance level and degrees of freedom.
StatisticsP-Value Calculator
Compute p-values from test statistics for z, t, chi-square, and F distributions. One-tailed and two-tailed tests. Significance stars and decision rule.
StatisticsAbsolute Uncertainty Calculator
Computes absolute uncertainty, relative (percentage) uncertainty, and propagates uncertainties through arithmetic operations. Essential for physics...
StatisticsAB Test Calculator
Full A/B test statistical significance calculator. Two-proportion z-test, sample size estimation, power analysis, confidence intervals, and Bayesian approach.
StatisticsANOVA Calculator
One-way analysis of variance (ANOVA) calculator. Compare means of multiple groups, compute F-statistic, p-value, eta squared, and ANOVA table with...
Statistics