Chi-square tests

Counts in several categories come back uneven. Are they too far from what a claim predicts to blame on chance?

Where you are 3 inside

What this area is about

A chi-square test checks counts of a categorical variable, or of two at once, against the counts a claim predicts. It gathers all the gaps between observed counts O and expected counts E into one number, \displaystyle \chi^2 = \sum \frac{(O - E)^2}{E}, and asks how often a value that large would arise by chance if the null hypothesis were true. The P-value is trustworthy only when the data come from random sampling, random assignment or a random process, every expected count is at least 5, and a sample drawn without replacement is at most 10\% of its population.

How these fit together

The tool. Expected counts and the chi-square statistic builds E from the claim, computes \chi^2, and introduces the chi-square curves, one for each number of degrees of freedom.

One variable. The goodness of fit test asks whether one categorical variable follows a claimed set of proportions.

Two variables. Tests for independence and homogeneity carry the same statistic to a two-way table. Independence asks whether two variables recorded on one random sample are associated in the population; homogeneity asks whether one variable has the same distribution in several populations or treatment groups. The design, not the table, says which.

A path through it

The statistic first, then goodness of fit, then independence and homogeneity.

Finish here and you can add chi-square tests to the list when you choose an inference procedure.

math.wiki · updated 2026-11-08 · CC-BY-SA-4.0