EN VI

Correlation vs Causation and Simpson's Paradox With Real Numbers

By ··8 min read

Short answer

Correlation means two numbers move together. Causation means a change in one produces a change in the other. A high correlation can come from a third factor that drives both. Simpson's paradox is a related trap, where a trend in every group reverses once the groups are combined. Compare within comparable groups before you claim that something works.

In the last posts we chose metrics and defined them carefully. Even with a clean metric, a comparison can still point to the wrong conclusion. On a report with thousands of customers, two numbers that rise together tempt us to say that one causes the other. Below we look at two cases. In the first, two numbers move together for a hidden reason. In the second, the better campaign looks worse once the groups are combined.

Correlation: two numbers that move together

Take six weeks of data. Weekly orders were 100, 120, 150, 180, 210 and 240, and weekly support tickets were 20, 25, 31, 36, 44 and 49. To measure how closely they move together, we use the correlation coefficient, which runs from -1 to 1.

import statistics

orders = [100, 120, 150, 180, 210, 240]
tickets = [20, 25, 31, 36, 44, 49]

print(round(statistics.correlation(orders, tickets), 3))
# 0.998

A value of 0.998 is very close to 1, so the two series rise almost in step. That does not mean tickets bring orders. A promotion week brings more visitors, and more visitors create both more orders and more tickets. The promotion is the third factor, and the correlation alone cannot show it.

Causation needs a fair comparison

To claim that A causes B, we need two groups that are alike in everything except A. The cleanest way is an experiment where a coin flip decides who gets A. When an experiment is not possible, we compare groups that are as similar as we can make them, and we say plainly that the result is weaker evidence.

Simpson's paradox: the better campaign looks worse

Two email campaigns went to 500 customers each. Some customers were new and some were returning. The table sends holds how many emails went out and how many customers bought, per campaign and per segment. First, we compare the campaigns inside each segment.

SELECT campaign
     , segment
     , sent
     , bought
     , ROUND(bought * 100.0 / sent, 1) AS rate_pct
FROM sends
ORDER BY segment, campaign;
SegmentCampaign ACampaign B
New customers48 of 400 = 12.0%10 of 100 = 10.0%
Returning customers45 of 100 = 45.0%160 of 400 = 40.0%

Campaign A wins in both segments, 12% against 10% and 45% against 40%. Now we combine the segments.

-- WRONG: compares campaigns with different audiences
SELECT campaign
     , SUM(sent) AS sent
     , SUM(bought) AS bought
     , ROUND(SUM(bought) * 100.0 / SUM(sent), 1) AS rate_pct
FROM sends
GROUP BY campaign;
CampaignSentBoughtRate
A5009318.6%
B50017034.0%

Now B looks almost twice as good, 34.0% against 18.6%. The reason is the audience. Campaign A went 80% to new customers, who buy less often. Campaign B went 80% to returning customers, who buy more often. The combined rate compares the audiences, not the campaigns.

In most cases, the segment-level comparison is the fair one, because the segment sets how likely a customer is to buy. The table cannot tell us this. We have to know the business and decide which split matters before we read the result.

Three checks before you claim that something works

  1. Ask what else could move both numbers, and write it down.
  2. Split the comparison by the groups that change the outcome, such as new and returning customers.
  3. Compare the group sizes. If they differ a lot between the two sides, the combined rate is not a fair comparison.

Frequently asked questions

What is the difference between correlation and causation?

Correlation means two numbers move together. Causation means a change in one produces a change in the other. A third factor can make two numbers correlate without either causing the other.

What is Simpson's paradox?

Simpson's paradox is when a trend that holds in every group reverses after the groups are combined. It happens when the groups differ in size and in how likely they are to produce the outcome.

How do I avoid Simpson's paradox in a report?

Split the comparison by the groups that change the outcome, and show the group sizes next to every rate. If the segment results and the combined result disagree, report the segment results.

References

Keep learning, step by step.

Each lesson in Learn has a business context, a runnable example and a result check, so you practise this habit on real questions.