Advertisement

Fisher's exact test calculator

Enter four non-negative cell counts. The exact null distribution conditions on both row and column totals.

Calculator

Exact p-value
0.2759456185%
Sample odds ratio ad/bc
0.030303
Observed-table probability
0.1346076188%
Decision
Reject the null hypothesis
Observed contingency table
RowColumn 1Column 2Total
Row 11.0000009.00000010.000000
Row 211.0000003.00000014.000000

Advertisement

How this calculator works

Under the null odds ratio of one, the upper-left cell has a hypergeometric distribution conditional on the margins. The two-sided p-value adds probabilities of all feasible tables no more probable than the observed table. This probability-ordering definition can differ from doubling a one-sided p-value. Right-tailed inference favours odds ratio above one. The displayed odds ratio is the sample cross-product ratio, not the conditional maximum-likelihood estimate. Use independent sampling units rather than paired outcomes.

Formula

P(A = a | margins) = C(a + b,a) C(c + d,c)/C(n,a + c). Sample OR = ad/(bc). Two-sided p sums tables with probability ≤ the observed table probability.

Worked example

The table [1,9;11,3] has sample odds ratio 1/33 and two-sided exact p ≈ 0.002759456. For [1,1;1,1], all association evidence is absent and the two-sided p-value is 1.

Advertisement

Frequently asked questions

Why do exact programs sometimes disagree?

Two-sided discrete tests can use probability ordering, doubled tails or other conventions. Compare definitions before comparing numbers.

Can cells be zero?

Yes, if all row and column totals remain positive. A sample odds ratio can then be zero, infinite or undefined.

Is this appropriate for before-and-after pairs?

No. Pairing changes the sampling model; McNemar's test uses the discordant pairs.

Sources

Advertisement