Skip to content
Tutorials Center
My learning

Topics

Lesson 2 of 37 ยท Getting Started

Correlation vs Causation

Understand why correlation does not imply causation: the three explanations for an association (cause, reverse cause, common cause) with runnable simulations.

"Correlation is not causation" is the best-known sentence in statistics and also one of the most misunderstood. It does not mean correlation is useless. It means a correlation alone does not tell you why two things move together, and the reason decides whether an intervention will work.

What correlation measures

The correlation coefficient r summarizes how strongly two variables move together in a straight-line sense, from -1 to +1. It says nothing about direction of influence.

Python Computing a correlation

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

A strong r here means study hours and score go together. It does not by itself prove that hours cause higher scores.

Three reasons two variables are associated

When X and Y are associated, at least one of these stories is true, and often more than one.

flowchart LR
  subgraph A["1. X causes Y"]
    X1["X"] --> Y1["Y"]
  end
  subgraph B["2. Y causes X"]
    Y2["Y"] --> X2["X"]
  end
  subgraph C["3. Common cause Z"]
    Z3["Z"] --> X3["X"]
    Z3 --> Y3["Y"]
  end

Direct cause, reverse cause and a common cause (confounder) all produce a correlation.

There are also two accidents: pure chance (especially when you search many pairs) and selection (the data you see were filtered, see selection and collider bias).

Common cause: ice cream and sunburn

Hot weather raises both ice cream sales and sunburn cases. Neither causes the other.

Python A common cause creates a correlation

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

Comparing days with similar temperature makes the link nearly vanish. Holding the common cause fixed is called conditioning or adjusting, the central tool of the next lessons.

Reverse causation

Do people who sleep badly become anxious, or do anxious people sleep badly? Data collected at one point in time cannot tell the arrows apart. Time order helps (a cause precedes its effect) but is not enough, because feedback loops and anticipation exist. A firm that expects a hot summer may hire seasonal staff before sales rise: the later outcome "causes" the earlier action through expectations.

Chance correlations

Search through enough variables and some will correlate by luck.

Python Spurious correlations from searching

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

With few observations and many candidates, "impressive" correlations appear from nothing. This is why hypothesis tests and out-of-sample checks matter.

What would make us believe a cause?

Researchers (notably Bradford Hill in epidemiology) list supporting clues: the cause comes first, the effect grows with the dose, the association is strong and repeats in different settings, and a plausible mechanism exists. These raise confidence but do not prove anything. The modern route is more explicit: write down your assumptions about how the data arose and show that, under those assumptions, the effect can be computed. See causal DAGs.

Whenever you see an association, ask three questions: Could the arrow run the other way? Is there a third variable driving both? Could the sample itself have been filtered?

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. Which is NOT a possible explanation for a correlation between X and Y?

    A correlation never proves a mechanism; it can arise from the first three stories, from chance or from selection.
  2. 2. In the temperature example, why did the correlation shrink among days of similar temperature?

    Conditioning on the common cause blocks the path that created the association.
  3. 3. Searching 200 unrelated series for a match with a target of 12 points will probably find:

    Many comparisons with small samples produce large chance correlations.
  4. 4. A correlation of 0 between X and Y means X has no causal effect on Y.

    Opposing influences can cancel, and correlation only measures linear association.

Summary

  • Correlation shows association, not the direction or reason for it.
  • Three structures create associations: X causes Y, Y causes X, or a common cause.
  • Chance and selection can also create correlations.
  • Adjusting for a common cause can remove a misleading association.

Next: Causal Questions and Estimands