Math & Statistics

Correlation vs Causation

Distinguishing statistical association from true cause-and-effect relationships.

🟢 beginner4 min readcausality
Correlation vs Causation is a foundational distinction in data science and empirical inference. Correlation measures linear statistical association between variables P(Y | X), while Causation measures the intervention effect P(Y | do(X)) of changing X directly. Correlation does not imply causation due to Spurious Correlations, Reverse Causality, and Unobserved Confounders.

The Core Distinction

Every data science student learns the mantra: "Correlation does not imply Causation."

Mathematically, the difference is defined using Judea Pearl's do-calculus:

┌──────────────────────────┬──────────────────────────┐
│ 1. CORRELATION           │ 2. CAUSATION             │
├──────────────────────────┼──────────────────────────┤
│ Observational: P(Y | X). │ Interventional: P(Y | do(X))
│ "When I OBSERVE that     │ "When I ACTIVELY FORCE   │
│ X is high, what is Y?"   │ X to change, how does Y  │
│ Passive co-occurrence.   │ change as a result?"     │
└──────────────────────────┴──────────────────────────┘

Why Correlation Does Not Equal Causation

When two variables $X$ and $Y$ move together in data ($\text{Corr}(X, Y) > 0$), four distinct structural scenarios could explain the association:

  1. TRUE CAUSATION:         X ──────────────────────────► Y   (X directly causes Y)
  2. REVERSE CAUSALITY:      Y ──────────────────────────► X   (Y actually causes X!)
  3. CONFOUNDING VARIABLE:   Z ──────► X   and   Z ──────► Y   (Lurking Z causes BOTH X and Y!)
  4. SPURIOUS CORRELATION:   Coincidence in finite sample data (e.g. US US highway deaths vs lemon imports).

Classic Spurious Correlation Example

Dataset shows a strong positive correlation between Ice Cream Sales ($X$) and Drowning Deaths ($Y$).

Does eating ice cream cause drowning? No!

A third hidden Confounding VariableSummer Temperature ($Z$) — causes both higher ice cream sales and more people going swimming.

                         SUMMER TEMPERATURE (Z)
                         (Confounding Variable)
                         ╱                    ╲
                        ▼                      ▼
  ICE CREAM SALES (X) ◄- - - - Spurious - - - -► DROWNING INCIDENTS (Y)

How to Prove Causation

To prove a true causal link between intervention $X$ and outcome $Y$:

┌──────────────────────────┬──────────────────────────┬──────────────────────────┐
│ A. RANDOMIZED A/B TESTS  │ B. NATURAL EXPERIMENTS   │ C. CAUSAL INFERENCE DAGs │
├──────────────────────────┼──────────────────────────┼──────────────────────────┤
│ Randomly assign users to │ Exploit policy changes,  │ Control for confounders  │
│ Control or Treatment.    │ geographical borders, or │ explicitly using Backdoor│
│ Gold Standard!           │ instrumental variables.  │ Criterion adjustment.    │
└──────────────────────────┴──────────────────────────┴──────────────────────────┘
  1. Randomized Controlled Trials (RCTs / A/B Testing): Randomly assigning users to Group A (Control) or Group B (Treatment) breaks the link between confounding variables and treatment assignment ($P(Z \to X) = 0$).
  2. Observational Causal Inference: When RCTs are impossible (e.g. studying smoking impact on lung health), use Causal DAGs and Propensity Score Matching to control for confounders explicitly.

Say this out loud

Correlation measures passive statistical co-occurrence P(Y|X). Causation measures the interventional effect P(Y | do(X)) of changing X directly. Correlation fails to imply causation due to confounding variables, reverse causality, and spurious noise. True causation is proven via Randomized Controlled Trials or observational causal inference adjustments.

Followups to expect

  1. What is Granger Causality? A statistical hypothesis test that checks whether past values of time series $X$ improve forecasting predictions of time series $Y$ beyond past values of $Y$ alone (measures predictive precedence rather than true physical causation).
  2. What is the Backdoor Criterion in Causal DAGs? A graphical rule for identifying a set of confounder variables $Z$ that, when blocked via conditioning, isolates the true causal effect of $X$ on $Y$.

Check yourself

Question 1 of 3

What fundamental distinction separates statistical Correlation P(Y | X) from Causal Effect P(Y | do(X))?

More in Math & Statistics

See all →
Bayes’ Theorem4 minCentral Limit Theorem4 minLaw of Large Numbers4 min