" Correlation isn't causation" is one of the most repeated phrases in data science and one of the least explained. Here's what each term actually means, why the confusion happens, and four specific ways it goes wrong in practice.
If you've spent any time around data, you've heard "correlation doesn't imply causation" so many times it's become background noise. But if you stopped someone and asked them to define correlation and causation separately, in plain words, a lot of people would struggle. So let's start there, before touching any of the traps.
What Is Correlation?
Correlation is simply a measure of how two things tend to move together. If one goes up and the other usually goes up too, that's a positive correlation. If one goes up while the other tends to go down, that's a negative correlation. If they seem to have nothing to do with each other, that's little to no correlation.
A simple, real example: height and shoe size are correlated. Taller people tend to have bigger feet. That's a positive correlation, and it's intuitive, but notice we haven't said anything yet about why.
Correlation is purely descriptive: it tells you two variables tend to change together, and roughly how strongly, using a number called the correlation coefficient (often written as r), which ranges from -1 (perfectly opposite) to +1 (perfectly together), with 0 meaning no relationship at all. That's the entire job of correlation: describe a pattern. It has no opinion on what's causing that pattern, or whether anything is causing it at all.
What Is Causation?
Causation is a stronger, different claim: it means one variable directly produces a change in another. There's a mechanism connecting them, and if you intervened and changed the first variable, and only that variable, the second one would change as a result.
Take a simple example: turning up your oven's temperature causes your food to cook faster. If you change the temperature, cooking time changes because of that action. There's a direct, physical mechanism (more heat transfers energy faster), and you can test it by changing nothing else and watching the result change predictably.
A useful mental test for causation: "If I could reach in and change only this one thing, would the other thing change as a result?" If yes, that's a causal relationship. If you can't actually intervene, or if changing one doesn't reliably move the other, you're probably just looking at correlation.
Why We Keep Mixing Them Up
Human brains are pattern-matching machines; we're wired to notice when two things happen together and jump to "one must be causing the other," because that instinct was useful for survival long before it was useful for data analysis. The problem is that correlation is easy to measure (a single formula gives you a number) while causation is hard to establish (it usually requires careful experiments or reasoning about mechanisms). So we default to the easy signal and treat it like the hard one.
This is exactly where the four classic traps come in; they're the specific ways a real, measurable correlation can exist without any real causation behind it.
Confounding Variables (The Third-Variable Problem)
This happens when a hidden third factor is actually driving both variables you're looking at, making them look connected to each other when they're really both just reacting independently to something else.
The classic case: ice cream sales and shark attacks both rise in summer. It's not that ice cream causes attacks, or attacks cause ice cream sales warmer weather (the confounder) independently drives more people to buy ice cream and more people into the ocean at the same time. The confounder never shows up if you only look at the two headline variables.
In real analysis work, common hidden confounders include location, income, age, and season they quietly explain relationships that look meaningful on the surface.
Reverse Causality
Sometimes the relationship is genuinely causal, just pointing the opposite direction from what you assumed. A model might show "customers who contact support more often churn more," tempting you to conclude support interactions drive churn.
Just as plausible: customers who are already unhappy and about to leave contact support more because they're frustrated. The outcome is quietly driving the presumed cause.
Reverse causality is sneaky because the correlation itself carries no signal about which direction is correct you need outside knowledge, timing data, or a controlled study to untangle it.
Coincidence (Spurious Correlations)
Given enough variables and enough time, some completely unrelated trends will line up purely by chance. This is the trap behind the famous "spurious correlations" examples; like per-capita cheese consumption tracking almost perfectly with the number of people who died tangled in their bedsheets. There is no mechanism connecting them at all. With enough random series being compared, some pair will always match closely just by luck which is why testing dozens of variables against each other without a hypothesis ("data dredging") is such a well-known danger in statistics.
Selection Bias
This trap comes from how the data was collected, not from the variables themselves. If your sample isn't representative of the population you're trying to understand, you can manufacture a statistical link that isn't real or hide one that is.
A classic case: surveying only customers who already responded to a marketing email makes that email look more effective than it is, because people who never open emails are systematically missing from the data. The relationship you're seeing was baked in by how the sample was built, not by anything the two variables are doing to each other.
So How Do You Actually Prove Causation?
If correlation alone can't do it, what can? A few real tools researchers and data teams use:
● Randomized controlled trials (RCTs): randomly split a group in two, change one variable for one group only, and compare outcomes. Randomization cancels out confounders on average, so any difference in outcome can be attributed to the variable you changed.
● Natural experiments: when you can't randomize, look for situations where something close to random chance assigned the variable anyway (like a policy that took effect in one region but not a neighboring one).
● Statistical controls: _techniques like propensity score matching or regression with control variables that try to account for known confounders mathematically, when an experiment isn't possible.
● _A believable mechanism: even strong statistical evidence is more convincing when there's a plausible, explainable reason why one thing would cause the other.
A Quick Checklist Before You Claim Causation
● Could a third factor explain both variables?
● Could the arrow of cause and effect be pointing the other way?
● How many other variables did I compare before I found this one?
● Does my sample actually represent the population I'm making claims about?
● Do I have experimental evidence, or just an observed pattern?
Why This Matters
None of this means correlation is useless a strong correlation is a great lead. It tells you where to look. The mistake isn't noticing the pattern; it's stopping there and calling it an explanation. Treat correlation as the start of an investigation, not the end of one.
"""Demonstrating why correlation does not prove causation in marketing.
Scenario:
- A company spends more on ads during the holiday season.
- Customers also buy more during the holiday season.
- Holiday demand causes both variables to increase.
- Marketing spend has no causal effect in this simulation.
"""
import numpy as np
rng = np.random.default_rng(42)
months = np.arange(24)
holiday_season = (months % 12 >= 9).astype(float)
# Holiday demand is a hidden third variable (a confounder).
marketing_spend = 10 + 20 * holiday_season + rng.normal(0, 2, size=24)
sales = 100 + 80 * holiday_season + rng.normal(0, 5, size=24)
correlation = np.corrcoef(marketing_spend, sales)[0, 1]
print(f"Correlation between marketing spend and sales: {correlation:.2f}")
print("A high correlation alone does not prove that marketing caused the sales.")
print("In this simulation, the true causal effect of marketing spend is zero.")
# Once we compare months within the same season, the misleading relationship
# largely disappears because the hidden seasonal factor is held constant.
non_holiday = holiday_season == 0
holiday = holiday_season == 1
non_holiday_correlation = np.corrcoef(marketing_spend[non_holiday], sales[non_holiday])[
0, 1
]
holiday_correlation = np.corrcoef(marketing_spend[holiday], sales[holiday])[0, 1]
print(f"Correlation in non-holiday months: {non_holiday_correlation:.2f}")
print(f"Correlation in holiday months: {holiday_correlation:.2f}")
print("To test causation, use a randomized marketing experiment or A/B test.")
Top comments (1)
The support-contacts-and-churn case is the one I see most often in real analysis, and the reason it's sticky is that both directions sound like a mechanism. What helped me separate them was looking at timing rather than level: if contact rate only climbs after usage starts dropping, the arrow is fairly obvious, while a flat pre-existing difference between cohorts points at a confounder instead of at support causing anything.
The checklist is the right takeaway, especially "how many other variables did I compare before I found this one". One habit I'd add: write down the falsifying observation before running the query — the measurement that would prove the claim wrong. Much cheaper than untangling a wrong causal conclusion after it has already made it into a decision.