STATISTICSInference & TestsStatistics Calculator
๐Ÿ“Š

Fisher's Exact Test Calculator

Free Fisher's exact test calculator. 2ร—2 contingency table, exact p-value, odds ratio, relative risk

Run CalculatorExplore data analysis and statistical calculations

Why This Statistical Analysis Matters

Why: Statistical calculator for analysis.

How: Enter inputs and compute results.

ฯ‡ยฒ
STATISTICSInference & Tests

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)

fisher_exact_results.sh
CALCULATED
$ fisher_exact --table="8,2,2,8" --tail="two-sided"
p-value
0.023014
P(observed)
1.0960e-2
Odds ratio
16.0000
Relative risk
4.0000
95% CI: [1.7883, 143.1561]
Share:
Fisher's Exact Test
2ร—2 Contingency Table
p = 0.0230
OR = 16.00SignificantRR = 4.00
numbervibe.com/calculators/statistics/fishers-exact-test-calculator

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

OR = 16.0000 [95% CI: 1.7883, 143.1561]

Woolf method. CI excludes 1 โ‡’ significant association.

1.79OR: 16.00143.16

Calculation Breakdown

TABLE
Marginals
R1=10, R2=10, C1=10, C2=10, N=20
ext{Row}/ ext{column} ext{totals}
HYPERGEOMETRIC
P(observed table)
1.096040e-2
(a+b)!(c+d)!(a+c)!(b+d)! / (a!b!c!d!N!)
TEST
Test type
two-sided
p-value (exact)
0.023014
ext{Sum} P ext{for} ext{tables} ext{as}/ ext{more} ext{extreme}
EFFECT
Odds ratio
16.0000
ext{OR} = rac{a imes d}{b imes c}
95% CI (Woolf)
[1.7883, 143.1561]
\text{ln}( ext{OR}) pm 1.96 imes โˆš(1/a+1/b+1/c+1/d)
Relative risk
4.0000
ext{RR} = (a/(a+b)) / (c/(c+d))

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 invented this test when a colleague claimed she could tell if milk or tea was added first. The Lady Tasting Tea experiment.Source: History
๐Ÿ“ŠFor small tables, chi-square can be anti-conservative (p-values too small). Fisher exact is always correct.Source: Small Sample
๐ŸงฌWidely used in genetics for gene-disease association in 2ร—2 tables (e.g., genotype vs phenotype).Source: Genetics
๐Ÿ’ŠClinical trials with rare events often use Fisher exact because expected counts are small.Source: Clinical
๐Ÿ“งA/B tests with low traffic: Fisher exact is preferred over z-test when conversions are few.Source: A/B Testing
๐Ÿ”ฌThe test conditions on row and column margins โ€” it treats them as fixed.Source: Theory

Fisher vs Chi-Square: Decision Table

ConditionUse
Any expected &lt; 5Fisher exact
Total N &lt; 20Fisher exact
N โ‰ฅ 40, all expected โ‰ฅ 5Chi-square OK
Zero cellsFisher exact (chi-square fails)

Fisher vs Chi-Square: Decision Table

ConditionUse
Any expected < 5Fisher exact
Total N < 20Fisher exact
N โ‰ฅ 40, all expected โ‰ฅ 5Chi-square OK
Zero cellsFisher 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 &lt; 5, or total N &lt; 20. Fisher exact is always valid; chi-square is an approximation for large samples.

What does the odds ratio mean?

OR &gt; 1: higher odds of the outcome in row 1 vs row 2. OR &lt; 1: lower odds. OR = 1: no association.

What is relative risk?

RR = (proportion in row 1) / (proportion in row 2). RR &gt; 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 AGroup BTotal
Yesaba+b
Nocdc+d
Totala+cb+dN

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.

๐Ÿ‘ˆ START HERE
โฌ…๏ธJump in and explore the concept!
AI

Related Calculators