Fisher's Exact Test Calculator

Calculate exact p-values for 2×2 contingency tables and test independence of categorical variables

2×2 Contingency Table

Enter the observed frequencies for each cell in your 2×2 contingency table:

Variable 2: Category 1
Variable 2: Category 2
Variable 1: Category 1
Cell a
Cell b
Variable 1: Category 2
Cell c
Cell d

Two-tailed tests for any association; one-tailed tests for directional association

Example: Gender vs Sport Preference

Study Data

A study of 11 people examined whether sport preference (cycling vs swimming) is associated with gender.

Sample: 5 men and 6 women

Results: 1 man chose swimming, 4 men chose cycling, 4 women chose swimming, 2 women chose cycling

Contingency Table

Swimming
Cycling
Total
Men
1
4
5
Women
4
2
6
Total
5
6
11

Results

One-tailed p-value: 0.175324

Two-tailed p-value: 0.242424

Interpretation: No significant association between gender and sport preference (p > 0.05)

When to Use Fisher's Exact Test

Small Sample Size

When any expected frequency < 5

2×2 Contingency Table

Two categorical variables with two levels each

Exact Results

When you need exact p-values, not approximations

Unbalanced Data

When marginal totals are very uneven

P-value Interpretation

p < 0.001: Highly significant
p < 0.01: Very significant
p < 0.05: Significant
p < 0.1: Marginally significant
p ≥ 0.1: Not significant

Understanding Fisher's Exact Test

What is Fisher's Exact Test?

Fisher's exact test is a statistical test for independence between two categorical variables in a 2×2 contingency table. Unlike the chi-squared test, it provides exact p-values rather than approximations, making it ideal for small samples.

Key Features

  • Provides exact p-values based on hypergeometric distribution
  • Does not rely on normal approximations
  • Suitable for any sample size, especially small samples
  • Tests the null hypothesis of independence between variables

Formula and Calculation

P = (a+b)!(c+d)!(a+c)!(b+d)! / (a!b!c!d!n!)

Where a, b, c, d are the cell frequencies and n is the total sample size.

One-tailed vs Two-tailed

  • Two-tailed: Tests for any association (positive or negative)
  • One-tailed: Tests for association in a specific direction
  • Recommendation: Use two-tailed unless you have a strong theoretical reason for one-tailed

Fisher's Exact Test vs Chi-squared Test

Use Fisher's Exact Test when:

  • • Any expected frequency < 5
  • • Small sample sizes (n < 20-30)
  • • Very unbalanced margins
  • • Need exact p-values

Use Chi-squared Test when:

  • • All expected frequencies ≥ 5
  • • Large sample sizes
  • • Computational efficiency needed
  • • Tables larger than 2×2