Chi-square and Fisher’s exact
Compare counts across categories, with the odds ratio and its interval.
Paste straight from a spreadsheet. Any table works; 2×2 also gets Fisher’s exact test and an odds ratio.
Paste a table of counts — at least two rows and two columns.
χ² = Σ (|O − E| − c)² ÷ E, c = ½ on 2×2; Fisher sums hypergeometric tables at least as extreme- The exact test for a 2×2 table — Journal of the Royal Statistical Society, 1922
- Continuity correction for the chi-square test — Supplement to the Journal of the Royal Statistical Society, 1934
Report the proportions as well. “12 of 40 against 31 of 44” tells a reader more than any p-value attached to it.
When to use this
Use this for counts in categories — how many colonies grew and did not, on each of two plates. Chi-square is the general test; Fisher’s exact is the one to use when any expected count is small, which in a typical biology table is often.
Worked example
Transformation efficiency with two different plasmids.
- Table
- 2 × 2 counts
- Test
- Fisher’s exact
Result
The odds ratio is the effect size; an interval spanning 1 means the data are consistent with no difference.
What people get wrong
- Using chi-square when expected counts are small. Below about five per cell the approximation breaks down and Fisher’s exact is the honest test.
- Putting percentages into the table. These tests need raw counts; percentages discard the sample size the whole inference rests on.
- Testing a table whose cells are not independent. Repeated measures on the same animals need a different approach entirely.
Questions
+Chi-square or Fisher’s exact?
Fisher’s exact when any expected count is below about five, and it is always defensible for a 2 × 2 table. Chi-square scales better to larger tables.
+What effect size should I report?
The odds ratio or the risk difference, with an interval. A p-value alone says nothing about how large the difference is.
+Do I need Yates’ correction?
It is conservative and largely superseded by simply using Fisher’s exact when the counts are small.
Related tools
- t-test calculator — Compare two groups and get the effect size and interval, not just a p-value.
Science last reviewed .