Track 1 · Statistical Thinking · Lesson 8 of 10
Confounding and causation
Identify confounding variables, explain why association does not establish causation, and see how comparing like with like changes a conclusion.
Students who attended an after-school tutoring programme scored lower on the final exam than students who did not. Should the school district scrap tutoring? Not before asking who was sent to tutoring in the first place.
Two variables are associated when knowing one tells you something about the other: tutored students tend to have lower scores; districts with more parks tend to have fewer hospital admissions. Association is a fact about the data. Causation — changing one variable would change the other — is a much stronger claim.
The most common reason an association misleads is a confounding variable: a third variable that is related to the explanatory variable and affects the response, so that its effect gets mixed up with the effect we are trying to study. A confounder that was not measured is often called a lurking variable.
Worked example
The tutoring paradox (synthetic data)
In the student_scores dataset, 116 of 400 students received tutoring. Their mean exam score was 67.3, against 72.3 for the 284 untutored students. Does tutoring lower scores?
Who was tutored? Tutoring was offered mainly to students who had struggled. Tutored students' mean prior-year score was 60.5, against 73.0 for untutored students.
Is prior score a confounder? It is related to the explanatory variable (weaker students were more likely to be tutored) and it affects the response (prior attainment predicts this year's exam). Yes.
Compare like with like. Group students by prior score and compare within each band (table below). In every band, tutored students scored higher than untutored students with similar prior scores.
Conclusion. The raw comparison mixed the effect of tutoring with the effect of starting lower. Within comparable groups the association reverses. Because this is still observational, other differences may remain — but the evidence no longer suggests tutoring harms.
No: the raw gap is driven by the confounder prior score.
| Prior score | Tutored: n | Tutored: mean | Not tutored: n | Not tutored: mean |
|---|---|---|---|---|
| below 60 | 48 | 60.3 | 25 | 59.2 |
| 60–69 | 48 | 69.4 | 86 | 67.9 |
| 70–79 | 13 | 76.7 | 94 | 72.7 |
| 80 and above | 7 | 84.3 | 79 | 80.8 |
Comparing within groups that share the same value of a suspected confounder is called stratifying or controlling for that variable. Regression (Track 9) does the same job with many variables at once. But controlling only works for confounders you have measured. That is why randomised experiments are so valuable: random assignment balances all confounders, measured or not (see Observational studies and experiments).
When an association reverses direction after stratifying, it is called Simpson's paradox. In the hospital data, Hospital A has the higher recovery rate among mild cases (95% vs 90%) and among severe cases (75% vs 70%), yet the lower rate overall (79% vs 86%) — because 400 of its 500 patients were severe cases, against 100 of 500 at Hospital B.
Quick check
Cities with more fire stations have more fires. What is the most plausible explanation?
Exercises
The lesson is complete when every exercise is answered correctly. Hints are free; viewing a worked solution before solving means the exercise won't count towards mastery.
0 of 8 exercises correct (not saved — sign in to keep your progress)
Exercise 1 · Practice, difficulty 1 of 3
Find the confounder
A retail chain finds that branches whose staff received more training hours last year had higher sales per employee. Which variable is the most plausible confounder?
Exercise 2 · Application, difficulty 1 of 3
Tutored vs untutored
In student_scores, compute the mean exam_score of tutored students and of untutored students. Give both to 2 decimal places.
Data: student_scores · Open in the lab to explore and calculate.
Exercise 3 · Application, difficulty 2 of 3
Did the groups start equal?
Now compute the mean previous-year score (prior_score) for tutored and untutored students (2 decimal places). Did the two groups start out equal?
Data: student_scores · Open in the lab to explore and calculate.
Exercise 4 · Interpretation, difficulty 2 of 3
What the tutoring data show
Tutored students scored about 5 points lower on the exam, but they had started about 12.6 points lower on the previous year's test, and within every prior-score band tutored students scored higher. Which conclusion is best supported?
Exercise 5 · Application, difficulty 2 of 3
Overall recovery rates
The hospital_outcomes_summary table gives, for each hospital and severity, the number of patients and the number who recovered. Compute each hospital's overall recovery rate (all patients combined), as a percentage to 1 decimal place.
Data: hospital_outcomes_summary · Open in the lab to explore and calculate.
Exercise 6 · Practice, difficulty 2 of 3
Two sales teams
Two sales teams handle warm leads (existing contacts) and cold leads. Conversions last quarter:
| Team | Warm leads | Warm converted | Cold leads | Cold converted |
|---|---|---|---|---|
| X | 42 | 27 | 212 | 47 |
| Y | 224 | 132 | 54 | 9 |
Compute each team's overall conversion rate (all leads combined), as a percentage to 1 decimal place.
Exercise 7 · Practice, difficulty 2 of 3
Is a causal claim justified?
For each study, decide whether the causal claim is justified by the design, or whether only an association has been shown.
Exercise 8 · Interpretation, difficulty 3 of 3
Explain the tutoring comparison
A school board member says: “Tutored students scored 5 points lower than the others, so the tutoring programme is a waste of money.” In two to four sentences, explain to the board why this conclusion is not justified and what comparison would be fairer.
What you can now do
- Distinguish association from causation
- Identify a confounder as a variable related to both the explanatory and the response variable
- Combine strata correctly and recognise Simpson's paradox
- Compare like with like by stratifying, and explain why randomisation handles unmeasured confounders