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.

35 minFoundation8 graded exercisesFree

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?

  1. 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.

  2. 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.

  3. 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.

  4. 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 scoreTutored: nTutored: meanNot tutored: nNot tutored: mean
below 604860.32559.2
60–694869.48667.9
70–791376.79472.7
80 and above784.37980.8
Mean exam score by prior-score band (student_scores, synthetic)

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).

Loading the interactive…
Two fictional hospitals. Toggle between the overall recovery rates and the rates within mild and severe cases.

Try this

  • Look at the overall rates first. Which hospital seems better?

  • Now split by severity. Which hospital has the higher recovery rate for mild cases? For severe cases?

  • Which hospital treats most of the severe cases? Use that to explain why the overall comparison reverses.

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

Not started

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?

Choose one

Exercise 2 · Application, difficulty 1 of 3

Tutored vs untutored

Not started

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?

Not started

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

Not started

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?

Choose one

Exercise 5 · Application, difficulty 2 of 3

Overall recovery rates

Not started

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

Not started

Two sales teams handle warm leads (existing contacts) and cold leads. Conversions last quarter:

TeamWarm leadsWarm convertedCold leadsCold converted
X422721247
Y224132549

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?

Not started

For each study, decide whether the causal claim is justified by the design, or whether only an association has been shown.

Users randomly shown a shorter sign-up form completed sign-up more often. Claim: the shorter form increases completion.
Neighbourhoods with more parks have fewer hospital admissions. Claim: parks reduce admissions.
Patients randomly assigned to a new physiotherapy programme regained mobility faster than those on standard care. Claim: the programme speeds recovery.
Employees who take more training courses get promoted sooner. Claim: training causes promotion.
Countries with higher chocolate consumption have more prize-winning scientists. Claim: chocolate improves scientific ability.

Exercise 8 · Interpretation, difficulty 3 of 3

Explain the tutoring comparison

Not started

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.

0 words

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