Fisher Exact Test

What Is the Fisher Exact Test?

The Fisher exact test is a statistical method used to determine whether there is a meaningful association between two categorical variables arranged in a 2×2 table. Unlike many other tests that rely on approximations, the Fisher exact test calculates the precise probability of observing the data you collected (or something more extreme), which is why it includes the word “exact” in its name.

Imagine a researcher studying whether a new drug reduces the occurrence of headaches. She recruits 20 participants, gives 10 of them the drug and 10 a placebo, and records whether each person experienced a headache. She can arrange the results in a simple 2×2 table: rows for drug versus placebo, and columns for headache versus no headache. The Fisher exact test tells her whether the pattern she sees in that table is likely to have occurred by chance alone.

Why Do We Need It?

You may already have heard of the chi-square test, which is another way to analyze 2×2 tables. The chi-square test works well when sample sizes are large, but it relies on an approximation that breaks down when sample sizes are small. As a rule of thumb, if any expected cell count in your table falls below 5, the chi-square approximation becomes unreliable. The Fisher exact test does not depend on this approximation, so it remains accurate regardless of how small the sample is. This makes it the preferred choice for small-sample studies and any situation where the chi-square assumptions are not met.

How Does It Work?

The test uses something called the hypergeometric distribution. While the name sounds intimidating, the underlying idea is straightforward. Think of it this way: suppose you know the totals for each row and each column of your 2×2 table. Given those fixed totals, there are only a limited number of ways the individual cell counts could be arranged. The hypergeometric distribution gives you the probability of each possible arrangement occurring purely by chance.

The Fisher exact test works out the probability of getting the exact table you observed, and then adds up the probabilities of all tables that are equally extreme or more extreme. The sum of those probabilities is your p-value. If that p-value is small (typically less than 0.05), you conclude that the association between the two variables is unlikely to have arisen by chance.

Interpreting the Result

The test produces a p-value. If the p-value is below your chosen significance level (most commonly 0.05), you reject the null hypothesis and conclude that there is a statistically significant association between the two variables. If the p-value is above 0.05, you do not have sufficient evidence to claim an association exists.

Returning to the headache study: if the Fisher exact test produces a p-value of 0.03, the researcher would conclude that there is a statistically significant association between taking the drug and experiencing fewer headaches. A p-value of 0.45, on the other hand, would mean the observed difference could easily have occurred by chance.

When to Use the Fisher Exact Test

Use this test when you have two categorical variables, each with exactly two levels, and your data can be arranged in a 2×2 contingency table. It is especially appropriate when:

  • Your total sample size is small (generally under 40 or so).
  • One or more expected cell counts in the table are below 5.
  • You want an exact probability rather than an approximation.

Common applications include medical trials with small patient groups, ecological studies with rare species, and any pilot study where data collection is limited.

Key Assumptions

The Fisher exact test has relatively few assumptions, which is part of its appeal. The main requirements are:

  • The data must consist of two categorical variables, each with two categories (a 2×2 table).
  • The observations must be independent, meaning one participant’s outcome does not influence another’s.
  • The row and column totals are treated as fixed. In practice, this assumption is usually satisfied by the study design.

Because the test computes exact probabilities, it does not require assumptions about minimum sample size or the shape of any distribution, making it a reliable and versatile tool for analyzing small 2×2 tables.