Fisher's Exact Test

Run an exact fixed-margin 2 by 2 count test with odds ratio, p-value, and support table.

At a glance

Computes
Exact p-value for a two by two table, plus the odds ratio.
You supply
The four cell counts, an alternative, and a significance level.
Use when
A two by two table with small expected counts, where chi-square is unsafe.
Not for
Tables larger than two by two, or expected counts above five. Chi-Square Test Calculator
Counts
Alternative

Density by Top-left cell count; 3 bins of width 1 (fd rule); P-value tail; Observed count 1

0.00.10.20.30.40.5−0.50.00.51.01.52.02.5

p-value

Enter counts

Fisher exact test, fixed margins.

Test details
MetricValue
Fixed-margin support
xTable probabilityIncluded
Export

P(X = x) = choose(n,x) choose(M-n,N-x) / choose(M,N) How?

How this is calculated

Fisher's exact test fixes the row and column margins, then sums hypergeometric table probabilities from that fixed-margin support. The two-sided p-value includes tables with probability no larger than the observed table probability.

Formula: P(X = x) = choose(n,x) choose(M-n,N-x) / choose(M,N)

Sources

  1. SciPy fisher_exact. SciPy. Retrieved .
  2. R fisher.test. R Documentation. Retrieved .

Method last reviewed