All subjects · Mathematics · WST03 Statistics 3

Goodness of fit: the chi-squared statistic

Edexcel IAL Mathematics · WST03 Statistics 3

A goodness of fit test asks whether observed frequencies are consistent with a proposed model. The statistic Σ(O - E)2/E measures how far the observations are from what the model predicts.

Practise this in the app: instant marking and a fix for every mistake. Free, no email needed to start.

Practise this lesson

Hypotheses and statistic

Compute expected frequencies E from the model (total × probability) and

X2 = Σ (O - E)2 / E, which is approximately χ2 with ν degrees of freedom when H0 is true. An equivalent form is X2 = Σ O2/E - N.

Hypotheses must name the model: examiners do not accept 'the claim is correct' on its own.

Score123456
Observed162517231425
Expected202020202020

120 throws of a die

Degrees of freedom and critical values

ν = number of cells - 1 - number of parameters estimated from the data. The 1 is for the total, which the expected frequencies are forced to match.

The test is always upper-tailed: large X2 means poor fit. Reject H0 if X2 > the critical value χ2_ν(α) from the table.

ν10%5%2.5%1%
12.7053.8415.0246.635
24.6055.9917.3789.210
36.2517.8159.34811.345
47.7799.48811.14313.277
59.23611.07012.83215.086
610.64512.59214.44916.812

Upper percentage points of χ2 (Pearson tables)

Expected frequencies at least 5

The χ2 approximation is poor if any expected frequency is less than 5. Then combine adjacent cells (adding O and E) before calculating X2, and count cells after combining when finding ν. Yates' correction is not used in S3.

Example: a fair die

120 throws, E = 20 each. X2 = (16 + 25 + 9 + 9 + 36 + 25)/20 = 6. ν = 6 - 1 = 5, critical value at 5% = 11.070. 6 < 11.070, so do not reject H0: there is no evidence that the die is biased.

Worked example

A shop believes sales of three sizes are in the ratio 3 : 2 : 1. In 240 sales the counts are 131, 70 and 39. Test at the 5% level.

  1. H0: sales are in the ratio 3 : 2 : 1. H1: they are not.
  2. E = 120, 80, 40.
  3. X2 = 112/120 + 102/80 + 12/40 = 2.2833
  4. ν = 3 - 1 = 2; critical value 5.991; 2.283 < 5.991.

Answer: Do not reject H0: the sales are consistent with the ratio 3 : 2 : 1.

Key idea: X2 = Σ(O - E)2/E; ν = cells - 1 - parameters estimated; combine cells with E < 5; reject for large X2.

Check yourself

  1. A die is thrown 120 times with observed frequencies 16, 25, 17, 23, 14, 25 for scores 1 to 6. Calculate X2 for the hypothesis that the die is fair.
    Show answer

    6. E = 20 each; Σ(O - E)2 = 120; X2 = 120/20 = 6.

  2. In the die test, how many degrees of freedom are there?
    Show answer

    5. 6 cells, minus 1 for the total, no parameters estimated: ν = 5.

  3. Find the 5% critical value of χ2 with 5 degrees of freedom. Give your answer to 3 decimal places.
    Show answer

    11.070. From the table: 11.070.

  4. Sales of three sizes are believed to be in the ratio 3 : 2 : 1. In 240 sales the counts are 131, 70 and 39. Calculate X2. Give your answer to 3 significant figures.
    Show answer

    2.28. E = 120, 80, 40; X2 = 2.2833.

  5. Observed frequencies 30, 50, 20 have expected frequencies 25, 50, 25. Calculate X2 using ΣO2/E - N.
    Show answer

    2. 36 + 50 + 16 - 100 = 2.

  6. The die test gives X2 = 6 with critical value 11.070. Which conclusion is correct?
    • Reject H0: the die is biased
    • Do not reject H0: there is no evidence that the die is biased
    • Do not reject H0: the die is proved to be fair
    • Reject H0, because X2 is positive
    Show answer

    Do not reject H0: there is no evidence that the die is biased. 6 < 11.070, so the fit is acceptable. A test never proves H0.

  7. Expected frequencies in a goodness of fit test are 18.2, 12.6, 6.1, 2.4 and 0.7. What should you do before calculating X2?
    • Delete the cells with E < 5
    • Use Yates' correction
    • Multiply the small expected frequencies by 5
    • Combine the last three cells, so every expected frequency is at least 5
    Show answer

    Combine the last three cells, so every expected frequency is at least 5. 6.1 + 2.4 + 0.7 = 9.2 ≥ 5 (combining only the last two gives 3.1). The observed frequencies are combined in the same way.

Practise with instant feedback

Sources

Last updated 8 November 2026. Spotted a mistake? Tell us.