Fisher's Exact Test Calculator
Use this Fisher's exact test calculator to test whether two categorical variables are associated in a 2 × 2 contingency table. It provides exact p-values for small samples.
2 × 2 Contingency Table
Edit the variable and category names inside the table, then enter the four observed counts.
| Treatment Group | Outcome | Row Total | |
|---|---|---|---|
| Row Category | Improved | Not Improved | Total |
| Treatment | 0 | ||
| Control | 0 | ||
| Column Total | 0 | 0 | 0 |
Enter nonnegative whole-number counts. Each row and column must contain at least one observation.
How to Use the Fisher's Exact Test Calculator
Fisher's exact test is a statistical significance test used in the analysis of contingency tables. Here is how to use it:
- Input your observed frequencies (counts) into the 2×2 contingency table. The cells are traditionally labelled a, b, c, and d.
- Select the Test Type (Right-tailed, Left-tailed, or Two-tailed).
- Enter your chosen Significance Level (α), typically 0.05.
- Click Calculate to instantly view the exact p-value and conclusion.
What is Fisher's Exact Test?
Fisher's Exact Test is a nonparametric statistical test used to determine if there are nonrandom associations between two categorical variables. It is the exact equivalent of the Chi-Square test of independence.
Unlike the Chi-Square test, which relies on a large-sample approximation, Fisher's test calculates the exact probability of obtaining the observed table. Therefore, it is highly recommended when sample sizes are small or when any expected cell count is less than 5.
When to Use Fisher's Exact Test?
You should use this test when:
- You have two categorical variables.
- Both variables are independent (groups are distinct).
- You want to test for an association or difference in proportions.
- Your total sample size is small (e.g., N < 30).
- At least one cell has an expected frequency of less than 5 (which violates the assumptions of the Chi-Square test).
Even for large datasets where Chi-Square is applicable, Fisher's Exact Test remains valid and is strictly more accurate, though historically it was computationally intensive to calculate by hand.
Fisher's Exact Test Formula
The probability of observing any specific arrangement of frequencies in a 2x2 table, assuming the null hypothesis (independence) is true, is given by the hypergeometric distribution:
Where:
- a, b, c, d = Observed cell counts
- ! = Factorial (e.g., 5! = 5×4×3×2×1)
- n = Total sample size (a+b+c+d)
Example of Fisher's Exact Test
Suppose you are testing a new medication. You have a control group of 10 people receiving a placebo, and a treatment group of 10 people receiving the medication. You observe the following:
| Cured | Not Cured | Row Total | |
|---|---|---|---|
| Treatment | 8 (a) | 2 (b) | 10 |
| Placebo | 3 (c) | 7 (d) | 10 |
| Col Total | 11 | 9 | 20 |
Using the formula to find the exact probability of this specific table occurring by random chance:
If you are conducting a two-tailed test, the calculator will automatically sum this probability with the probabilities of all other tables (with the same row and column totals) that are as extreme or more extreme to yield the final p-value.
Frequently Asked Questions
What is the difference between Fisher's Exact and Chi-Square?
Both test for association in categorical data. Chi-square is an approximation that works well for large sample sizes. Fisher's is an exact calculation that works for all sample sizes but is mandatory for small sample sizes.
What is the Odds Ratio?
The odds ratio (OR) is calculated as (a×d) / (b×c). An OR of 1 indicates no association. An OR greater than 1 indicates increased odds of the outcome in Group 1, while an OR less than 1 indicates decreased odds.