What the chi-square statistic compares
A chi-square goodness-of-fit test compares the count observed in each category, , with the count expected under a null model, . For a hypothesized category probability and sample size ,
The test statistic adds a scaled discrepancy from every category:
Squaring prevents positive and negative differences from canceling. Dividing by puts a difference in context: a gap of 4 is much more surprising when 6 cases were expected than when 600 were expected.
Why sparse expected cells are a problem
The usual p-value comes from approximating the sampling distribution of the statistic with a chi-square curve. That approximation works poorly when expected cells are too sparse. A small expected count makes the denominator small, so a change of only one or two observations can produce a large, unstable contribution.
This is why an introductory workflow checks expected counts before calculating the final result. Observed counts may be zero; what matters for the approximation rule is what the null model expected.
A new example
Suppose a spinner's claimed probabilities for blue, green, and gold are , , and . With spins, the expected counts are
All three meet the cited introductory threshold of 5. With only spins, the expected counts would be , so that version would fail the same threshold before any chi-square p-value was interpreted.
Check the model before the arithmetic
A sound pre-test check asks:
- Are the categories mutually exclusive and collectively able to classify every observation?
- Do the hypothesized probabilities sum to 1?
- Are the data independent enough for the sampling model?
- Do the expected counts meet the rule used by the course or software?
Categories should not be combined merely to force a pass. Pooling is defensible only when the combined category still has a clear substantive meaning and the analysis accounts for the resulting change in degrees of freedom.
Related question
Apply this knowledge
Use the concept guide to understand the reasoning, then return to the complete question and worked answer.
State the Requirements to Perform a Chi-Square Goodness-of-Fit TestSources
These references support the core concepts and interpretation boundaries explained above.