Topic 6 · Lesson 2 of 3
Contingency tables
Testing independence
A contingency table classifies each individual in two ways, such as age group and main news source. The question is whether the two classifications are independent.
- : the two variables are independent (no association).
- : they are not independent (there is an association).
If they are independent, the expected frequency in each cell is
For a table with rows and columns, the degrees of freedom are
because once the row and column totals are fixed, only cells can be filled freely.
Worked example
Sports clubs
120 students chose one of three clubs. Year 12: Football 30, Netball 10, Chess 20 (60 in all). Year 13: Football 20, Netball 20, Chess 20 (60). Column totals 50, 30, 40.
Show solutionHide solution
- Expected for Year 12 and football: . The expected frequencies are in each row.
- .
- ; at 10%, .
- : reject . There is evidence of an association between year group and club chosen.
At 5%, with , the same data would not be significant: always use the level the question gives.
Combining rows or columns
If some expected frequencies are below 5, combine a row (or column) with another one that makes sense in context, and recalculate the expected frequencies and degrees of freedom for the smaller table. A group of only 12 part-time students in a table of 150 might give expected frequencies of about 4, so it is combined with another group, and a table becomes with .
Interpreting a significant result
The test says only that there is an association. To describe it, look at the cells that contribute most to and compare with there: "more Year 12 students chose football than expected under independence (30 observed, 25 expected), and fewer chose netball (10 observed, 15 expected)". This is the kind of comment a final part asks for.
2 by 2 tables
For a table, , and every cell has the same , because the row and column totals are fixed. (No continuity correction is used in this course.)
Practise this topic
Both are part of Premium.