Association between categorical variables

Lessons and exercises follow the school system and stay in its language.Les leçons et les exercices suivent le système scolaire et restent dans sa langue.Lektionen und Übungen folgen dem Schulsystem und bleiben in seiner Sprache.

About this lesson

Algebra I › Two-variable statistics

To save a PDF, choose “Save as PDF” in the print dialog.

Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits

Association between categorical variables

Two-variable statistics. two-way tables, scatter plots, line of best fit, residuals, correlation coefficient

Warm-up

Three quick questions from earlier lessons.

  1. A survey asked 145 people whether they exercise weekly. Under 30: 22 yes, 43 no. Age 30 or over: 27 yes, 53 no. What proportion of the under-30s exercise weekly?
  2. A survey asked 124 people whether they exercise weekly. Under 30: 21 yes, 50 no. Age 30 or over: 31 yes, 22 no. What proportion of all the people exercise weekly?
  3. A survey asked 140 people whether they exercise weekly. Under 30: 47 yes, 17 no. Age 30 or over: 37 yes, 39 no. What proportion of all the people are under 30 and exercise weekly?

Discover

70% of students who sleep 8+ hours passed a test, and 40% of those who sleep less passed. Is there an association between sleep and passing?

  1. Yes, the pass rates differ
  2. We cannot tell without an experiment

Key idea

Compare conditional distributions.

Two categorical variables are associated if the conditional distribution of one differs across the groups of the other. If the conditional proportions are all equal, there is no association. Association in observational data does not show causation.

Worked example

Of 50 phone users, 30 sleep badly; of 50 non-users, 10 sleep badly.

60% vs 20% sleep badly
Within each group.
Association between phone use and sleep
A big difference.
It does not prove phones cause bad sleep
Observational data.

Your turn, guided

Your turn: the difference in proportions (users − non-users).

0.40.4
0.6 − 0.2.

Practice ★

  1. Of 40 drivers who texted, 30 had a near-miss; of 40 who did not text, 10 had one. Is there an association between texting and near-misses in these data?
    1. Yes: 75% of texters vs 25% of non-texters had a near-miss
    2. No: both groups have 40 drivers
    3. Yes, and it proves texting causes near-misses
  1. In a school, 50 of 125 girls and 100 of 250 boys walk to school. What does this suggest?
    1. No association: 40% of each group walks
    2. Boys are more likely to walk: 100 > 50
    3. Girls are more likely to walk

Watch out!

Practice ★★

  1. A survey asked 135 people whether they exercise weekly. Under 30: 44 yes, 40 no. Age 30 or over: 18 yes, 33 no. Find the proportion of under-30s who exercise minus the proportion of those 30 or over who exercise.
  2. A survey asked 163 people whether they exercise weekly. Under 30: 45 yes, 37 no. Age 30 or over: 48 yes, 33 no. Find the proportion of under-30s who exercise minus the proportion of those 30 or over who exercise.

Exit ticket

Three questions to check you have got it.

  1. A survey asked 135 people whether they exercise weekly. Under 30: 44 yes, 40 no. Age 30 or over: 18 yes, 33 no. Find the proportion of under-30s who exercise minus the proportion of those 30 or over who exercise.
  2. A survey asked 163 people whether they exercise weekly. Under 30: 45 yes, 37 no. Age 30 or over: 48 yes, 33 no. Find the proportion of under-30s who exercise minus the proportion of those 30 or over who exercise.
  3. A survey asked 112 people whether they exercise weekly. Under 30: 28 yes, 48 no. Age 30 or over: 13 yes, 23 no. Find the proportion of under-30s who exercise minus the proportion of those 30 or over who exercise.

Summary card

Association

  • Compare conditional proportions across groups.
  • Different: associated. Equal: not associated.

Watch out: association is not causation; counts are not rates.

One more step is optional: a challenge. Try it, or finish the lesson now.

Challenge ★★★

  1. People were asked if they exercise weekly. Under 30: 37 yes, 28 no. Age 30 or over: 31 yes, 46 no. Of the people who said yes, what fraction are under 30?
Sources and credits

Written with this source as a starting point:

sedifier rewrote the text and added its own examples and exercises.

Written with AI assistance; every answer is checked by our math engine. Not yet reviewed by a teacher.

This lesson: CC BY-SA 4.0, © sedifier · All credits