Maths › Practise › Questions › Contingency tables
Questions on contingency tables
A contingency table cross-tabulates two categorical variables, and a chi-squared test assesses whether they are independent. Expected counts come from the row and column totals and the degrees of freedom from the shape of the table. On a two by two table, OCR H245 requires Yates' correction; AQA 7367 expects you to know when and how to apply it.
16 original questions · 62 marks · the contingency tables notes · Further Statistics 1
To print: the questions (PDF, 83 KB) · the worked answers (PDF, 96 KB)
These are original InkMaths questions. Write a complete answer before opening the worked solution and marking guidance.
State the null hypothesis of a contingency table test, and the formula for an expected frequency.
Worked solution and marking guidance
H₀ is that the two variables are independent, so there is no association between them. Each expected frequency is row total × column total ÷ grand total. B1 for the hypothesis, B1 for the formula.A contingency table has 4 rows and 5 columns. State the degrees of freedom.
Worked solution and marking guidance
(4 − 1)(5 − 1) = 12. B1. No further subtraction is made for estimated parameters. The row and column totals have already absorbed them, which is the difference between this test and a goodness-of-fit test.A 3 × 4 contingency table is to be tested, but one column has an expected frequency below 5 and is merged with the column next to it. State the degrees of freedom of the test that is then carried out, and explain why the answer is not 6.
Worked solution and marking guidance
The merged table has 3 rows and 3 columns, so the degrees of freedom are (3 − 1)(3 − 1) = 4. The value 6 belongs to the original 3 × 4 table, and the statistic is computed from the merged one, so the critical value must come from the merged table too. B1 for 4, B1 for the reason.In a contingency table one cell has observed frequency 18 and expected frequency 12.5. Find its contribution to the χ² statistic and state whether the cell holds more or fewer than independence predicts.
Worked solution and marking guidance
(O − E)²/E = (18 − 12.5)²/12.5 = 30.25/12.5 = 2.42. Since 18 > 12.5 the cell holds more than independence predicts. M1 for the squared difference over the expected frequency, A1 for 2.42 with the comparison. Divide by E, not by O: the expected frequency is the scale against which the discrepancy is measured.A survey gives the rows (25, 15, 10) and (15, 25, 10). Find all six expected frequencies.
Worked solution and marking guidance
Row totals are 50 and 50, column totals 40, 40 and 20, grand total 100. Each expected frequency is row total × column total ÷ 100, giving 50 × 40/100 = 20 for the first two columns of each row and 50 × 20/100 = 10 for the third. M1 for the row and column totals, M1 for row × column ÷ grand total, A1 for all six values. Equal row totals make both rows expect the same split. Set out the expected frequencies in a table with the same row and column structure as the observed frequencies.Using those figures, compute the chi-squared statistic and test for association at the 5% level, given a critical value of 5.991.
Worked solution and marking guidance
H₀: no association between the two variables; H₁: the variables are associated.
The contributions (O − E)²/E are 25/20, 25/20, 0, 25/20, 25/20 and 0, totalling 5.0. There are (2 − 1)(3 − 1) = 2 degrees of freedom, and 5.0 < 5.991, so the statistic is not in the critical region. Do not reject H₀. There is insufficient evidence at the 5% level of an association, although the value sits fairly close to the boundary. B1 for the hypotheses, M1 for the contributions, A1 for 5.0, B1 for 2 degrees of freedom, A1 for the comparison and conclusion in context. Quote every contribution as well as the total, so that the arithmetic can be followed.A 2 × 2 contingency table has all four expected frequencies above 5. Explain why it carries only one degree of freedom.
Worked solution and marking guidance
Once both row totals and both column totals are fixed, choosing any single cell determines the other three by subtraction. Exactly one cell is free to vary, and (2 − 1)(2 − 1) = 1 records that. B1 for the totals fixing the remaining cells, B1 for exactly one free cell.A test on a contingency table gives a significant result. Explain what may and may not be concluded from it.
Worked solution and marking guidance
It may be concluded that there is evidence of an association between the two variables, since the observed pattern is unlikely if they were independent. It may not be concluded that one variable causes the other, nor that the association is large. B1 for evidence of association, B1 for ruling out a causal conclusion, B1 for the strength not being measured. A large enough sample makes even a slight association significant.A survey of 100 people records whether each owns a car and whether each cycles to work. The 2 × 2 table has rows (28, 22) for car owners and (16, 34) for non-owners, the first column being those who cycle. Test for association at the 5% level and at the 1% level, given that the upper 5% and 1% points of χ² on 1 degree of freedom are 3.841 and 6.635, and comment on the two conclusions.
Worked solution and marking guidance
H₀: car ownership and cycling are independent; H₁: they are associated.
Row totals 50 and 50, column totals 44 and 56, grand total 100, so the expected frequencies are 22, 28, 22 and 28. The contributions are 36/22 = 1.636, 36/28 = 1.286, 1.636 and 1.286, so χ² = 5.84 on (2 − 1)(2 − 1) = 1 degree of freedom.
5.84 > 3.841, so at the 5% level reject H₀: there is evidence of an association. 5.84 < 6.635, so at the 1% level do not reject H₀. B1 for the hypotheses, M1 for the expected frequencies, A1 for 5.84, A1 for both conclusions in context. The evidence is enough to convince a test that tolerates a 5% chance of a false alarm but not one that tolerates only 1%; the data have not changed, only the standard of proof.A 3 × 2 table has rows (12, 8), (20, 30) and (3, 7), the rows being the age groups under 30, 30 to 49 and 50 and over. Find the six expected frequencies, explain which rows must be merged before a test can be carried out and why, and state the degrees of freedom of the test on the merged table.
Worked solution and marking guidance
Row totals 20, 50 and 10, column totals 35 and 45, grand total 80. Expected frequencies: row 1 gives 8.75, 11.25; row 2 gives 21.875, 28.125; row 3 gives 4.375, 5.625.
The cell 4.375 is below 5, so the 50 and over row must be merged with the row next to it, 30 to 49, giving observed rows (12, 8) and (23, 37) with expected frequencies 8.75, 11.25, 26.25 and 33.75, all above 5. The merged table is 2 × 2, so the test has (2 − 1)(2 − 1) = 1 degree of freedom. M1 for row × column ÷ grand total, A1 for all six values, B1 for merging the last two rows because 4.375 < 5, B1 for 1 degree of freedom. Merge with the neighbouring age group, so that the combined row still means something (30 and over); merging the two extreme rows would produce a category with no interpretation.In a 2 × 3 contingency table the row totals are 60 and 40 and the column totals are 30, 50 and 20. The first row of observed frequencies is (22, 28, 10). Find the χ² statistic.
Worked solution and marking guidance
The second row is found by subtraction from the column totals: (30 − 22, 50 − 28, 20 − 10) = (8, 22, 10). Expected frequencies are 18, 30, 12 in row 1 and 12, 20, 8 in row 2. The contributions are 16/18 = 0.889, 4/30 = 0.133, 4/12 = 0.333, 16/12 = 1.333, 4/20 = 0.2 and 4/8 = 0.5, so χ² = 3.39. M1 for completing the table from the margins, M1 for the expected frequencies, A1 for 3.39. The second row has the same differences O − E as the first with the signs reversed, which is a quick check on the subtraction.A 2 × 3 table has rows (40, 30, 5) and (20, 20, 5). Find the expected frequencies, explain what must be done before the test can proceed, and carry out the test at the 5% level. The upper 5% points of χ² are 3.841 for 1 degree of freedom, 5.991 for 2 and 7.815 for 3.
Worked solution and marking guidance
Row totals 75 and 45, column totals 60, 50 and 10, grand total 120. Expected frequencies: row 1 gives 37.5, 31.25, 6.25; row 2 gives 22.5, 18.75, 3.75.
The last cell of row 2 has an expected frequency of 3.75, below 5, so the third column must be merged with the second. The observed table becomes (40, 35) and (20, 25), with expected frequencies 37.5, 37.5, 22.5 and 22.5, all above 5.
Merging changes the size of the table, so the degrees of freedom must be recounted from the merged table: (2 − 1)(2 − 1) = 1, not 2.
χ² = 2 × 6.25/37.5 + 2 × 6.25/22.5 = 0.333 + 0.556 = 0.889. Since 0.889 < 3.841, do not reject H₀. There is insufficient evidence at the 5% level of an association. M1 for row × column ÷ grand total, A1 for all six expected frequencies, B1 for spotting the expected frequency below 5, M1 for merging the last two columns, B1 for 1 degree of freedom, M1 for the χ² calculation, A1 for 0.889 and the conclusion.A 2 × 2 table has cells a, b in the first row and c, d in the second, with N = a + b + c + d. Show that for the top-left cell O − E = (ad − bc)/N, explain why every cell has the same value of (O − E)², and hence prove that χ² = N(ad − bc)²/[(a + b)(c + d)(a + c)(b + d)]. Check the formula on the table with rows (28, 22) and (16, 34).
Worked solution and marking guidance
For the top-left cell E = (a + b)(a + c)/N, so O − E = [aN − (a + b)(a + c)]/N = [a² + ab + ac + ad − a² − ac − ab − bc]/N = (ad − bc)/N.
The expected frequencies have the same row and column totals as the observed ones, so the differences O − E in each row and in each column add to zero. With only two cells in every row and column, each difference is plus or minus (ad − bc)/N, and (O − E)² is the same in all four cells.
χ² = (ad − bc)²/N² × (1/E over the four cells). Writing each E as a product of margins over N, the sum of 1/E is N[(b + d)(c + d) + (a + c)(c + d) + (a + b)(b + d) + (a + b)(a + c)]/[(a + b)(c + d)(a + c)(b + d)], and the bracket is (c + d)N + (a + b)N = N². So χ² = N(ad − bc)²/[(a + b)(c + d)(a + c)(b + d)].
Check: ad − bc = 952 − 352 = 600, N = 100, and the margins are 50, 50, 44, 56, so χ² = 100 × 360000/6160000 = 5.84, which agrees with the cell-by-cell sum 2 × 36/22 + 2 × 36/28. M1 for the expected frequency of the top-left cell, A1 for (ad − bc)/N, B1 for the zero row and column sums forcing equal squares, M1 for collecting the four reciprocals, A1 for the bracket reducing to N², A1 for the check. The formula is exact only for 2 × 2 tables, because only there does a single free cell fix all four differences.A pilot study of 100 shoppers records whether each holds a loyalty card and whether each chooses own-brand goods, giving the 2 × 2 table with rows (28, 22) and (22, 28). The study is then repeated with 400 shoppers and gives exactly the same proportions, with rows (112, 88) and (88, 112). Test each table for association at the 5% level, given the upper 5% point of χ² on 1 degree of freedom is 3.841, and explain what the comparison shows about what the test does and does not measure.
Worked solution and marking guidance
Pilot study: all margins are 50, so every expected frequency is 25 and every contribution is 3²/25 = 0.36, giving χ² = 1.44. Since 1.44 < 3.841, do not reject H₀: no evidence of association.
Larger study: all margins are 200, every expected frequency is 100 and every contribution is 12²/100 = 1.44, giving χ² = 5.76. Since 5.76 > 3.841, reject H₀: there is evidence of association.
Multiplying every cell by 4 multiplies O − E by 4, (O − E)² by 16 and E by 4, so the statistic is multiplied by 4 while the proportions, and so the strength of any association, are unchanged. The test measures the evidence against independence, which grows with the sample size; it does not measure how strong the association is. M1 for the expected frequencies of the first table, A1 for 1.44 and not significant, M1 for the second table, A1 for 5.76 and significant, B1 for the explanation that the statistic scales with N while the association does not.Show that the statistic (O − E)²/E summed over all the cells of a contingency table equals the sum of O²/E over all the cells minus N, where N is the grand total. Use the second form to find the statistic for the 2 × 3 table with rows (30, 10, 20) and (10, 20, 10), and test for association at the 5% level given the upper 5% point of χ² on 2 degrees of freedom is 5.991.
Worked solution and marking guidance
Expanding one term, (O − E)²/E = O²/E − 2O + E. Summing over all cells, the sum of O is N, and the sum of E is also N because the expected frequencies share the observed margins. So the total is (sum of O²/E) − 2N + N = (sum of O²/E) − N.
Row totals 60 and 40, column totals 40, 30 and 30, grand total 100, so the expected frequencies are 24, 18, 18 in row 1 and 16, 12, 12 in row 2. The values of O²/E are 900/24 = 37.5, 100/18 = 5.556, 400/18 = 22.222, 100/16 = 6.25, 400/12 = 33.333 and 100/12 = 8.333, totalling 113.194, so χ² = 113.194 − 100 = 13.19.
With (2 − 1)(3 − 1) = 2 degrees of freedom, 13.19 > 5.991, so reject H₀: there is evidence at the 5% level of an association. M1 for expanding the square, A1 for the sums of O and of E both being N, A1 for the identity, M1 for the expected frequencies, A1 for 13.19, A1 for the comparison and conclusion in context. The second form is quicker on a calculator, but it subtracts two numbers of similar size, so carry the sum of O²/E to at least three decimal places before taking away N.Each adult in a survey was asked for their age group and for the way they usually travel to work. The table gives the numbers in each category. Use a χ² test at the 5% level of significance to determine whether there is an association between age group and method of travel, and state which cell contributes most to your statistic and what that cell says. The 5% critical values of χ² are 5.991 for 2 degrees of freedom, 7.815 for 3, 9.488 for 4 and 11.070 for 5.
age group car bus bicycle under 25 18 30 22 25 to 44 40 20 20 45 and over 32 10 8 Worked solution and marking guidance
H0: age group and method of travel are independent. H1: there is an association between them. The row totals are 18 + 30 + 22 = 70, 40 + 20 + 20 = 80 and 32 + 10 + 8 = 50; the column totals are 90, 60 and 50; and both sets add to a grand total of 200. M1 for the row totals, the column totals and the grand total. Each expected frequency is row total × column total ÷ 200. M1 for the rule applied to at least one cell. Row by row that gives 70×90/200 = 31.5, 70×60/200 = 21 and 70×50/200 = 17.5; then 36, 24 and 20; then 22.5, 15 and 12.5. A1 for all nine, and every one is above 5, so nothing has to be merged. The contributions (O − E)²/E are 5.786, 3.857 and 1.157 in the first row, then 0.444, 0.667 and 0 in the second, then 4.011, 1.667 and 1.620 in the third. M1 for the nine contributions. Their sum is χ² = 19.2 to 3 significant figures. A1 for 19.2. The table has 3 rows and 3 columns, so the degrees of freedom are (3 − 1)(3 − 1) = 4 and the critical value is 9.488. Since 19.2 > 9.488 the result is significant: reject H0, there is evidence of an association between age group and method of travel. B1 for the degrees of freedom, the comparison and the conclusion in context. The largest contribution, 5.79, is the under-25 car cell, where 18 were observed against 31.5 expected: far fewer of the youngest group drive to work than independence would predict, and it is that shortfall, taken with the 30 of them who travel by bus against 21 expected, that drives the test. B1 for the largest contribution named and read the right way round. A significant result says the two classifications are related in this sample; it does not say that being young causes a person to take the bus, since cost, licence-holding and where the young live are all bound up in the same figures.
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 contingency tables 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.