Fisher's Exact Test Calculator
Paste your 2x2 table, choose the alternative hypothesis, and obtain exact hypergeometric probabilities, mid-p adjustments, odds ratios, and a concise interpretation. Designed for small samples where chi-square approximations break down.
1. Enter Your 2x2 Contingency Table
Hypergeometric backboneFormula snapshot
Fisher's exact probability for observed table \((a, b, c, d)\):
\[ P = \frac{\binom{a + b}{a}\binom{c + d}{c}}{\binom{n}{a + c}}, \quad n = a + b + c + d \]
Sum probabilities across tail tables consistent with the margins to obtain the exact p-value for your chosen alternative.
Exact Test Output
Results readyKey Values
- Alternative
- Exact p-value
- Two-sided p
- Mid-p (two-sided)
- P(observed)
- Alpha threshold
Effect Sizes
- Odds ratio
- Phi coefficient
- Risk difference
- Risk ratio
Decision
Observed Table & Margins
| Column 1 | Column 2 | Row total | |
|---|---|---|---|
| Row 1 | |||
| Row 2 | |||
| Column total |
Step-by-step Workflow
Hypergeometric distribution details
With fixed margins \(r_1, r_2, c_1, c_2\), the count in the top-left cell \(A\) follows: \[ P(A = k) = \frac{\binom{c_1}{k} \binom{c_2}{r_1 - k}}{\binom{n}{r_1}} \] for all \(k\) between \(\max(0, r_1 - c_2)\) and \(\min(r_1, c_1)\).
Distribution of Compatible Tables
| Cell a | Cell b | Cell c | Cell d | Probability |
|---|
References
- Fisher, R. A. (1935). The Design of Experiments. Oliver & Boyd.
- Mehta, C. R., & Patel, N. R. (1983). A network algorithm for performing Fisher's exact test in r x c contingency tables. Journal of the American Statistical Association, 78(382), 427-434.
- Agresti, A. (2018). Statistical Methods for the Social Sciences (5th ed.). Pearson.