Correlation, causation, and data bias
Learning objectives
- distinguish correlation from causation;
- identify a possible confounding variable;
- describe selection, measurement, and missing-data bias; and
- write a conclusion that matches the evidence.
Association is not automatically cause
Two variables are associated when they change together more often than expected by chance. That does not prove that one causes the other. Possible explanations include:
- Reverse direction: the outcome affects the measured input.
- Confounding: another variable affects both.
- Selection bias: the sample does not represent the population.
- Measurement bias: the measurement method differs between groups.
- Chance: a small sample creates a temporary pattern.
For example, ice-cream sales and sunburns may increase together because hot, sunny weather affects both. Ice cream is not necessarily causing sunburn.
A small numerical example
import numpy as np
study_minutes = np.array([10, 20, 30, 40, 50])
quiz_score = np.array([62, 65, 70, 72, 76])
correlation = np.corrcoef(study_minutes, quiz_score)[0, 1]
print(round(correlation, 2))
The correlation summarizes a pattern in these observations. It does not show whether studying caused the scores, whether prior knowledge affected both, or whether the pattern would hold for another group.
Bias questions
Before making a claim, ask:
- Who was included and who was missing?
- How were the variables measured?
- Were the same definitions and units used for everyone?
- Did the collection process change over time?
- Are missing values concentrated in a group?
- Could a third variable explain the relationship?
- Does the sample support the population in the conclusion?
Practice
Choose a public dataset and write two conclusions:
- one conclusion that is directly supported by an observation; and
- one tempting causal conclusion that the data cannot establish.
For the second, name the additional experiment or information that would be needed.
Checkpoint
Explain why a strong correlation can still be misleading. Include one confounding variable and one sampling concern.