Home Statistical Dictionary Fisher's Exact Test
Fisher's Exact Test
An exact test of independence for a contingency table, most often a 2x2 table, that computes the exact p-value from the hypergeometric distribution rather than relying on a large-sample chi-square approximation.
In Plain English
Instead of approximating how surprising a table of counts is the way the chi-square test does, Fisher's exact test calculates the exact probability of the observed table, and of every more extreme table with the same row and column totals, by direct combinatorics. That makes it the right choice when sample sizes are small or some expected cell counts are low, exactly the conditions where the chi-square approximation is least trustworthy.
Definition
For a 2x2 contingency table with fixed row and column margins, Fisher's exact test computes the exact probability of the observed table under the hypergeometric distribution, then sums this probability over the observed table and every other table with the same margins that is as extreme or more extreme in the direction of the alternative hypothesis, yielding an exact p-value with no large-sample approximation involved. The test generalizes beyond 2x2 tables to tables, though the computation becomes substantially more demanding as the table grows, requiring network algorithms rather than direct enumeration of every possible table.
Formula
Notation
Worked Example
In a 2x2 table with cells 8, 2 / 1, 9 (), several expected counts fall below 5, making the chi-square approximation unreliable. Fisher's exact test instead sums the hypergeometric probabilities of this table and every more extreme table with the same margins, producing an exact p-value directly, with no distributional approximation involved.
Common Misconceptions
- Fisher's exact test is not only for small samples, it is exact at any sample size, small samples are simply where it matters most, since the chi-square approximation is otherwise least reliable there.
- The test conditions on both the row and column margins being fixed, an assumption that does not always match how the data were actually collected, a distinction at the heart of the debate over Barnard's exact test.
Properties
- Fisher's exact test conditions on both margins of the table being fixed, treating the table as a single draw from the hypergeometric distribution given those fixed margins, a framing that is exactly correct when both margins genuinely are fixed by the study design, and only an approximation otherwise.
- Because it is exact rather than asymptotic, Fisher's exact test remains valid at any sample size, including the very small samples and sparse tables where the Pearson chi-square test's large-sample approximation breaks down.
- The test can be run one-sided or two-sided, and two-sided p-values are conventionally computed by summing the probabilities of all tables at least as extreme as the observed one, a definition that is unambiguous for 2x2 tables but admits more than one reasonable convention for larger tables.
At a Glance
Used in These Tests