DSM
50 XP
20 minsBeginner50 XP

Correlation Is Not Causation

Across a whole summer, ice-cream sales and drowning deaths rise and fall together, almost in lockstep. So does ice cream cause drowning? Of course not — hot weather drives both. Yet this exact mistake, dressed in fancier clothes, gets made in boardrooms and headlines every single day: two numbers move together, and someone declares that one causes the other. Learning to catch this is one of the highest-leverage skills in all of data science, and it costs nothing but a moment's discipline.

What you'll learn

  • Define correlation and causation and state how they differ
  • Explain why correlation alone can't prove causation
  • Identify a confounder — a hidden third cause behind two variables
  • Name the main alternatives to 'A causes B' for a correlation
  • Recognise that a controlled experiment is how causation is established

What

Correlation means two variables tend to move together — when one goes up, the other tends to go up (or down). Causation means one variable actually makes the other change. Correlation is a pattern you can measure; causation is a claim about mechanism, and the two are not the same.

Why

Confusing them leads to expensive, embarrassing, sometimes dangerous decisions: launching features that don't work, cutting things that were actually helping, or believing a headline that has the story backwards. Spotting the gap between 'moves together' and 'causes' is what makes your analysis trustworthy.

Where it's used

Every A/B test interpretation, every 'this metric drives that metric' claim, every health or economics headline. Product, marketing, medicine, and policy all live or die on getting this distinction right.

Where this runs in production

NetflixCorrelation isn't enough to ship

Heavy viewers also renew more — but that doesn't prove watching causes renewal; committed fans do both. Netflix runs controlled experiments precisely because correlation alone can't justify a product decision.

Public healthA famous confounder

Countries with more televisions per person have higher life expectancy. TVs don't extend life — national wealth buys both TVs and better healthcare. Wealth is the confounder hiding behind the correlation.

Booking.comExperiments over correlations

Rather than trust that a change 'correlates' with more bookings, the company runs thousands of randomised experiments a year — the only reliable way to turn a correlation into a causal claim.

Theory

The core ideas, in plain language.

Correlation is an observation: two variables tend to change together. It can be positive (both rise together, like height and shoe size) or negative (one rises as the other falls, like temperature and heating bills). Causation is a stronger, different claim: that changing one variable actually forces the other to change. You can measure correlation directly from data; causation you have to argue for.
Key Concept
The core distinction

Correlation = 'these two move together' — a measurable pattern. Causation = 'this one makes the other change' — a claim about mechanism. Every correlation has several possible explanations, and 'A causes B' is only one of them. Finding a correlation is the start of an investigation, never the end.

When you see A and B correlated, there are at least four explanations, and only the first is the tempting one: (1) A causes B. (2) B causes A — the arrow runs the other way. (3) A hidden third factor C causes both — a confounder. (4) It's coincidence — with enough variables, some will line up by pure chance.
Analogy: The confounder is the puppeteer

Watch two puppets on a stage bob up and down in perfect sync and you might think one is pushing the other. Look up and you see a single puppeteer working both strings — neither puppet moves the other; the hidden hand moves both. A confounder is that puppeteer. Ice cream and drowning are the puppets; summer heat is the hand pulling both strings. The whole skill is learning to look up for the puppeteer instead of blaming one puppet.

# Observed across a city, month by month:
ice_cream_sales   ↑↑   correlated with   drownings ↑↑

# Tempting:   ice_cream  ->  drownings   (absurd)
# Reality:    summer_heat -> ice_cream
#             summer_heat -> swimming -> drownings
# 'summer_heat' is the CONFOUNDER driving both.

The correlation between ice cream and drowning is completely real and completely non-causal. A confounder (summer heat) independently drives both, manufacturing a pattern between two things that have no direct link at all.

'Reverse causation' — explanation (2) — is subtler and catches experts. A study finds that people who use fitness apps are fitter. Does the app make them fit, or do already-fit people choose to use fitness apps? The correlation is identical either way; the arrow's direction changes the entire conclusion, and the data alone can't tell you which way it points.
Watch out
'With enough data, coincidences are guaranteed'

If you compare enough pairs of variables, some will correlate strongly by sheer chance — the number of films an actor appears in and the yearly cheese consumption of a country, and so on. These 'spurious correlations' look impressive and mean nothing. A strong correlation with no plausible mechanism is a red flag, not a discovery.

The practical habit is a single reflex. Whenever you meet a claim that 'X drives Y', pause and ask the four questions: Could Y drive X? Could a hidden C drive both? Could it be coincidence? Only after those survive scrutiny — ideally with an experiment — does 'X causes Y' earn the right to be stated. That pause is the entire lesson.
Visual Learning

See the concept, then explore it.

You Found a Correlation — Now What?

Click each explanation to see how it works and how to test it. A correlation between A and B is consistent with all four — your job is to rule out the impostors before claiming cause.

Worked Examples

Watch it built up, one line at a time.

Very EasyCorrelation or causation?

Someone says: 'Umbrella sales and rainfall are correlated, so buying umbrellas causes rain.'

Step 1 of 2

Start by checking the direction. Does buying an umbrella make the sky rain? No mechanism could work that way — the arrow is backwards.

Code
01claim = 'umbrellas -> rain'
Practice Coding

Your turn — write the code.

Your task

This is a reasoning drill in code form. For each observed correlation, decide the best explanation from a fixed list and fill it in. No math — you're practising the four-question reflex. Run it to check your labels.

Expected output
confounder
reverse
coincidence

Write your solution in the editor on the right, then hit Run.

Exercises

Prove it. Reach 80% to complete the lesson.

Mastery Gate0% / 80% required
Easy0/2 solved

What is the difference between correlation and causation?

What is a confounder?

Medium0/3 solved

A study finds people who eat breakfast weigh less. Which is the safest conclusion?

ScenarioA marketing lead notices that customers who receive the company's email newsletter spend more, and wants to email everyone to increase spending.

What's the flaw in this reasoning?

Two lists move in the same direction. Print 'positive' if both increase together (each list sorted ascending), else 'not positive'. Given x and y already sorted ascending, this is a simple check: print 'positive'. (The point is recognising co-movement, not computing a coefficient.)

Detects co-movement:Confirms both lists increase together.
Output:Prints 'positive' since both x and y rise together.
Hard0/1 solved
ScenarioAn analyst wants to prove that a new onboarding tutorial causes higher user activation. They have observational data showing tutorial-completers activate more often.

What's the most reliable way to establish causation here?

Complete 80% more exercises to unlock.
Interview Prep

How this shows up in real interviews.

Explain the difference between correlation and causation with an example.

Show model answer

Correlation means two variables tend to move together — it's a pattern I can measure directly from data. Causation means one variable actually makes the other change, which is a much stronger claim about mechanism. The classic example is that ice-cream sales and drowning deaths are strongly correlated across the year, but ice cream plainly doesn't cause drowning — hot summer weather independently drives both. That example captures why the distinction matters: a correlation can be completely real and completely non-causal. In practice I treat a correlation as the start of an investigation, not a conclusion. It tells me two things are worth looking at together, but before I claim one causes the other I have to rule out reverse causation, a confounding third variable, and plain coincidence.

You find a strong correlation between using a product feature and higher retention. Why can't you conclude the feature causes retention, and what would you do?

Show model answer

I can't conclude causation because the users who adopted the feature chose to — this is observational, self-selected data. The most likely problem is confounding: highly engaged users are both more likely to discover and use the feature and more likely to retain anyway, so engagement drives both and inflates the apparent effect. There's also possible reverse causation, where users who were already going to stick around are the ones who explore features. The correlation looks the same under all of these. To actually establish causation I'd run a randomised experiment — an A/B test — where I randomly assign some users to get the feature (or have it defaulted on) and compare retention against a control group. Randomisation balances engagement and every other confounder across the two groups on average, so a retention difference can be credibly attributed to the feature itself. Until I have that, I'd report the relationship as a correlation and explicitly flag that it's not yet causal.

What are the possible explanations for an observed correlation between two variables A and B, and how do you tell them apart?

Show model answer

There are four broad explanations. First, A genuinely causes B. Second, B causes A — reverse causation, where the arrow runs the opposite way to what I assumed. Third, a confounder C independently causes both A and B, creating a link between them with no direct connection at all. Fourth, it's coincidence — with enough variables compared, some correlate by pure chance. Telling them apart starts with reasoning: I ask whether each direction has a plausible mechanism, and I brainstorm candidate confounders — is there some third factor, like wealth, age, motivation, or seasonality, that could drive both? A strong correlation with no believable mechanism points toward coincidence or a spurious relationship. But reasoning only narrows it down; the decisive tool is a randomised controlled experiment, because randomisation balances all confounders — even ones I didn't think of — so that a remaining difference is attributable to the treatment. When an experiment isn't possible, I stay tentative and lean on careful confounder control, and I'm explicit that the causal claim is uncertain.

Common Mistakes to Avoid

1) Jumping from 'A and B move together' straight to 'A causes B' without ruling out the alternatives. 2) Ignoring reverse causation — assuming the arrow points the way you expected. 3) Forgetting to hunt for a confounder, the hidden third cause behind both variables. 4) Treating a strong correlation as proof; strength without a plausible mechanism is often coincidence. 5) Making costly decisions from observational data when a quick randomised test could settle the question.

Ask the AI Tutor

Try these prompts in the AI Tutor panel: • 'Give me a correlation and ask me to name a possible confounder.' • 'ELI5: reverse causation with a fresh example.' • 'Quiz me: for each headline, is it correlation or causation?' • 'Explain how a randomised experiment rules out confounders.' • 'Interview mode: I claim a feature boosts retention — challenge my reasoning.'

Glossary

Correlation — a measurable tendency of two variables to move together (positive or negative). Causation — one variable actually making another change. Confounder — a hidden third factor that drives both correlated variables. Reverse causation — the causal arrow running opposite to what's assumed (B causes A). Spurious correlation — a real-in-the-sample correlation with no genuine mechanism; coincidence. Randomised controlled experiment (A/B test) — randomly assigning a treatment to isolate a causal effect. Control group — the subjects who don't receive the treatment, used for comparison.

Recommended Resources

• Site: Tyler Vigen's 'Spurious Correlations' — a gallery of absurd real correlations that makes the lesson stick. • Read: the opening of any explainer on randomised controlled trials to see how experiments break confounding. • Practice: find a 'X boosts Y' headline this week and name one confounder that could explain it instead. • Next in DSM: you now have the full Foundations toolkit — reading data, quality, bias, and statistics. Next you'll put it all together on a real dataset in your first guided project.

Recap

✓ Correlation is a measurable pattern of two variables moving together; causation is a claim that one makes the other change. ✓ A correlation has four possible explanations: A→B, B→A (reverse), a confounder C→both, or coincidence. ✓ A confounder is a hidden third cause that drives both variables — like summer heat behind ice cream and drowning. ✓ A strong correlation with no plausible mechanism is likely spurious, not a discovery. ✓ Causation is established with a randomised controlled experiment, which balances confounders across groups. Next up: your first Foundations Project. You've now built the whole Foundations toolkit — reading data, dataset anatomy, data quality, bias, and core statistics. Next you'll act like a junior data scientist: take a real dataset from first glance to a single honest, defensible insight.

scratchpad — preview this lesson's challenge anytime
confounder_check.pyPython
Ready
Output

Run your code to see the output here.