Course contentsShow
← Data Science
Lesson 432 of 2,14511. Hypothesis Tests for Proportions and CategoriesFree lesson

Fisher's Exact Test: The Logic

Understand how Fisher's Exact Test calculates the exact probability of observing a 2×2 contingency table.

Fisher's Exact Test: The Logic

What You'll Learn

You'll discover how Fisher's Exact Test calculates the precise probability of your observed 2×2 contingency table when sample sizes are too small for Chi-Squared tests.

The Core Idea

When Chi-Squared assumptions fail (expected frequencies below 5), we need a different approach. Fisher's Exact Test answers this question: "If there's truly no relationship between my two categorical variables, what's the exact probability of getting a table this extreme or more extreme?"

Unlike Chi-Squared, which approximates probabilities using a distribution, Fisher's method counts all possible ways your data could have been arranged and calculates exact probabilities.

The Combinatorial Logic

Think of it like drawing cards from a deck. Imagine you have:

  • 10 people total
  • 6 received Treatment A, 4 received Treatment B
  • 7 people improved, 3 didn't

Fisher's test asks: "Given these fixed row and column totals (marginals), how many different 2×2 tables could we create?" Then it calculates the probability of each possible table using the hypergeometric distribution.

The test essentially fixes your margins (row and column totals) and asks: "If we randomly shuffled people into cells while keeping those totals constant, how likely is our observed arrangement?"

Why "Exact"?

Because we're enumerating actual possibilities rather than approximating with a continuous distribution. We calculate the probability of every single table at least as extreme as ours, then sum them up for the p-value.

This is computationally intensive but gives you the true probability without relying on large-sample approximations.

Key Takeaway: Fisher's Exact Test computes the precise probability of your observed contingency table by counting all possible arrangements of your data given fixed marginal totals, making it ideal when small sample sizes violate Chi-Squared assumptions.