Maths › Practise › Questions › Goodness-of-fit tests
Questions on goodness-of-fit tests
A goodness-of-fit test compares a model's predicted frequencies with the observed ones. The chi-squared statistic measures the mismatch, and comparing it with a critical value shows whether it is larger than chance alone would produce.
16 original questions · 67 marks · the goodness-of-fit tests notes · Further Statistics 1
To print: the questions (PDF, 85 KB) · the worked answers (PDF, 121 KB)
These are original InkMaths questions. Write a complete answer before opening the worked solution and marking guidance.
Write down the chi-squared goodness-of-fit statistic, and explain why each squared difference is divided by the expected frequency.
Worked solution and marking guidance
χ² = Σ(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 solution and marking guidance
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, so that each contribution can be checked.A binomial model B(4, p) is fitted to data grouped into the five classes 0, 1, 2, 3 and 4 successes, and no pooling is needed. State the degrees of freedom of the test (a) when p is specified in advance as 0.5, (b) when p is estimated from the data.
Worked solution and marking guidance
(a) 5 − 1 = 4: one is subtracted because the expected frequencies are forced to total the sample size. (b) 5 − 1 − 1 = 3: one more is subtracted for the parameter estimated from the data. B1 for 4, B1 for 3. The value of n = 4 is part of the model, not a parameter estimated from the data, so it is not subtracted for.The masses of 200 items are modelled by a normal distribution with mean 50 g and standard deviation 5 g. Find the expected frequency of the class 45 g to 55 g.
Worked solution and marking guidance
The class runs from z = −1 to z = 1, so its probability is P(Z < 1) − P(Z < −1) = 0.8413 − 0.1587 = 0.6826, and the expected frequency is 200 × 0.6826 = 136.5. M1 for standardising both boundaries, A1 for 136.5. An expected frequency is a probability times the sample size, so it need not be a whole number.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 solution and marking guidance
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 solution and marking guidance
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 solution and marking guidance
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 solution and marking guidance
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. B1 for which has more degrees of freedom, B1 for the model bending towards the data, B1 for the smaller statistic.The time in minutes past the hour at which each of 120 calls arrives is recorded. The calls are grouped as 0 to 10, 10 to 30, 30 to 45 and 45 to 60 minutes, with observed frequencies 26, 34, 33 and 27. Test at the 5% level whether the arrival time is uniformly distributed over the hour, given that the upper 5% point of χ² on 3 degrees of freedom is 7.815.
Worked solution and marking guidance
H₀: the arrival time is uniformly distributed over the 60 minutes; H₁: it is not.
Under a uniform model the probability of a class is its width over 60, so the four probabilities are 10/60, 20/60, 15/60 and 15/60, and the expected frequencies are 120 times these: 20, 40, 30 and 30.
Contributions (O − E)²/E: 36/20 = 1.8, 36/40 = 0.9, 9/30 = 0.3 and 9/30 = 0.3, so χ² = 3.3. Four classes with nothing estimated give 4 − 1 = 3 degrees of freedom, and 3.3 < 7.815, so do not reject H₀: there is insufficient evidence at the 5% level that arrivals are not uniform over the hour. B1 for the hypotheses, M1 for probabilities as width over 60, A1 for the expected frequencies, M1 for the contributions, A1 for 3.3 and the conclusion in context. The classes are of unequal width, so the expected frequencies are unequal even though the model is uniform; 120/4 = 30 for every class would be the expected frequencies of a different model.The masses of 200 items are to be tested against the model N(50, 5²), with both parameters specified in advance. The classes are: below 42.5, 42.5 to 47.5, 47.5 to 52.5, 52.5 to 57.5, and above 57.5. Find the five expected frequencies and state the degrees of freedom of the test.
Worked solution and marking guidance
The boundaries standardise to z = −1.5, −0.5, 0.5 and 1.5. The class probabilities are P(Z < −1.5) = 0.0668, P(−1.5 < Z < −0.5) = 0.3085 − 0.0668 = 0.2417, P(−0.5 < Z < 0.5) = 0.6915 − 0.3085 = 0.3830, then 0.2417 and 0.0668 again by symmetry. Multiplying by 200: 13.4, 48.3, 76.6, 48.3 and 13.4, which total 200. Every expected frequency is above 5, so no pooling is needed, and with neither parameter estimated the degrees of freedom are 5 − 1 = 4. M1 for standardising the boundaries, A1 for the class probabilities, M1 for multiplying by 200, A1 for all five expected frequencies, B1 for 4 degrees of freedom. The two outer classes are open (below 42.5 and above 57.5), so they take the whole of each tail; a class from 37.5 to 42.5 would be a different model and would leave the expected frequencies short of 200.A game is played 80 times, and on each occasion the number of attempts needed to score for the first time is recorded: 36 games needed one attempt, 24 needed two, 9 needed three, 6 needed four and 5 needed five or more. Test at the 5% level whether a geometric distribution with p = 0.5 is a suitable model, given that the upper 5% point of χ² on 4 degrees of freedom is 9.488.
Worked solution and marking guidance
H₀: the number of attempts follows a geometric distribution with p = 0.5; H₁: it does not.
P(X = x) = 0.5x for x = 1, 2, 3, 4, giving 0.5, 0.25, 0.125 and 0.0625, and the final class takes the rest: P(X is at least 5) = 0.54 = 0.0625. Multiplying by 80, the expected frequencies are 40, 20, 10, 5 and 5, none below 5, so no pooling is needed.
Contributions: 16/40 = 0.4, 16/20 = 0.8, 1/10 = 0.1, 1/5 = 0.2 and 0, so χ² = 1.5. With p specified there are 5 − 1 = 4 degrees of freedom, and 1.5 < 9.488, so do not reject H₀: the geometric model with p = 0.5 is consistent with the data at the 5% level. M1 for the geometric probabilities with the open final class, A1 for the expected frequencies, M1 for the contributions, A1 for 1.5 with the conclusion in context. The last class must be 'five or more', not 'exactly five', otherwise the expected frequencies total less than 80.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 solution and marking guidance
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.
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.Seeds are sown in trays of four. In 100 trays, 5 had no seed germinate, 20 had one, 35 had two, 30 had three and 10 had all four. Fit a binomial model B(4, p), estimating p from the data, and test its goodness of fit at the 5% level. The upper 5% points of χ² are 5.991 for 2 degrees of freedom and 7.815 for 3.
Worked solution and marking guidance
H₀: the number germinating per tray follows a binomial distribution B(4, p); H₁: it does not.
The 100 trays hold 400 seeds, of which 0 × 5 + 1 × 20 + 2 × 35 + 3 × 30 + 4 × 10 = 220 germinated, so the estimate is p = 220/400 = 0.55.
With p = 0.55 the probabilities are 0.454 = 0.0410, 4 × 0.55 × 0.453 = 0.2005, 6 × 0.55² × 0.45² = 0.3675, 4 × 0.553 × 0.45 = 0.2995 and 0.554 = 0.0915, giving expected frequencies 4.10, 20.05, 36.75, 29.95 and 9.15. The first is below 5, so the classes 0 and 1 are pooled: observed 25, 35, 30, 10 against expected 24.15, 36.75, 29.95, 9.15.
Contributions: 0.030, 0.084, 0.000 and 0.079, so χ² = 0.19. Four pooled classes, less one for the total and one for the estimated p, give 2 degrees of freedom. Since 0.19 < 5.991, do not reject H₀: the binomial model fits the data well at the 5% level. B1 for the hypotheses, M1 for p as germinated seeds over 400, M1 for the binomial probabilities times 100 with the zero class pooled, A1 for the four expected frequencies, B1 for 2 degrees of freedom, A1 for 0.19 and the conclusion in context. The estimate divides by 400 seeds, not 100 trays: p is the probability for a single seed.A discrete uniform model with k equally likely classes is tested on N observations. Show that the goodness-of-fit statistic can be written as χ² = (k/N)ΣO² − N. Use this form to find the statistic for a spinner with five equal sectors spun 100 times, giving 15, 22, 18, 25 and 20, and explain why the statistic is zero only when every class has the same observed frequency.
Worked solution and marking guidance
Every expected frequency is E = N/k. Then Σ(O − E)²/E = (k/N)Σ(O² − 2OE + E²) = (k/N)ΣO² − 2ΣO + ΣE. Both ΣO and ΣE equal N, so the last two terms give −2N + N = −N and χ² = (k/N)ΣO² − N.
For the spinner, ΣO² = 225 + 484 + 324 + 625 + 400 = 2058, so χ² = (5/100) × 2058 − 100 = 102.9 − 100 = 2.9.
The statistic is a sum of squares divided by positive numbers, so it is zero only when every (O − E)² is zero, that is, when every observed frequency equals N/k. M1 for expanding (O − E)² with E = N/k, A1 for ΣO = ΣE = N, A1 for the identity, A1 for 2.9, B1 for the zero condition. The identity subtracts two numbers of similar size, so keep ΣO² exact rather than rounded.A publisher claims that the number of errors per page of a book follows a Poisson distribution with mean 1. In a sample of 50 pages, 17 pages have no errors, 21 have one, 8 have two, 3 have three and 1 has four, with none having more. Test the claim at the 5% level, given that the upper 5% points of χ² are 3.841 for 1 degree of freedom and 5.991 for 2. Show that, had λ been estimated from the data instead, the estimate would also have been 1, and explain how the test and the question it answers would then differ.
Worked solution and marking guidance
H₀: errors per page follow Po(1); H₁: they do not.
With λ = 1 the probabilities of 0, 1, 2 and 3 are 0.3679, 0.3679, 0.1839 and 0.0613, so the expected frequencies from 50 pages are 18.39, 18.39, 9.20, 3.07 and 0.95 for '4 or more'. The last two are below 5, and 3.07 + 0.95 = 4.02 is still below 5, so the classes 2, 3 and '4 or more' are pooled into '2 or more': observed 17, 21, 12 against expected 18.39, 18.39, 13.21.
Contributions: 0.106, 0.369 and 0.111, so χ² = 0.59. Three classes with λ specified give 3 − 1 = 2 degrees of freedom, and 0.59 < 5.991, so do not reject H₀: the data are consistent with Po(1).
The sample holds 0 × 17 + 1 × 21 + 2 × 8 + 3 × 3 + 4 × 1 = 50 errors on 50 pages, so the sample mean is exactly 1 and the expected frequencies and the statistic would be unchanged. But the degrees of freedom would fall to 3 − 1 − 1 = 1, with critical value 3.841, and the hypothesis tested would be that some Poisson distribution fits, not that the publisher's Po(1) does. B1 for the hypotheses in terms of Po(1), M1 for the expected frequencies pooled down to three classes, A1 for 18.39, 18.39, 13.21, A1 for 0.59 with 2 degrees of freedom and the conclusion, B1 for the sample mean being exactly 1, B1 for 1 degree of freedom and the changed hypothesis.A genetic model predicts that the four types of seedling occur in the ratio 9 : 3 : 3 : 1, in the order in which they are listed. The table gives the types of the seedlings in one batch. Use a χ² goodness-of-fit test at the 5% level of significance to determine whether the model fits these data. The 5% critical values of χ² are 3.841 for 1 degree of freedom, 5.991 for 2, 7.815 for 3 and 9.488 for 4.
type of seedling number observed tall, purple flowers 168 tall, white flowers 66 dwarf, purple flowers 71 dwarf, white flowers 15 Worked solution and marking guidance
H0: the ratio 9 : 3 : 3 : 1 fits the data. H1: the ratio 9 : 3 : 3 : 1 does not fit the data. B1 for both hypotheses. The batch holds 168 + 66 + 71 + 15 = 320 seedlings, and the ratio divides them into 9 + 3 + 3 + 1 = 16 shares, so one share is 320/16 = 20 and the expected frequencies are 9 × 20 = 180, 3 × 20 = 60, 3 × 20 = 60 and 1 × 20 = 20. M1 for the total split into 16 shares, A1 for 180, 60, 60 and 20, which add back to 320 as a check. Each expected frequency is above 5, so no pooling is needed. The contributions (O − E)²/E are (168 − 180)²/180 = 144/180 = 0.800, (66 − 60)²/60 = 36/60 = 0.600, (71 − 60)²/60 = 121/60 = 2.017 and (15 − 20)²/20 = 25/20 = 1.250. M1 for the four contributions. Their sum is χ² = 0.800 + 0.600 + 2.017 + 1.250 = 4.67 to 3 significant figures. A1 for 4.67. There are 4 classes and the model was stated in full, with no parameter estimated from the data, so the degrees of freedom are 4 − 1 = 3 and the critical value is 7.815. Since 4.67 < 7.815 the result is not significant: there is insufficient evidence to reject the model, so the ratio 9 : 3 : 3 : 1 is consistent with this batch. B1 for 3 degrees of freedom with the comparison and the conclusion in context. Reading 7.815 off the list means choosing the row first: taking 9.488 by counting classes instead of classes minus one gives the wrong critical value, though the conclusion happens to survive it.
All questions, worked solutions and marking guidance are original InkMaths material. They are not copied from awarding-body papers or mark schemes. The codes show how InkMaths allocates the stated total; an awarding body may credit a valid alternative method differently.
The same practice on paper: the printable workbook for this topic, with the questions and a worked answer book.
Practise goodness-of-fit tests one question at a time
In the player, mark your own response after viewing the worked solution. Your score decides when the question is offered again.