Further Statistics: Chi-Squared Tests (Goodness of Fit and Contingency Tables) - Worksheets, Questions and Revision
17 original exam-style questions - 11 pages of questions with a full mark scheme - free printable PDF.
Further Statistics: Chi-Squared Tests (Goodness of Fit and Contingency Tables) revision guideWrite-in editionMore A Level Further Maths practiceMock exams
This topic is chapter 3 of A Level Further Maths Further Statistics Topic Workbook and chapter 13 of A Level Further Maths 10-Minute Tests 2.
2.3 Further Statistics: Chi-Squared Tests (Goodness of Fit and Contingency Tables)
Key facts: chi-squared tests
Original content written for Revision Library.
A chi-squared test compares observed frequencies O with the expected frequencies E predicted by a proposed model, using the test statistic X^2 = sum of (O - E)^2 / E, calculated over all classes (or cells) after any pooling. For a goodness-of-fit test to a fully specified distribution (for example a uniform distribution, or given proportions), degrees of freedom = (number of classes) - 1. If one or more parameters of the model (for example p for a binomial, or the mean for a Poisson) are estimated from the same sample used in the test, one further degree of freedom is lost for each parameter estimated. For an r by c contingency table testing independence between two variables, expected frequencies are E = (row total * column total) / grand total, and degrees of freedom = (r - 1)(c - 1). Classes with an expected frequency below 5 should be pooled (combined with a neighbouring class) before the test statistic is calculated, reducing the number of classes, and hence the degrees of freedom, accordingly. For any test with 1 degree of freedom, including every 2 by 2 contingency table, Yates' continuity correction is applied: X^2 = sum of (|O - E| - 0.5)^2 / E. The calculated test statistic is compared with the critical value from chi-squared tables at the chosen significance level and the stated degrees of freedom; if the test statistic exceeds the critical value, the null hypothesis is rejected.
Cakes: 70. Pastries: 64. Bread: 44. Biscuits: 22.
Period 1 (8am-10am): 38. Period 2 (10am-12pm): 52. Period 3 (12pm-2pm): 61. Period 4 (2pm-4pm): 29.
Critical values for chi-squared with 3 degrees of freedom: 10% level 6.251; 5% level 7.815; 2.5% level 9.348; 1% level 11.345; 0.1% level 16.266.
| Caught flu | Did not catch flu | Row total | |
|---|---|---|---|
| Vaccinated | 18 | 72 | 90 |
| Not vaccinated | 22 | 48 | 70 |
| Column totals | 40 | 120 | 160 |
Attended workshop: passed resit 42, failed resit 18, row total 60.
Did not attend: passed resit 24, failed resit 36, row total 60.
Column totals: passed resit 66, failed resit 54, grand total 120.
Number of defective bulbs (X): 0, 1, 2, 3, 4, 5. Frequency: 77, 67, 27, 7, 2, 0.
Number of scratches (X): 0, 1, 2, 3, 4, 5. Frequency: 22, 34, 25, 12, 5, 2.
No windscreen in the sample had more than 5 scratches, but since a Poisson distribution allows any non-negative integer value, the final class should be treated as 'X ≥ 5' when finding expected frequencies from the model.
Day: Scratch 34, Crack 28, Discolour 16, Misalign 22, row total 100.
Night: Scratch 25, Crack 31, Discolour 25, Misalign 19, row total 100.
Column totals: Scratch 59, Crack 59, Discolour 41, Misalign 41, grand total 200.
Question 1
- (a) P(X = j) = e-1.167 1.167j/j! for j = 0, 1, 2M1
- (a) P(X ≥ 3) = 1 - P(X ≤ 2)M1
- (a) expected: 29.88, 34.88, 20.35, 10.89A1
- (a) Answer: 29.88, 34.88, 20.35, 10.89
- (b) chi2 = sum of (O - E)2/EM1
- (b) 0.733A1
- (b) degrees of freedom = 4 - 1 - 1 = 2 (the mean was estimated from the data)B1
- (b) do not reject H0: the Poisson model is a suitable fitA1
- (b) Answer: chi2 = 0.733, nu = 2, do not reject H0
Question 2
- (a) H0: outcome and group are independent; H1: they are associatedB1
- (a) expected = (row total x column total)/grand totalM1
- (a) E11 = 770/19 = 40.53, E21 = 560/19 = 29.47A1
- (a) Answer: E11 = 40.53, E21 = 29.47
- (b) sum of (O - E)2/E over all six cellsM1
- (b) chi2 = 2.25A1
- (b) degrees of freedom = (2 - 1)(3 - 1) = 2B1
- (b) Answer: chi2 = 2.25, nu = 2
- (c) compares 2.25 with 5.991M1
- (c) do not reject H0A1
- (c) there is no evidence of an association between group and outcomeB1
- (c) Answer: do not reject H0
Question 3
- (a) P(X = j) = e-1.172 1.172j/j! for j = 0, 1, 2M1
- (a) P(X ≥ 3) = 1 - P(X ≤ 2)M1
- (a) expected: 48.63, 56.99, 33.4, 17.98A1
- (a) Answer: 48.63, 56.99, 33.4, 17.98
- (b) chi2 = sum of (O - E)2/EM1
- (b) 0.277A1
- (b) degrees of freedom = 4 - 1 - 1 = 2 (the mean was estimated from the data)B1
- (b) do not reject H0: the Poisson model is a suitable fitA1
- (b) Answer: chi2 = 0.277, nu = 2, do not reject H0
Question 4
- (a) H0: outcome and group are independent; H1: they are associatedB1
- (a) expected = (row total x column total)/grand totalM1
- (a) E11 = 4560/157 = 29.04, E21 = 4389/157 = 27.96A1
- (a) Answer: E11 = 29.04, E21 = 27.96
- (b) sum of (O - E)2/E over all six cellsM1
- (b) chi2 = 29.3A1
- (b) degrees of freedom = (2 - 1)(3 - 1) = 2B1
- (b) Answer: chi2 = 29.3, nu = 2
- (c) compares 29.3 with 5.991M1
- (c) reject H0A1
- (c) there is evidence of an association between group and outcomeB1
- (c) Answer: reject H0
Question 5
- (a) P(X = j) = e-1.518 1.518j/j! for j = 0, 1, 2M1
- (a) P(X ≥ 3) = 1 - P(X ≤ 2)M1
- (a) expected: 18.63, 28.28, 21.46, 16.63A1
- (a) Answer: 18.63, 28.28, 21.46, 16.63
- (b) chi2 = sum of (O - E)2/EM1
- (b) 0.947A1
- (b) degrees of freedom = 4 - 1 - 1 = 2 (the mean was estimated from the data)B1
- (b) do not reject H0: the Poisson model is a suitable fitA1
- (b) Answer: chi2 = 0.947, nu = 2, do not reject H0
Question 6
- (a) P(X = j) = e-0.938 0.938j/j! for j = 0, 1, 2M1
- (a) P(X ≥ 3) = 1 - P(X ≤ 2)M1
- (a) expected: 57.15, 53.6, 25.14, 10.11A1
- (a) Answer: 57.15, 53.6, 25.14, 10.11
- (b) chi2 = sum of (O - E)2/EM1
- (b) 0.540A1
- (b) degrees of freedom = 4 - 1 - 1 = 2 (the mean was estimated from the data)B1
- (b) do not reject H0: the Poisson model is a suitable fitA1
- (b) Answer: chi2 = 0.540, nu = 2, do not reject H0
Question 7
- (a) H0: the model (ratio 2:3:3:2) is a suitable fit; H1: it is notB1
- (a) expected = N x (ratio part)/10M1
- (a) expected: 24.6, 36.9, 36.9, 24.6A1
- (a) Answer: 24.6, 36.9, 36.9, 24.6
- (b) sum of (O - E)2/EM1
- (b) chi2 = 0.496A1
- (b) degrees of freedom = 4 - 1 = 3B1
- (b) Answer: chi2 = 0.496, nu = 3
- (c) compares 0.496 with 7.815M1
- (c) do not reject H0A1
- (c) there is no evidence against the model: the data are consistent with the ratioB1
- (c) Answer: do not reject H0
Question 8
- (a) H0: the model (ratio 4:3:2:1) is a suitable fit; H1: it is notB1
- (a) expected = N x (ratio part)/10M1
- (a) expected: 23.2, 17.4, 11.6, 5.8A1
- (a) Answer: 23.2, 17.4, 11.6, 5.8
- (b) sum of (O - E)2/EM1
- (b) chi2 = 2.56A1
- (b) degrees of freedom = 4 - 1 = 3B1
- (b) Answer: chi2 = 2.56, nu = 3
- (c) compares 2.56 with 11.345M1
- (c) do not reject H0A1
- (c) there is no evidence against the model: the data are consistent with the ratioB1
- (c) Answer: do not reject H0
Question 9
- (a) H0: outcome and group are independent; H1: they are associatedB1
- (a) expected = (row total x column total)/grand totalM1
- (a) E11 = 8277/206 = 40.18, E21 = 10057/206 = 48.82A1
- (a) Answer: E11 = 40.18, E21 = 48.82
- (b) sum of (O - E)2/E over all six cellsM1
- (b) chi2 = 12.4A1
- (b) degrees of freedom = (2 - 1)(3 - 1) = 2B1
- (b) Answer: chi2 = 12.4, nu = 2
- (c) compares 12.4 with 9.21M1
- (c) reject H0A1
- (c) there is evidence of an association between group and outcomeB1
- (c) Answer: reject H0
Question 10
- (a) H0: the model (ratio 2:3:3:2) is a suitable fit; H1: it is notB1
- (a) expected = N x (ratio part)/10M1
- (a) expected: 20.8, 31.2, 31.2, 20.8A1
- (a) Answer: 20.8, 31.2, 31.2, 20.8
- (b) sum of (O - E)2/EM1
- (b) chi2 = 1.19A1
- (b) degrees of freedom = 4 - 1 = 3B1
- (b) Answer: chi2 = 1.19, nu = 3
- (c) compares 1.19 with 7.815M1
- (c) do not reject H0A1
- (c) there is no evidence against the model: the data are consistent with the ratioB1
- (c) Answer: do not reject H0
Question 11
- (a) H0: sales occur in the ratio 4:3:2:1, as claimedB1
- (a) H1: sales do not occur in the ratio 4:3:2:1B1
- (a) Answer: H0: sales occur in the ratio 4:3:2:1. H1: they do not.
- (b) converts the ratio 4:3:2:1 to proportions 0.4, 0.3, 0.2, 0.1 and multiplies by 200M1
- (b) all four correct: 80, 60, 40, 20A1
- (b) Answer: Expected frequencies: 80, 60, 40, 20.
- (c) attempts sum of (O-E)2/E across all 4 classesM1
- (c) cao, awrt 2.12A1
- (c) Answer: Test statistic = awrt 2.12
- (d) the ratio was fully specified (not estimated from the sample), so df = 4 - 1 = 3B1
- (d) critical value = 7.815B1
- (d) valid conclusion ft: since 2.12 < 7.815, do not reject H0; the data are consistent with the claimed ratioB1
- (d) Answer: df = 3; critical value = 7.815; 2.12 < 7.815 so do not reject H0.
Question 12
- (a) H0: coffee sales are uniformly distributed across the four periodsB1
- (a) H1: sales are not uniformly distributed across the four periodsB1
- (a) Answer: H0: sales are uniform across the four periods. H1: they are not.
- (b) E = 45 for each periodB1
- (b) attempts sum of (O-E)2/E across all 4 periodsM1
- (b) cao, awrt 13.6A1
- (b) Answer: Test statistic = 610/45 = awrt 13.6
- (c) compares 13.56 with the 1% (11.345) and 0.1% (16.266) critical values, showing 13.56 exceeds 11.345 but is less than 16.266M1
- (c) correct bracket: 0.001 < p < 0.01A1
- (c) Answer: 0.001 < p < 0.01
- (d) 13.56 > 11.345, so reject H0 at the 1% levelB1
- (d) conclusion in context: there is significant evidence that coffee sales are not uniformly distributed across the four periodsB1
- (d) Answer: Reject H0 at the 1% level: sales are not uniform across the four periods.
Question 13
- (a) H0: whether a patient catches flu is independent of whether they were vaccinatedB1
- (a) H1: catching flu is associated with (not independent of) vaccination statusB1
- (a) Answer: H0: catching flu is independent of vaccination status. H1: they are associated.
- (b) uses E = (row total * column total) / grand total = 90*40/160M1
- (b) 22.5 csoA1
- (b) remaining three values correct: 67.5, 17.5, 52.5A1
- (b) Answer: Expected frequencies: 22.5, 67.5, 17.5, 52.5.
- (c) the table is 2 by 2, giving 1 degree of freedom, so Yates' correction is applied to improve the approximation of the discrete data by the continuous chi-squared distributionB1
- (c) uses X2 = sum of (|O-E| - 0.5)2 / EM1
- (c) first two terms correct (unsimplified): 16/22.5, 16/67.5A1
- (c) remaining two terms correct (unsimplified): 16/17.5, 16/52.5A1
- (c) cao, awrt 2.17A1
- (c) Answer: Test statistic (with Yates' correction) = awrt 2.17
- (d) df = 1B1
- (d) critical value = 3.841B1
- (d) valid conclusion ft: since 2.17 < 3.841, do not reject H0; insufficient evidence of an association between vaccination and catching fluB1
- (d) Answer: df = 1, critical value = 3.841; 2.17 < 3.841 so do not reject H0.
Question 14
- (a) H0: workshop attendance is independent of passing the resit examB1
- (a) H1: workshop attendance and passing the resit are associated (not independent)B1
- (a) Answer: H0: workshop attendance and passing the resit are independent. H1: they are associated.
- (b) uses E = (row total * column total) / grand total = 60*66/120M1
- (b) 33 csoA1
- (b) remaining three values correct: 27, 33, 27A1
- (b) Answer: Expected frequencies: 33, 27, 33, 27.
- (c) uses X2 = sum of (|O-E| - 0.5)2 / EM1
- (c) all four terms correct (unsimplified), e.g. 72.25/33, 72.25/27, 72.25/33, 72.25/27A1
- (c) cao, awrt 9.73A1
- (c) Answer: Test statistic (with Yates' correction) = awrt 9.73
- (d) df = 1B1
- (d) compares 9.73 with the critical values 2.706 (10%), 3.841 (5%) and 6.635 (1%)M1
- (d) 1%, since 9.73 > 6.635A1
- (d) Answer: df = 1; H0 is rejected even at the 1% level.
- (e) strong evidence of an association between attending the workshop and passing the resitB1
- (e) valid caveat, e.g. association does not imply causation; a confounding variable such as general motivation or prior attainment could affect both workshop attendance and passing, oeB1
- (e) Answer: Strong evidence of association; however, a confounding variable (e.g. motivation) could explain the link without attendance causing the outcome.
Question 15
- (a) H0: X ~ B(5, p), with p estimated as in part (b)B1
- (a) H1: X does not follow this binomial distributionB1
- (a) Answer: H0: X ~ B(5, phat). H1: X does not follow this binomial distribution.
- (b) phat = (total defectives) / (total bulbs inspected) = 150 / (180*5)M1
- (b) 1/6 csoA1
- (b) correct use of P(X=2) = C(5,2) * (1/6)2 * (5/6)3M1
- (b) cao, awrt 0.1608A1
- (b) Answer: phat = 1/6; P(X=2) = awrt 0.1608
- (c) attempts E = 180 * P(X=x) for each value of XM1
- (c) all six values correct (ft): 72.338, 72.338, 28.935, 5.787, 0.579, 0.023A1
- (c) Answer: Expected frequencies: 72.338, 72.338, 28.935, 5.787, 0.579, 0.023
- (d) E(X=4)=0.579 and E(X=5)=0.023 are both less than 5, and even combined (0.602) they remain below 5, so X=3, 4 and 5 must all be combined into a single class 'X≥3'B1
- (d) pooled observed table: 77, 67, 27, 9B1
- (d) pooled expected table: 72.338, 72.338, 28.935, 6.389B1
- (d) Answer: Pooled classes 0, 1, 2, ≥3: O = 77, 67, 27, 9; E = 72.338, 72.338, 28.935, 6.389.
- (e) attempts sum of (O-E)2/E across the 4 pooled classesM1
- (e) cao, awrt 1.89A1
- (e) Answer: Test statistic = awrt 1.89
- (f) df = (4 pooled classes) - 1 - 1 (p estimated) = 2B1
- (f) critical value = 5.991B1
- (f) valid conclusion ft: since 1.89 < 5.991, do not reject H0; the binomial model B(5, 1/6) is a good fit for the number of defective bulbs per boxB1
- (f) Answer: df = 2; critical value = 5.991; 1.89 < 5.991 so do not reject H0.
Question 16
- (a) attempts sum of (fx) / (sum of f)M1
- (a) cao, 1.5A1
- (a) Answer: Mean = 1.5 scratches per windscreen
- (b) correct use of P(X=3) = e-1.5 * 1.53 / 3!M1
- (b) cao, awrt 0.1255A1
- (b) expected frequency for X=3 (ft) = 12.551B1
- (b) Answer: P(X=3) = awrt 0.1255; expected frequency = 12.551
- (c) E(X=4)=4.707 and E(X≥5)=1.858 are both less than 5, so these two classes must be combined into a single class 'X≥4'B1
- (c) pooled observed table: 22, 34, 25, 12, 7B1
- (c) pooled expected table: 22.313, 33.470, 25.102, 12.551, 6.564B1
- (c) Answer: Pooled classes 0, 1, 2, 3, ≥4: O = 22, 34, 25, 12, 7; E = 22.313, 33.470, 25.102, 12.551, 6.564.
- (d) attempts sum of (O-E)2/E across the 5 pooled classesM1
- (d) cao, awrt 0.0663A1
- (d) Answer: Test statistic = awrt 0.0663
- (e) df = (5 pooled classes) - 1 - 1 (mean estimated) = 3B1
- (e) critical value = 7.815B1
- (e) valid conclusion ft: since 0.0663 < 7.815, do not reject H0; a Poisson distribution is a suitable model for the number of scratches per windscreenB1
- (e) Answer: df = 3; critical value = 7.815; 0.0663 < 7.815 so do not reject H0.
- (f) suggests an unusually close (excellent) agreement between observed and expected frequenciesB1
- (f) any sensible reason, e.g. the data may have been rounded, adjusted, or not recorded entirely independently, producing values suspiciously close to the model, oeB1
- (f) Answer: The very small value suggests an unusually close fit; possible reasons include the data being rounded/adjusted or not collected fully independently.
Question 17
- (a) H0: defect type is independent of shiftB1
- (a) H1: defect type is associated with shiftB1
- (a) Answer: H0: defect type and shift are independent. H1: they are associated.
- (b) uses E = (row total * column total) / grand total = 100*59/200M1
- (b) 29.5 csoA1
- (b) remaining values correct: 29.5, 20.5, 20.5 for each shift (both rows identical since row totals are equal)A1
- (b) Answer: Expected frequencies (each shift): Scratch 29.5, Crack 29.5, Discolour 20.5, Misalign 20.5.
- (c) attempts sum of (O-E)2/E across all 8 cellsM1
- (c) cao, awrt 3.72A1
- (c) Answer: Test statistic = awrt 3.72
- (d) df = (2-1)(4-1) = 3B1
- (d) critical value = 7.815B1
- (d) valid conclusion ft: since 3.72 < 7.815, do not reject H0; no evidence that defect type is associated with shiftB1
- (d) Answer: df = 3; critical value = 7.815; 3.72 < 7.815 so do not reject H0.
- (e) H0: defect types occur in the ratio 3:3:2:2; H1: they do notB1
- (e) converts the ratio to proportions 0.3, 0.3, 0.2, 0.2 and multiplies by 200M1
- (e) expected frequencies all correct: 60, 60, 40, 40A1
- (e) attempts sum of (O-E)2/E using the pooled column totals 59, 59, 41, 41M1
- (e) cao, awrt 0.0833A1
- (e) df = 3, critical value = 7.815; since 0.0833 < 7.815, do not reject H0 - the combined data are consistent with the claimed ratioB1
- (e) Answer: Test statistic = awrt 0.0833; df = 3, critical value = 7.815; do not reject H0.
- (f) part (e) uses the combined totals across both shifts, so any difference between Day and Night has been lost once the data are pooledB1
- (f) the question of whether shift affects defect type is answered only by the test in parts (a) to (d), which uses the full two-way breakdownB1
- (f) Answer: Part (e) pools both shifts together, so it cannot detect any difference between Day and Night; only the two-way test in (a) to (d) can address association with shift.
Mark your answers
Check answers without an account. Some answers can be checked automatically; use the mark scheme to mark the rest.