about statistical-calculators.site
Enter the observed counts for your 2×2 contingency table. Fisher's Exact Test computes the exact p-value for testing whether two categorical variables are independent — especially suitable for small sample sizes where the chi-square approximation may not be valid.
| Success | Failure | Row Total | |
|---|---|---|---|
| Exposed | 17 | ||
| Unexposed | 13 | ||
| Column Total | 15 | 15 | 30 |
Follow these steps to perform Fisher's Exact Test on your 2×2 contingency table:
Enter the observed counts into the four cells of the 2×2 table (a, b, c, d). Each cell must be a non-negative integer. Optionally, customize the row and column labels to match your study's variables (e.g., "Drug A / Placebo" and "Recovered / Not Recovered").
The calculator will automatically show whether any expected cell count is below 5. If so, Fisher's Exact Test is the appropriate choice over the chi-square test.
Click the Calculate button to get:
Fisher's Exact Test is a statistical significance test used to analyze 2×2 contingency tables. It determines whether there is a nonrandom association between two binary categorical variables. Unlike the chi-square test, which uses an approximation, Fisher's test calculates the exact probability of observing the data given the null hypothesis of independence.
The test was developed by Ronald Fisher in 1922. The name "exact" refers to the fact that no approximation is needed — it computes the exact hypergeometric probability of the observed and more extreme tables.
Data for Fisher's test is arranged in a 2×2 table with four cells:
| Outcome: Yes | Outcome: No | Row Total | |
|---|---|---|---|
| Group 1 (Exposed) | a | b | a + b |
| Group 2 (Unexposed) | c | d | c + d |
| Column Total | a + c | b + d | N = a+b+c+d |
The exact p-value is calculated by summing the hypergeometric probabilities of all tables as extreme or more extreme than the observed one. The probability of any single table with fixed marginals is:
Where \(N = a + b + c + d\) is the total number of observations.
The odds ratio (OR) measures the strength of association:
$$ OR = \frac{a \times d}{b \times c} $$The 95% confidence interval for the odds ratio uses the Woolf (log) method:
$$ \ln(OR) \pm 1.96 \times \sqrt{\frac{1}{a} + \frac{1}{b} + \frac{1}{c} + \frac{1}{d}} $$The relative risk (RR) compares the probability of the outcome in each group:
$$ RR = \frac{a/(a+b)}{c/(c+d)} $$A researcher tests a new drug on 20 patients: 10 receive the drug, 10 receive a placebo. Results after treatment:
| Recovered | Not Recovered | Total | |
|---|---|---|---|
| Drug | 8 | 2 | 10 |
| Placebo | 4 | 6 | 10 |
| Total | 12 | 8 | 20 |
H₀: There is no association between treatment and recovery (drug and recovery are independent).
H₁: There is an association between treatment and recovery.
Expected count for cell (Drug, Recovered) = (10 × 12) / 20 = 6. Since all expected counts ≥ 5, either test could be used, but Fisher's is still valid.
For a two-tailed test, we sum all table probabilities ≤ P(observed). In this case, the two-tailed p-value ≈ 0.1698.
Since p ≈ 0.17 ≥ 0.05, we fail to reject the null hypothesis. There is insufficient evidence to conclude the drug significantly affects recovery at the α = 0.05 level.
Odds Ratio = (8 × 6) / (2 × 4) = 6.0, suggesting a 6-fold higher odds of recovery with the drug, though not statistically significant given the small sample.
An epidemiologist studies whether exposure to a chemical is associated with disease in a small population of 15 subjects:
| Disease | No Disease | Total | |
|---|---|---|---|
| Exposed | 5 | 1 | 6 |
| Unexposed | 2 | 7 | 9 |
| Total | 7 | 8 | 15 |
Expected count for "Exposed, No Disease" = (6 × 8) / 15 = 3.2 < 5. The chi-square approximation is invalid here — Fisher's Exact Test is required.
Two-tailed p-value ≈ 0.0559. Odds Ratio = (5 × 7) / (1 × 2) = 17.5, indicating a strong association. Though p is just above 0.05, the large OR and small sample size suggest the study may be underpowered.
Q1: Is Fisher's Exact Test always better than the chi-square test?
Not necessarily. Fisher's test is always valid, but for large samples both tests give virtually identical results. Chi-square is computationally simpler for large samples. Fisher's test is specifically recommended when expected cell counts are < 5 or sample sizes are small.
Q2: What is the difference between one-tailed and two-tailed p-values?
A two-tailed test (default) tests whether the association goes in either direction — whether group 1 has higher or lower odds. A one-tailed test tests a specific direction (e.g., group 1 has strictly higher odds). Use a one-tailed test only if you had a directional hypothesis before collecting data. The two-tailed p-value is always ≥ the one-tailed p-value.
Q3: Can Fisher's Exact Test be used for tables larger than 2×2?
Yes — extensions exist for r×c tables (called the Fisher-Freeman-Halton test), but the computation becomes very intensive. This calculator focuses on the standard 2×2 case.
Q4: What does a confidence interval for the odds ratio mean?
A 95% CI for the OR that does not include 1.0 corresponds to a statistically significant result at α = 0.05. For example, OR = 4.5 (95% CI: 1.2–17.0) means the true OR is likely between 1.2 and 17.0, and since 1.0 is excluded, the result is significant.
Q5: How is Fisher's test different from McNemar's test?
Fisher's Exact Test requires independent groups (e.g., two different groups of patients). McNemar's test is used for paired/matched data (e.g., the same patients measured before and after treatment).