User Rating 0.0
Total Usage 0 times

Contingency Table (2x2)

Outcome 1
Outcome 2
Group 1
Group 2
Is this tool helpful?

Your feedback helps us improve.

About

In statistical analysis, standard Chi-Square tests fail when sample sizes are small or when the cells of a contingency table are sparse (values less than 5). The Fisher's Exact Test solves this by calculating the exact probability of observing the specific distribution of data, rather than relying on an approximation. It is the gold standard for clinical trials, A/B testing with low traffic, and genetic studies.

This tool computes the p-value using arbitrary-precision arithmetic (BigInt), ensuring accuracy even when factorials become astronomically large. It checks the null hypothesis that there is no association between the two categorical variables defined in the grid. The output provides both one-tailed (directional) and two-tailed (non-directional) significance values along with a plain-English interpretation.

statistical test p-value calculator contingency table hypothesis testing medical statistics

Formulas

The probability (p) of observing any specific 2x2 table configuration is given by the hypergeometric distribution:

p = (a+b)! (c+d)! (a+c)! (b+d)!a! b! c! d! n!

Where n! represents the factorial of n. The P-value is the sum of probabilities for all tables that are as extreme or more extreme than the observed table, given the fixed marginal totals.

Reference Data

GroupOutcome Positive (Yes)Outcome Negative (No)Row Total
Group 1aba + b
Group 2cdc + d
Column Totala + cb + dn (Total)

Frequently Asked Questions

Use Fisher's when the total sample size is small (typically n < 1000) or when any cell in your expected frequency table has a value less than 5. Chi-square is an approximation that degrades under these conditions.
A one-tailed test checks if Group A is significantly *greater* (or *less*) than Group B specifically. A two-tailed test simply checks if there is *any* difference between them, regardless of direction. Two-tailed is the standard for scientific reporting unless you had a strong prior hypothesis.
It means there is a 5% probability that the observed difference happened purely by random chance. If p < 0.05, the result is traditionally considered statistically significant.
Yes. This tool uses BigInt technology to handle factorials of numbers up to N=1000 or more, which produces numbers with thousands of digits, without overflowing or losing precision.