Practise › Questions › Goodness-of-fit tests
Goodness-of-fit tests questions
Put a model's predicted frequencies beside the observed ones, square the gaps, and one statistic decides whether the difference is more than chance would produce.
7 original questions · 26 marks · the goodness-of-fit tests notes · Further Statistics 1
Every question here is written for this library rather than taken from a past paper. Write your answer out before opening the worked one: the answers award marks point by point, and the marks are easier to see when you have something of your own to compare against.
Write down the chi-squared goodness-of-fit statistic, and explain why each squared difference is divided by the expected frequency.
Worked answer
χ² = Σ(O − E)²/E. Dividing by E scales each gap against the size of the class it sits in, so a discrepancy of 3 where 5 were expected counts far more heavily than the same gap where 500 were expected. B1 for the statistic, B1 for the reason for the divisor.A spinner with five equal sectors is spun 100 times, giving 15, 22, 18, 25 and 20. State suitable hypotheses and compute the chi-squared statistic.
Worked answer
H₀: the spinner is fair, so all five sectors are equally likely; H₁: it is not.
Each expected frequency is 100/5 = 20. The squared differences are 25, 4, 4, 25 and 0, totalling 58, and dividing by 20 gives χ² = 2.9. B1 B1 for the two hypotheses, M1 for the contributions, A1 for the statistic. Set the observed and expected rows out in a table with a row of contributions underneath, since that is where the method marks are.A spinner with five equal sectors is spun 100 times and gives χ² = 2.9 against the hypothesis that it is fair. State the degrees of freedom and the conclusion at the 5% level, given a critical value of 9.488.
Worked answer
Five classes with no parameter estimated: 5 − 1 = 4 degrees of freedom. Since 2.9 < 9.488, do not reject H₀: there is insufficient evidence at the 5% level that the spinner is biased. That is not proof of fairness, only an absence of evidence against it. B1 for the degrees of freedom, M1 for the comparison, A1 for the conclusion in context.The number of flaws in each of 60 components is counted. Twelve have none, 18 have one, 15 have two, 9 have three and 6 have four, and no component has more than four. A Poisson model is to be fitted. Estimate λ from the data and state the degrees of freedom for the test.
Worked answer
The estimate is the sample mean. The 60 components carry 0 × 12 + 1 × 18 + 2 × 15 + 3 × 9 + 4 × 6 = 99 flaws between them, so the estimate is 99/60 = 1.65.
That count is available only because the table stops at four. Had the last class read '4 or more', 99 would be a floor rather than a total, 1.65 would be a lower bound rather than the mean, and λ would have to be fitted by likelihood instead. Read the final class before you total anything.
For the test the classes are 0, 1, 2, 3 and '4 or more', so there are five of them. Subtract one because the expected frequencies are forced to total 60, and one more for the estimated λ, leaving 3 degrees of freedom. Forgetting the second subtraction is the standard error, and it makes the test too generous to the model. M1 for the total number of flaws, A1 for 1.65, M1 for counting the classes, A1 for three degrees of freedom.Explain the rule for pooling classes, and its effect on the degrees of freedom.
Worked answer
Any class with an expected frequency below 5 is combined with a neighbour, repeatedly if necessary, until every expected frequency reaches 5. Small expected values inflate the (O − E)²/E terms and distort the statistic. Pooling reduces the number of classes, and the degrees of freedom are counted from the pooled classes, not the original ones. B1 for the pooling rule, B1 for the reason, B1 for counting from the pooled classes.Two goodness-of-fit tests use the same data and the same number of classes. One specifies the model's parameter in advance; the other estimates it from the data. State which has more degrees of freedom, and explain why the estimated version tends to give a smaller statistic.
Worked answer
Specifying the parameter in advance gives one more degree of freedom, since nothing has been estimated. Estimating it from the data lets the model bend towards the observations, so the expected frequencies sit closer to what was seen and the squared gaps shrink. Surrendering a degree of freedom is the price of that flexibility, and it keeps the test honest. B1 for which has more degrees of freedom, B1 for the model bending towards the data, B1 for the smaller statistic.The number of flaws in each of 60 components is counted. Twelve have none, 18 have one, 15 have two, 9 have three and 6 have four, and no component has more than four; λ is estimated from the data as 1.65. Complete the Poisson goodness-of-fit test at the 5% level. The upper 5% points of χ² are 7.815 for 3 degrees of freedom and 9.488 for 4.
Worked answer
H₀: a Poisson distribution is a suitable model for these data; H₁: it is not.
With λ = 1.65, P(X = 0) = 0.1920, P(X = 1) = 0.3169, P(X = 2) = 0.2614 and P(X = 3) = 0.1438. The model puts probability on 5, 6 and beyond as well, so its final class is '4 or more' and it takes whatever is left. The observed 6 components with four flaws sit against it, since none had more. Multiplying by 60 gives expected frequencies 11.52, 19.01, 15.69, 8.63 and 5.15, which total 60 as they must.
Every expected frequency is above 5, so no pooling is needed.
Contributions (O − E)²/E: 0.0197, 0.0540, 0.0300, 0.0161 and 0.1398, giving χ² = 0.260.
Degrees of freedom = 5 − 1 − 1 = 3, so the critical value is 7.815. Since 0.260 < 7.815, do not reject H₀. The Poisson model fits these data well at the 5% level.
Two traps sit in this question. The model's last class must be '4 or more' so that the expected frequencies total 60, and the critical value must be read at 3 degrees of freedom rather than 4.
B1 for the hypotheses, M1 A1 for the expected frequencies, M1 A1 for the contributions and the statistic, B1 for the degrees of freedom, A1 for the conclusion.
The same practice on paper: the printable workbook for this topic, questions and a worked answer book.
Practise goodness-of-fit tests one question at a time
The player marks nothing for you. It shows one question, waits, then shows the worked answer so you can mark yourself, and brings a question back sooner when it went badly.