Associations between two categorical variables
Discover how to spot an association between two categorical variables in Year 12 General Mathematics for Queensland (QCAA). Do older Queenslanders slip, slop and slap more often than teenagers? A table of raw counts cannot say, because the groups are different sizes. Percentages turn the counts into a fair comparison.
You will practise choosing between row and column percentages, comparing the same response across groups, measuring the gap in percentage points, and writing a short, precise sentence that quotes both percentages. You will also learn why counts mislead. Next, the focus moves to numerical data, where the explanatory and response variables set up a scatterplot.
Theory
Two categorical variables are associated when the percentages of one change across the categories of the other. This Year 12 General Mathematics guide for Queensland students shows how to choose row or column percentages, compare groups, and describe an association clearly in context.
Two categorical variables are associated when knowing the category of one variable changes what you expect for the other. If older people are much more likely to wear sunscreen than younger people, then age group and sunscreen use are associated.
Raw counts can mislead, because the groups are usually different sizes. Instead, find percentages within each category of the explanatory variable: the variable that may explain or influence the other. If it labels the rows, use row percentages; if it labels the columns, use column percentages.
Then compare the percentages for the same response across the groups. Clearly different percentages suggest an association; percentages that are about the same suggest no association. The bigger the gap in percentage points, the stronger the association.
When the explanatory variable labels the rows:
When the explanatory variable labels the columns:
The size of the gap between two groups is measured in percentage points:
How to decide whether two categorical variables are associated
- Identify the explanatory variable (the one that may explain the other) and see whether it labels the rows or the columns.
- Percentage within each of its categories: row percentages for rows, column percentages for columns.
- Compare the percentages for one response category across the groups and find the gap in percentage points.
- Decide: a clear gap suggests an association; nearly equal percentages suggest none.
- Report in context with both percentages: “Group A were more likely to … than group B (a% compared with b%).”
Percentage within the groups of the explanatory variable.
| \(\text{region may explain watching}\) | \(\Rightarrow\) | \(\text{explanatory: region}\) |
| \(\text{region labels the columns}\) | \(\Rightarrow\) | \(\text{divide by column totals}\) |
Use column percentages, then compare the percentage who watched in each region.
| Has licence | No licence | Total | |
|---|---|---|---|
| Rural | 84 | 36 | 120 |
| Town | 54 | 96 | 150 |
Where a student lives may explain holding a licence, and it labels the rows, so use row percentages.
| \(\text{rural, licence}\) | \(=\) | \(\dfrac{84}{120}\times 100\%\) |
| \(\) | \(=\) | \(70\%\) |
| \(\text{town, licence}\) | \(=\) | \(\dfrac{54}{150}\times 100\%\) |
| \(\) | \(=\) | \(36\%\) |
| \(\text{difference}\) | \(=\) | \(70\% - 36\%\) |
| \(\) | \(=\) | \(34\text{ points}\) |
Yes. Rural students were more likely to hold a licence than town students (70% compared with 36%).
| 18–34 | 35–54 | 55 and over | Total | |
|---|---|---|---|---|
| Mainly streaming | 72 | 66 | 30 | 168 |
| Mainly free-to-air | 18 | 54 | 90 | 162 |
| Total | 90 | 120 | 120 | 330 |
Divide each streaming count by its own column total, then look for a pattern across the ages.
| \(18\text{ to }34\) | \(=\) | \(\dfrac{72}{90}\times 100\%\) |
| \(\) | \(=\) | \(80\%\) |
| \(35\text{ to }54\) | \(=\) | \(\dfrac{66}{120}\times 100\%\) |
| \(\) | \(=\) | \(55\%\) |
| \(55\text{ and over}\) | \(=\) | \(\dfrac{30}{120}\times 100\%\) |
| \(\) | \(=\) | \(25\%\) |
The streaming percentage falls as age rises (80%, 55%, 25%), so there is an association: younger adults were more likely to mainly stream.
| Volunteers | Does not | Total | |
|---|---|---|---|
| Surfers | 18 | 22 | 40 |
| Non-surfers | 99 | 121 | 220 |
The groups are different sizes, so compare percentages, not counts.
| \(\text{surfers}\) | \(=\) | \(\dfrac{18}{40}\times 100\%\) |
| \(\) | \(=\) | \(45\%\) |
| \(\text{non-surfers}\) | \(=\) | \(\dfrac{99}{220}\times 100\%\) |
| \(\) | \(=\) | \(45\%\) |
No. The same 45% of each group volunteers, so there is no association between surfing and volunteering. Sam only saw that there are more non-surfers.
Common pitfalls
Frequently asked questions
What does it mean for two categorical variables to be associated?
It means the percentages of one variable change from one category of the other variable to the next. For example, if 71% of older adults but only 38% of younger adults always wear sunscreen, age group and sunscreen use are associated.
Should I use row or column percentages?
Percentage within the categories of the explanatory variable. If the explanatory variable labels the rows, use row percentages. If it labels the columns, use column percentages.
How do you tell if there is no association in a two-way table?
Find the percentages within each group of the explanatory variable. If the percentages for the same response are about the same in every group, there is no association.
How do you describe an association from a two-way table?
Name the group that was more likely to give a response and quote both percentages, for example: rural students were more likely to hold a licence than town students (70% compared with 36%).
Does an association mean one variable causes the other?
No. An association shows the variables are related in this data, but other factors could be behind the pattern, so it does not prove cause and effect.