Chi-square test

A chi-square test compares observed counts of categorical data to the counts expected under a hypothesis, gauging how far the data stray from that model.

A chi-square test works with counts in categories rather than means, checking goodness of fit, independence, or homogeneity. It adds up the squared gaps between observed and expected counts, each scaled by the expected count, into one statistic. The formula is χ2=(OE)2E\chi^2 = \sum \frac{(O - E)^2}{E}, where OO is an observed count and EE an expected count. For example, rolling a die 60 times and comparing each face's tally to the expected 10 tests whether the die is fair, and a large χ2\chi^2 gives a small p-value.

More hypothesis testing terms, or browse the full statistics glossary.