Variable Relationships › Causation vs. Correlation: A Critical Distinction
Machine Learning from ScratchAll chapters Variable Relationships › Causation vs. Correlation: A Critical DistinctionOne section · Sections in this chapter7 / 11 ↓
Reading tools Definitions & inline links
Choose your expertise level to adjust how many terms are explained. Beginners see more tooltips, experts see fewer to maintain reading flow. Hover over underlined terms for instant definitions.
Article links
Make inline references clickable
Perhaps the most important lesson in studying variable relationships is understanding the difference between correlation and causation. Correlation tells us that two variables move together, but it does not tell us whether one causes the other. This distinction is fundamental to sound statistical reasoning and prevents serious errors in interpretation and decision-making.
When we observe a correlation between variables and , several scenarios could explain the relationship. First, might cause . Second, might cause (reverse causation). Third, both and might be caused by a third variable that we haven't measured (confounding). Fourth, the correlation might be purely coincidental, especially when examining many variable pairs (spurious correlation). Without additional information or careful study design, we cannot determine which scenario applies.
Classic examples illustrate the danger of conflating correlation with causation. Ice cream sales and drowning deaths are positively correlated across months, but neither causes the other: both increase during summer when weather is warm. The number of firefighters at a scene correlates with fire damage, but firefighters don't cause damage: larger fires require more firefighters and cause more damage. These examples seem obvious, but similar logical errors occur frequently in data analysis when domain knowledge is insufficient or causal reasoning is neglected.
Establishing causation requires more than observing correlation. Randomized controlled experiments give the gold standard by randomly assigning subjects to treatment and control groups. When experiments are infeasible, causal inference methods such as instrumental variables, regression discontinuity designs, or difference-in-differences can help under specific assumptions. Longitudinal data showing that changes in precede changes in give suggestive evidence, though temporal precedence alone doesn't prove causation. Strong domain theory explaining a plausible causal mechanism strengthens causal claims.
This distinction has practical consequences. In policy decisions, prescribing interventions based on correlations without understanding causation can be ineffective or harmful. In business, optimizing for correlated metrics rather than causal drivers may waste resources. In science, publishing correlations as causal claims erodes credibility and misinforms the public. Approaching correlations with healthy skepticism and asking "What other factors might explain this relationship?" and "What evidence would demonstrate causation rather than mere association?" helps avoid these pitfalls.
The following example illustrates how a confounding variable can create a spurious correlation between two variables that have no direct causal relationship.

