36
3.583519
8
0.7
10
10
9
11
20
0.8
0.1
4.5
5.5
4.5
5.5
36
3.583519
8
0.7
10
10
9
11
20
0.8
0.1
4.5
5.5
4.5
5.5
The Fisher's Exact Test Calculator analyzes association in 2×2 contingency tables, especially valuable when sample sizes are small. Unlike the chi-square test which uses an approximation, Fisher's test computes exact probabilities based on the hypergeometric distribution, making it the gold standard for small-sample categorical data analysis.
This calculator provides the odds ratio, risk ratio, log odds ratio, and table marginals. For tables with small cell counts where chi-square is unreliable, Fisher's exact test gives precise results.
Fisher's exact test is based on the hypergeometric distribution. Given fixed row and column marginals, the probability of observing a specific table configuration is:
$$P = \frac{\binom{a+b}{a} \binom{c+d}{c}}{\binom{n}{a+c}} = \frac{(a+b)!(c+d)!(a+c)!(b+d)!}{n! \cdot a! \cdot b! \cdot c! \cdot d!}$$
The p-value is computed by summing probabilities of all tables as extreme or more extreme than the observed table, while keeping marginals fixed. The odds ratio provides a measure of effect size:
$$OR = \frac{a \cdot d}{b \cdot c}$$
The odds ratio compares the odds of the outcome in one group versus the other. OR = 1 indicates no association, OR > 1 indicates higher odds in the first group, and OR < 1 indicates lower odds. The risk ratio (relative risk) is \(RR = (a/(a+b)) / (c/(c+d))\), comparing proportions directly.
The log odds ratio \(\ln(OR)\) is useful because its sampling distribution is approximately normal for moderate sample sizes, facilitating confidence interval construction: \(\ln(OR) \pm z_{\alpha/2} \sqrt{1/a + 1/b + 1/c + 1/d}\).
Interpreting the results from Fisher's exact test:
Inputs
Results
Treatment vs control with small samples. OR = 36.0 indicates very strong association between treatment and positive outcome. 80% success in treatment vs 10% in control.
Inputs
Results
Case-control study of rare exposure. OR = 8.33 suggests exposed individuals have substantially higher odds of disease.
Use Fisher's exact test when: (1) Any expected cell frequency is less than 5, (2) Total sample size is less than 20-30, (3) The data are very unbalanced (one cell count near zero), or (4) You want exact (not approximate) p-values regardless of sample size. Many statisticians recommend Fisher's test as the default for all 2×2 tables.
An odds ratio of 0 or infinity occurs when one cell in the 2×2 table is zero. OR = 0 when a·d = 0, and OR is undefined (infinity) when b·c = 0. This indicates complete separation — one group has zero occurrences of the outcome. In such cases, add 0.5 to each cell (Haldane-Anscombe correction) for estimation purposes.
The odds ratio compares odds (probability of event / probability of no event), while relative risk compares probabilities directly. For rare outcomes (< 10% prevalence), OR ≈ RR. For common outcomes, OR overestimates RR. OR is symmetric (swapping rows and columns gives 1/OR), making it suitable for case-control studies where disease rates cannot be estimated.
Yes, Fisher's exact test can be generalized to r×c tables, though computation becomes intensive for larger tables. The Freeman-Halton extension handles tables larger than 2×2. For practical purposes, many software packages implement exact tests for tables up to moderate size using network algorithms.
Computing Fisher's exact p-value requires factorial calculations that can overflow for even moderate sample sizes. This calculator provides the odds ratio, risk ratio, and table structure. For the exact p-value, use the table marginals with a statistical software package or online tool that implements arbitrary-precision arithmetic.
A 95% CI for OR that does not include 1 indicates a statistically significant association at α = 0.05. The CI width reflects precision — wider intervals indicate less precision (often due to small samples). CIs are typically calculated on the log scale and back-transformed: exp(ln(OR) ± 1.96 × SE(ln(OR))).
Roboculator Team
The Roboculator Team explains calculations, planning tools, and practical formulas in clear language for real-life situations.
How helpful was this calculator?
Be the first to rate!
P-Value Calculator
Statistical Inference & Hypothesis Testing
Confidence Interval Calculator
Statistical Inference & Hypothesis Testing
Margin of Error Calculator
Statistical Inference & Hypothesis Testing
Sample Size Calculator
Statistical Inference & Hypothesis Testing
Critical Value Calculator
Statistical Inference & Hypothesis Testing
Z-Test Calculator
Statistical Inference & Hypothesis Testing