StatisticsInferential Statistics

Knowledge guide

Why Expected Counts Matter in a Chi-Square Goodness-of-Fit Test

Understand how expected counts scale the chi-square statistic, why sparse categories weaken the approximation, and how to check a null model before calculating a p-value.

What the chi-square statistic compares

A chi-square goodness-of-fit test compares the count observed in each category, OiO_i, with the count expected under a null model, EiE_i. For a hypothesized category probability pip_i and sample size nn,

Ei=npi.E_i=np_i.

The test statistic adds a scaled discrepancy from every category:

χ2=∑i(Oi−Ei)2Ei.\chi^2=\sum_i\frac{(O_i-E_i)^2}{E_i}.

Squaring prevents positive and negative differences from canceling. Dividing by EiE_i 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 0.500.50, 0.300.30, and 0.200.20. With n=40n=40 spins, the expected counts are

(40×0.50, 40×0.30, 40×0.20)=(20,12,8).(40\times0.50,\ 40\times0.30,\ 40\times0.20)=(20,12,8).

All three meet the cited introductory threshold of 5. With only n=20n=20 spins, the expected counts would be (10,6,4)(10,6,4), 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:

  1. Are the categories mutually exclusive and collectively able to classify every observation?
  2. Do the hypothesized probabilities sum to 1?
  3. Are the data independent enough for the sampling model?
  4. 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 Test

Sources

These references support the core concepts and interpretation boundaries explained above.