Associations between two categorical variables
Learn to spot an association between two categorical variables in Year 12 VCE General Mathematics. Are younger Melburnians more likely to catch the train into the city than older ones? A table of raw counts cannot tell you, because the age groups are different sizes. Percentages within each group turn the counts into a fair comparison.
You will practise finding column percentages in two-way frequency tables, drawing and reading percentage segmented bar charts, and comparing the same response across groups. You will decide whether an association exists and describe it in a sentence that quotes both percentages, before moving on to comparing a numerical variable across groups.
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 students in Victoria shows how to find column percentages in a two-way table, draw and read percentage segmented bar charts, and describe an association clearly in context.
A two-way frequency table (also called a contingency table) counts how many individuals fall into each combination of two categorical variables. Because the groups being compared are usually different sizes, the counts are turned into percentages within each category of the explanatory variable. With the explanatory variable across the top, these are column percentages: divide each count by its column total. (If a table puts the explanatory variable in the rows, use row percentages instead.)
A percentage segmented bar chart shows these percentages. There is one bar for each category of the explanatory variable, every bar is \(100\%\) tall, and each bar is split into segments for the categories of the response variable. The size of a segment is the reading at its top minus the reading at its bottom.
Two categorical variables are associated when the percentage for the same response category changes noticeably from one bar (or column) to the next. If the percentages are about the same in every group, there is no association.
With the explanatory variable in the columns:
Reading a segment of a percentage segmented bar chart:
Turning a percentage back into a count:
How to identify and describe an association
- Identify the explanatory variable and check whether it labels the columns (usual) or the rows.
- Find the percentages within each of its categories: divide by the column totals (or row totals if it labels the rows).
- Draw or read the chart: one bar per explanatory category, each bar \(100\%\), segments for the response categories. Segment size = top reading minus bottom reading.
- Compare the percentages for one response category across the groups.
- Decide and describe: a clear difference means an association; nearly equal percentages mean no association. Name the group that was more likely and quote both percentages.
| Type of lesson | ||
|---|---|---|
| Group lessons | Private lessons | |
| Stood up | \(52\) | \(34\) |
| Did not stand up | \(28\) | \(6\) |
| Total | \(80\) | \(40\) |
Type of lesson labels the columns, so divide by the column totals.
| \(\text{Group}\) | \(=\) | \(\dfrac{52}{80}\times 100\%\) |
| \(\) | \(=\) | \(65\%\) |
| \(\text{Private}\) | \(=\) | \(\dfrac{34}{40}\times 100\%\) |
| \(\) | \(=\) | \(85\%\) |
| \(\text{difference}\) | \(=\) | \(85\% - 65\%\) |
| \(\) | \(=\) | \(20 \text{ percentage points}\) |
(a) 65% of group-lesson beginners and 85% of private-lesson beginners stood up. (b) Yes. Private-lesson beginners were more likely to stand up (85% compared with 65%). The raw counts (52 and 34) would suggest the opposite, because the groups are different sizes.
Monthly is the middle segment. Read the scale at its bottom and at its top, then subtract.
| \(\text{bottom of Monthly (Year 11)}\) | \(=\) | \(40\%\) |
| \(\text{top of Monthly (Year 11)}\) | \(=\) | \(75\%\) |
| \(\text{Monthly}\) | \(=\) | \(75\% - 40\%\) |
| \(\) | \(=\) | \(35\%\) |
35% of the Year \(11\) students use the library monthly. \(75\%\) is the reading at the top of the segment, not its size.
| City | |||
|---|---|---|---|
| Shepparton | Mildura | Bendigo | |
| Yes | \(54\) | \(42\) | \(24\) |
| No | \(36\) | \(98\) | \(56\) |
| Total | \(90\) | \(140\) | \(80\) |
Divide every count by its column total; each column then adds to \(100\%\).
| \(\text{Shepparton, yes}\) | \(=\) | \(\dfrac{54}{90}\times 100\%\) |
| \(\) | \(=\) | \(60\%\) |
| \(\text{Mildura, yes}\) | \(=\) | \(\dfrac{42}{140}\times 100\%\) |
| \(\) | \(=\) | \(30\%\) |
| \(\text{Bendigo, yes}\) | \(=\) | \(\dfrac{24}{80}\times 100\%\) |
| \(\) | \(=\) | \(30\%\) |
The “No” percentages are \(40\%\), \(70\%\) and \(70\%\).
(c) There is an association between city and riding to work: Shepparton workers were more likely to ride (60%) than workers in Mildura or Bendigo (30% in each).
Compare the Passed segments, then use count = percentage × group total.
| \(\text{Morning passed}\) | \(=\) | \(72\%\) |
| \(\text{Afternoon passed}\) | \(=\) | \(70\%\) |
| \(\text{afternoon passes}\) | \(=\) | \(70\% \times 250\) |
| \(\) | \(=\) | \(0.7 \times 250\) |
| \(\) | \(=\) | \(175\) |
(a) No. The pass rates (72% and 70%) are almost the same, so the result does not depend on the session. (b) 175 people passed.
Common pitfalls
Frequently asked questions
What does it mean for two categorical variables to be associated?
It means the percentage for a response category changes from one category of the explanatory variable to the next. If 65% of young people but only 20% of older people take the train, age group and way of travelling are associated.
Should I use row or column percentages?
Use percentages within the categories of the explanatory variable. When it labels the columns, divide by the column totals; when it labels the rows, divide by the row totals.
How do you read a percentage segmented bar chart?
Each bar is 100%. Find the reading at the top and bottom of a segment and subtract to get its percentage. Compare the same segment across the bars.
How do you tell if there is no association?
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 between two categorical variables?
Name the group that was more likely to give a response and quote both percentages, for example: private-lesson beginners were more likely to stand up than group-lesson beginners (85% compared with 65%).
Does an association mean one variable causes the other?
No. An association shows the variables are related in this data, but other factors could explain the pattern.