Free Pearson Edexcel International A-level Mathematics · S3

Chi-squared goodness-of-fit tests

What you’ll learn

  • Calculate expected counts under a proposed distribution.
  • Form a chi-squared statistic with suitable classes.
  • Adjust degrees of freedom for estimated parameters.

Understand the idea

A goodness-of-fit test compares observed category counts with counts predicted by a proposed distribution. Under the null, multiply each model probability by the total sample size to obtain its expected count. The statistic accumulates squared discrepancies relative to expected counts, so large values indicate a poor fit.

The chi-squared reference distribution is approximate. Combine sensible neighbouring classes when expected counts are too small, applying the pooling to observed and expected counts together. Include tail categories so the model probabilities cover all possibilities and the expected total equals the observed total.

After pooling, the degrees of freedom are the number of classes minus one, minus the number of parameters estimated from the same data. For example, fitting a Poisson mean costs one further degree of freedom. Use an upper-tail critical value and conclude whether there is evidence against the model, rather than claiming a non-significant test proves a perfect fit.

Key formulae

Ei=npiE_i=np_i

X2=∑i=1k(Oi−Ei)2EiX^2=\sum_{i=1}^{k}\frac{(O_i-E_i)^2}{E_i}

ν=k−1−r\nu=k-1-r

∑iOi=∑iEi=n\sum_iO_i=\sum_iE_i=n

Worked example

Four equally likely categories produce observed counts 18, 22, 26 and 14. Test the equal-probability model at 5%. The upper 5% chi-squared critical value for 3 degrees of freedom is 7.815.

  1. The total is 80, so each expected count is 80/4=2080/4=20.
  2. The statistic is (18−20)2/20+(22−20)2/20+(26−20)2/20+(14−20)2/20=4(18-20)^2/20+(22-20)^2/20+(26-20)^2/20+(14-20)^2/20=4.
  3. There are four classes and no fitted parameters, so ν=4−1=3\nu=4-1=3.
  4. Since 4<7.8154<7.815, do not reject the equal-probability model.

Answer: There is insufficient evidence at 5% that the four category probabilities differ.

Open the interactive lesson to try original questions and recall. Build a revision plan.