Chi-square goodness-of-fit test
Chi-square goodness-of-fit test checks whether observed counts across categories match a theoretically expected pattern. The test statistic sums squared relative deviations between observed and expected frequencies for every category.
Also known aschi-square test · goodness of fit
FrameworkChi-squared test
See it move
A side-by-side table compares observed and expected frequencies for a die-roll experiment of 120 rolls. Observed counts for five of the six faces are 18, 23, 19, 24, and 17, whilst the fair-die null hypothesis assigns an expected count of 20 to each face. The resulting chi-square statistic of 2.0 (degrees of freedom = 5) lies well below the critical value of 11.07, so the fair-die claim is not rejected.
The formula
Variables
- chi-square test statistic
- observed frequency in category i (count)
- expected frequency in category i (count)
- number of categories
Degrees of freedom = k − 1. Under H₀ the statistic follows a χ²(k − 1) distribution.