Teachers' Portal  /  A-Level Further Maths 9231  /  Chi-squared tests  /  Contingency tables and independence
Lesson pack · A-Level Further Maths 9231 · 4.3 · AS & A Level

Contingency tables and independence

Are the two linked? A contingency table counts people or objects by two features at once.

Student lesson Lab, full screen
At a glance

The shape of the lesson

Topic
Chi-squared tests
Syllabus reference
Cambridge International AS and A Level Further Mathematics 9231, 4.3
Level
AS & A Level
Duration
45 minutes, lab-led; stretches to a 60 minute block (see the contingency notes)
Position in topic
Lesson 2 of 2 in Chi-squared tests; follows Chi-squared goodness of fit
Central model
Fig. 1: 120 adults classified by age group and favourite exercise. If the two are independent, the expected number of under-30s who prefer the gym is 60 x 44 / 120 = 22; 30 were observed
Cooperative structure
Assessment
Stage 1 check and the exam-style plenary from the student lesson, plus the worksheet as the exit task
Learning objectives

By the end of the lesson, learners can

Section by section
  • Independence or association?: In the goodness of fit lesson the expected frequencies came from a named distribution.
  • Contributions, then a decision: Lay out \(\dfrac{(O - E)^{2}}{E}\) for every cell in a table of contributions.
  • Combine until every E is at least 5: The test statistic only follows a \(\chi^{2}\) distribution approximately, and the approximation is poor when expected frequencies are small.
Key points to leave on the board
  • Hypotheses in context: H0 the two classifications are independent; H1 they are not.
  • Expected frequencies: \(E = \dfrac{\text{row total} \times \text{column total}}{\text{grand total}}\), not rounded.
  • Combine adjacent rows or columns until every \(E \ge 5\), and recompute.
  • Degrees of freedom \(\nu = (r - 1)(c - 1)\) for the table actually used.
  • Compare \(X^{2} = \sum (O - E)^{2}/E\) with the critical value; conclude in context without claiming proof, then comment on the largest contributions.
The core visual model

One picture every idea returns to

H0: the two classifications are independent; H1: they are not independent (there is an association). Expected frequency \(E = \dfrac{\text{row total} \times \text{column total}}{\text{grand total}}\). Combine adjacent rows or columns until every \(E \ge 5\), then \(X^{2} = \sum \dfrac{(O - E)^{2}}{E}\) is compared with \(\chi^{2}_{\nu}\) where \(\nu = (r - 1)(c - 1)\) for the table you actually use. Reject H0 if \(X^{2}\) exceeds the critical value.

Gym Running Swimming Total Under 30 30 and over Total 30 18 12 60 14 22 24 60 44 40 36 120 E = 60 × 44 ÷ 120 = 22 row total × column total ÷ grand total
Fig. 1: 120 adults classified by age group and favourite exercise. If the two are independent, the expected number of under-30s who prefer the gym is 60 x 44 / 120 = 22; 30 were observed
Lesson sequence

Forty-five minutes, phase by phase

TimePhaseWhat happens in the roomGrouping
0 to 5 minHook: predictOpen with the question in the title, Are the two linked?. A contingency table counts people or objects by two features at once. Put the figure on the board: it is the one picture every idea in the lesson returns to.Whole class, then pairs
5 to 13 minTeach and check: Independence or association?In the goodness of fit lesson the expected frequencies came from a named distribution. Project tab 2 of the lab (Distributions lab, chi-squared) and let a student drive it while the class predicts. Model the worked example Every expected frequency on the board, one line at a time.Whole class, then pairs
13 to 21 minTeach and check: Contributions, then a decisionLay out \(\dfrac{(O - E)^{2}}{E}\) for every cell in a table of contributions. Model the worked example The full test on the exercise table on the board, one line at a time. Your turn: In the flashcard test, would the conclusion change at the 1% level?Pairs
21 to 30 minTeach and check: Combine until every E is at least 5The test statistic only follows a \(\chi^{2}\) distribution approximately, and the approximation is poor when expected frequencies are small. Model the worked example Combine, then test on the board, one line at a time.Connect-Extend-Challenge
30 to 36 minCheckThe four Stage 1 questions from the student lesson, answered on mini whiteboards or by show of fingers. Re-teach the one most get wrong.Individual, then whole class
36 to 43 minPlenaryThe exam-style questions from Stage 2, one at a time: thirty seconds alone, then a random call. The feedback lines in the key give the examiner's wording.Individual, random call
43 to 45 minExit and homeworkSet the worksheet below (6 questions, 38 marks). Learners self-assess against the objectives before they leave.Individual
Timing and contingency

Protect the parts that carry the learning

The sequence carries about fifty minutes of material, so the lab is driven by one student while the class predicts rather than explored freely. Times are a guide.

Protected: the check at 30 minutes. It is the only individual read on whether the key idea landed, and it is not cut.

Cut first if the build overruns: the last check in Combine until every E is at least 5, never the check or the plenary.

In a 60 minute block: run worksheet questions 1 to 3 in class as a Rally Coach set and model both the hardest worked example and its check live.

Running the cooperative task

Connect-Extend-Challenge

After the new idea, each student writes three lines: how it connects to what they knew, how it extends their thinking, and what still challenges them. Pairs compare, then the challenges become the plenary.

The full structure, with its PIES check and a worked example for every subject, is on the cooperative-learning page, one of fifteen structures there.

Examiner traps to pre-empt

What to head off, and how

Trap learners fall intoTeaching move that pre-empts it
Do not round expected frequencies to whole numbers.They are averages, not counts: 2.52 and 14.4 are correct values. Rounding them changes every contribution and can change the conclusion.
Rejecting H 0 shows an association, not a cause: the test cannot say that flashcards MADE students pass.Equally, not rejecting H 0 never proves independence; write 'there is insufficient evidence of an association'.
Combine on EXPECTED frequencies, not observed ones: the '6+' column has observed 5 in one row, but its expected frequency 2.52 is what matters.And after combining, \(\nu\) comes from the new table: \((3 - 1)(3 - 1) = 4\), not the original 6.
Worksheet

Contingency tables and independence: worksheet

6 questions, 38 marks. Written in the style of the papers; no past paper question is reproduced.

NameClassDate
Q1 · recall[4 marks]

200 shoppers are classified by age and by how they paid.

CashCardPhoneTotal
Under 40164460120
40 and over34262080
Total507080200

(a) State suitable hypotheses for a test of independence. (b) Find the expected frequency for '40 and over, cash'. (c) State the number of degrees of freedom and the critical value for a test at the 5% level.

Q2 · calculation[6 marks]

90 adults were asked whether they used a phone in bed in the hour before sleeping and whether they woke feeling rested.

RestedNot restedTotal
Phone in bed143145
No phone281745
Total424890

Test, at the 1% significance level, whether feeling rested is independent of phone use in bed.

Q3 · calculation[6 marks]

The lunch choices of a sample of Year 10 and Year 11 students are shown.

School mealPacked lunchGoes homeTotal
Year 1022181050
Year 1118322070
Total405030120

Test, at the 5% significance level, whether lunch choice is independent of year group.

Q4 · analysis[8 marks]

160 cinema-goers were asked which genre of film they prefer.

AgeActionComedyDramaTotal
16-2528121050
26-4018161650
41-6010142448
Over 6026412
Total584854160

(a) Explain why the table must be modified before a chi-squared test, and modify it suitably. (b) Test, at the 5% level, whether preferred genre is independent of age. (c) Comment on the two largest contributions.

Q5 · analysis[7 marks]

Residents of two areas of a town were asked their opinion of a new bus route.

In favourNo opinionAgainstTotal
North30251570
South20353590
Total506050160

(a) Test, at the 1% significance level, whether opinion is independent of area. (b) Which column contributes least to \(X^{2}\)? What does this tell you?

Q6 · analysis[7 marks]

Plants were grown with fertiliser A or fertiliser B and their condition after six weeks recorded.

HealthyWiltedDiedTotal
A3610248
B2218444
Total5828692

(a) Show that two columns must be combined, and explain which two. (b) Test, at the 5% level, whether condition is independent of fertiliser.

Answer key and marking notes
Q1 · 4 marks
  • (a) H0: payment method and age group are independent. H1: payment method and age group are not independent.
  • (b) \(E = \dfrac{80 \times 50}{200} = 20\).
  • (c) \(\nu = (2 - 1)(3 - 1) = 2\); the 5% critical value of \(\chi^{2}_{2}\) is 5.991.
Q2 · 6 marks
  • H0: feeling rested and phone use in bed are independent. H1: they are not independent.
  • \(E\): rested \(\frac{45 \times 42}{90} = 21\), not rested \(\frac{45 \times 48}{90} = 24\), in both rows. All at least 5.
  • Every \(|O - E| = 7\): \[ X^{2} = 49 \left( \frac{2}{21} + \frac{2}{24} \right) = 4.667 + 4.083 = 8.75 \]
  • \(\nu = 1\); the 1% critical value of \(\chi^{2}_{1}\) is 6.635.
  • \(8.75 > 6.635\), so reject H0.
  • There is sufficient evidence at the 1% level of an association between phone use in bed and feeling rested; fewer phone users felt rested (14) than expected (21).
Q3 · 6 marks
  • H0: lunch choice and year group are independent. H1: they are not independent.
  • \(E\): Year 10: 16.67, 20.83, 12.5; Year 11: 23.33, 29.17, 17.5. All at least 5.
  • \[ \begin{aligned} X^{2} &= 1.707 + 0.385 + 0.500 \\ &\quad + 1.219 + 0.275 + 0.357 = 4.443 \end{aligned} \]
  • \(\nu = (2 - 1)(3 - 1) = 2\); the 5% critical value is 5.991.
  • \(4.443 < 5.991\), so do not reject H0.
  • There is insufficient evidence at the 5% level of an association between lunch choice and year group.
Q4 · 8 marks
  • (a) The 'Over 60' expected frequencies are \(\frac{12 \times 58}{160} = 4.35\), 3.6 and 4.05, all below 5. Combine 'Over 60' with the adjacent '41-60' row to give '41 and over': 12, 20, 28 (total 60).
  • (b) H0: genre preference and age are independent. H1: they are not independent.
  • \(E\): 16-25 and 26-40 rows: 18.125, 15, 16.875; 41 and over: 21.75, 18, 20.25.
  • \[ \begin{aligned} X^{2} &= 5.380 + 0.600 + 2.801 \\ &\quad + 0.001 + 0.067 + 0.045 \\ &\quad + 4.371 + 0.222 + 2.966 = 16.45 \end{aligned} \]
  • \(\nu = (3 - 1)(3 - 1) = 4\); the 5% critical value is 9.488. \(16.45 > 9.488\), so reject H0: there is sufficient evidence at the 5% level of an association between age and preferred genre.
  • (c) '16-25, Action' (5.380): 28 observed against 18.125 expected, so young adults prefer action films more than independence predicts. '41 and over, Action' (4.371): 12 against 21.75, so older adults choose action films less often.
Q5 · 7 marks
  • (a) H0: opinion and area are independent. H1: they are not independent.
  • \(E\): North 21.875, 26.25, 21.875; South 28.125, 33.75, 28.125. All at least 5.
  • \[ \begin{aligned} X^{2} &= 3.018 + 0.060 + 2.161 \\ &\quad + 2.347 + 0.046 + 1.681 = 9.312 \end{aligned} \]
  • \(\nu = 2\); the 1% critical value of \(\chi^{2}_{2}\) is 9.210. \(9.312 > 9.210\), so reject H0.
  • There is sufficient evidence at the 1% level of an association between area and opinion: North residents are more in favour (30 against 21.875) and less against (15 against 21.875) than expected.
  • (b) 'No opinion' (0.060 and 0.046): the proportion with no opinion is about the same in both areas; the association lies entirely in the for and against split.
Q6 · 7 marks
  • (a) 'Died' expected frequencies: \(\frac{48 \times 6}{92} = 3.13\) and \(\frac{44 \times 6}{92} = 2.87\), both below 5.
  • Combine 'Died' with the adjacent 'Wilted' column to make 'Not healthy' (A 12, B 22, total 34). Combining 'Healthy' with 'Wilted' would leave the 'Died' cells still below 5.
  • (b) H0: condition and fertiliser are independent. H1: they are not independent.
  • \(E\): A 30.26, 17.74; B 27.74, 16.26. Every \(|O - E| = 5.739\): \[ X^{2} = 1.089 + 1.857 + 1.187 + 2.026 = 6.158 \]
  • The table is now 2 x 2, so \(\nu = 1\); the 5% critical value is 3.841. \(6.158 > 3.841\), so reject H0.
  • There is sufficient evidence at the 5% level of an association between fertiliser and condition; fewer plants given A were not healthy (12) than expected (17.74).
Quiz

8 multiple-choice questions on this lesson

From the topic question bank. Assign them in the app for a marked score in your gradebook, or run the topic as a class game.

Q11 mark

In a contingency table with grand total 200, a cell lies in a row with total 64 and a column with total 75. Find its expected frequency if the two classifications are independent.

  • A\(48\)
  • B\(0.12\)
  • C\(24\)
  • D\(33.3\)
Q21 mark

A test for independence starts from a contingency table with 4 rows and 5 columns. Two rows are combined so that every expected frequency is at least 5. How many degrees of freedom does the test have?

  • A\(14\)
  • B\(12\)
  • C\(7\)
  • D\(8\)
Q31 mark

Of 30 people who took a supplement, 18 caught a cold and 12 did not. Of 70 who did not take it, 22 caught a cold and 48 did not. Find \(X^{2}\) for a test of independence, to 3 s.f.

  • A\(7.14\)
  • B\(6.00\)
  • C\(1.44\)
  • D\(7.39\)
Q41 mark

A test for independence on a 3 x 3 contingency table (no combining needed) gives \(X^{2} = 10.2\). Which is the correct conclusion at the 1% significance level?

  • A\(10.2 > 9.488\): evidence at 1% of an association
  • B\(10.2 < 13.28\): insufficient evidence at 1% of an association
  • C\(10.2 < 13.28\): this proves the classifications are independent
  • D\(10.2 > 9.210\): evidence at 1% of an association
Q51 mark

90 students give their preferred revision method. Boys: videos 25, notes 15, flashcards 4. Girls: videos 15, notes 25, flashcards 6. Which is the correct test of independence at the 5% level?

  • ACombine flashcards with notes; \(\nu = 2\); \(5.34 < 5.991\): no evidence of an association
  • BCombine flashcards with notes; \(\nu = 1\); \(5.34 > 3.841\): this proves the two are dependent
  • CCombine flashcards with notes; \(\nu = 1\); \(5.34 > 3.841\): evidence of an association
  • DNo combining; \(\nu = 2\); \(5.36 < 5.991\): no evidence of an association
Q61 mark

In a contingency table with grand total 150, the cell 'urban, cycles to work' has observed frequency 20, row total 50 and column total 36. Find its contribution to \(X^{2}\) and say what it suggests.

  • A\(5.33\); more urban cyclists than independence predicts
  • B\(5.33\); fewer urban cyclists than independence predicts
  • C\(3.20\); more urban cyclists than independence predicts
  • D\(0.667\); more urban cyclists than independence predicts
Q71 mark

170 students are classified by how they travel to school and by age. Walk: 11-12 years 30, 13-14 years 25, 15-16 years 15. Bus: 20, 35, 45. Given that \(X^{2} = 13.8\), which is the correct conclusion at the 1% level?

  • A\(\nu = 6\); \(13.8 < 16.81\): no evidence at 1% of an association
  • B\(\nu = 2\); \(13.8 > 9.210\): evidence at 1% of an association
  • C\(\nu = 2\); \(13.8 > 9.210\): age causes the choice of travel method
  • D\(\nu = 5\); \(13.8 < 15.09\): no evidence at 1% of an association
Q81 mark

A 4 x 3 contingency table is tested for independence at the 10% level. Two of its rows have to be combined because of small expected frequencies. Which critical value should be used?

  • A\(9.488\)
  • B\(10.64\)
  • C\(6.251\)
  • D\(7.779\)
Quiz key
Q1: C

\(E = \dfrac{64 \times 75}{200} = \dfrac{4800}{200} = 24\). \(48\) divides by 100 instead of the grand total 200. \(33.3\) shares 200 equally over six cells, ignoring the totals. \(0.12\) divides by \(200^{2}\), giving the probability of the cell rather than its expected frequency.

Q2: D

After combining there are 3 rows and 5 columns, so \(\nu = (3 - 1)(5 - 1) = 8\). \(12 = (4 - 1)(5 - 1)\) uses the table before combining. \(14 = 3 \times 5 - 1\) treats it like a goodness of fit test with 15 classes. \(7\) subtracts an extra 1, as if a parameter had been estimated; the expected frequencies come from the totals, which \((r - 1)(c - 1)\) already allows for.

Q3: A

Column totals: 40 colds, 60 not. Expected: \(\tfrac{30 \times 40}{100} = 12\), 18, 28, 42. Every \(|O - E| = 6\), so \(X^{2} = 36\left(\tfrac{1}{12} + \tfrac{1}{18} + \tfrac{1}{28} + \tfrac{1}{42}\right) = 7.14\). \(6.00\) applies Yates' correction, which is not used in this syllabus. \(7.39\) divides by the observed frequencies. \(1.44\) divides \(\sum (O - E)^{2} = 144\) by the grand total.

Q4: B

\(\nu = (3 - 1)(3 - 1) = 4\), and the upper 1% point of \(\chi^{2}_{4}\) is 13.28. As \(10.2 < 13.28\), H0 is not rejected: there is insufficient evidence at the 1% level that the classifications are associated. \(9.488\) is the 5% value for \(\nu = 4\). Not rejecting H0 never proves independence. \(9.210\) is the 1% value for \(\nu = 2\), from taking \(\nu = r - 1\).

Q5: C

Flashcards expected: \(\tfrac{44 \times 10}{90} = 4.89\) and 5.11, so one is below 5 and the column is combined with notes, giving the 2 x 2 table 25, 19 / 15, 31 with expected 19.56, 24.44, 20.44, 25.56. \(X^{2} = 5.34\), \(\nu = 1\), and \(5.34 > 3.841\), so there is evidence that preferred method and gender are associated. Not combining ignores an expected frequency below 5. Using \(\nu = 2\) after combining takes \(\nu\) from the original table. Saying the test proves dependence is too strong for a significance test.

Q6: A

\(E = \dfrac{50 \times 36}{150} = 12\), so the contribution is \(\dfrac{(20 - 12)^{2}}{12} = 5.33\). Since \(O = 20 > E = 12\), more urban people cycle than independence would predict. \(3.20\) divides by \(O\) instead of \(E\). The 'fewer' option reads the direction the wrong way round. \(0.667\) is \(\dfrac{O - E}{E}\), without squaring.

Q7: B

The smallest expected frequency is \(\tfrac{70 \times 50}{170} = 20.6\), so no combining is needed. \(\nu = (2 - 1)(3 - 1) = 2\), the 1% critical value is 9.210 and \(13.8 > 9.210\), so there is evidence at the 1% level that travel method and age are associated. \(\nu = 6\) uses \(r \times c\). \(\nu = 5\) uses \(rc - 1\), as for a goodness of fit test. The last option has the right test but over-claims: a test of independence can show an association, never that one factor causes the other.

Q8: D

After combining the table is 3 x 3, so \(\nu = (3 - 1)(3 - 1) = 4\), and the upper 10% point of \(\chi^{2}_{4}\) is 7.779. \(9.488\) is the 5% point for \(\nu = 4\). \(10.64\) is the 10% point for \(\nu = 6\), the original 4 x 3 table. \(6.251\) is the 10% point for \(\nu = 3\), from subtracting 1 again after combining.

Lab and demo

What to project

The student lesson embeds these tabs. Open them full screen on the projector; every slider has a drag handle on the stage.

Slides

Slides for this lesson

A projectable deck for every pack is on the way. Until then, present the student lesson full screen: its sections, figure and lab tabs follow the same order as the plan above.

Also for this topic

Everything else you can use

Original work by the TheLucidSTEM team. The worksheet items are written in the style of the papers; no past paper question is reproduced.
Previous lessonChi-squared goodness of fit