Tabellab

Correlation vs Causation: Confounding & Simpson's Paradox

Lesson 1 of 20Lab

All lessons
  1. Correlation vs Causation: Confounding & Simpson's ParadoxLabFree
  2. The Gold Standard: Randomised Experiment & Average Treatment EffectLab Locked
  3. Difference-in-Differences: The 2×2 Table and the RegressionLab Locked
  4. Checking Parallel Trends: Pre-Period Slopes, a Placebo Test & a Trend ChartLab Locked
  5. Matching: Nearest-Neighbour Controls with MIN, MATCH & INDEXLab Locked
  6. Propensity Scores & Inverse Probability Weighting (IPW)Lab Locked
  7. Regression Discontinuity: The Jump at the Gold-Status CutoffLab Locked
  8. Instrumental Variables: The Wald Estimator from a Randomised NudgeLab Locked
  9. Regression Adjustment & Omitted-Variable Bias: What a Missing Confounder Does to the EffectLab Locked
  10. Covariate Balance: Standardised Mean Differences Before and After MatchingLab Locked
  11. Overlap & Extreme Weights: Common Support, Trimming and Effective Sample SizeLab Locked
  12. Stratifying on the Propensity Score: Four Blocks and a Weighted EffectLab Locked
  13. Staggered Rollouts: Cohort DiD and the Already-Treated Control TrapLab Locked
  14. Synthetic Control: Building a Weighted Twin from Donor RegionsLab Locked
  15. Interrupted Time Series: Extending the Pre-Trend When There Is No Control GroupLab Locked
  16. RD Robustness: Bandwidth Choice and a Bunching Check at the Free-Delivery ThresholdLab Locked
  17. Two-Stage Least Squares by Hand: First Stage, Fitted Values & a Weak-Instrument CheckLab Locked
  18. Who Should Get the Offer? Segment Uplift and Targeting ProfitLab Locked
  19. How Strong Would a Hidden Confounder Need to Be? E-Values and a Bias FactorLab Locked
  20. Final Project: A Causal Impact Readout for the Loyalty App PilotLab Locked

You are not signed in — the lab works, but your progress is not saved. Sign up

Lesson 1 of 20 is free. Unlock all 20 hands-on labs, the final exam and your certificate.

Buy course — $9.90
Loading the spreadsheet…

Did the campaign work, or does it just look that way?

If you work in marketing, CRM, pricing, operations or finance, you are asked to judge whether something “worked” all the time. Did the loyalty programme increase spending? Did the new store layout lift sales? Did the discount bring customers back? The data you have is almost never a clean experiment. It is a record of what happened, shaped by decisions people made: who was targeted, which stores went first, which customers opted in. Comparing the people who got the treatment with the people who did not is the obvious first step, and it is the step that most often gives the wrong answer.

Causal inference is the set of methods that tries to answer the real question: what would have happened without the action? You can never observe that directly for the same customers at the same time, so every method in this field is a way of building a fair stand-in. This course covers the methods that are practical in Excel: stratification, randomised experiments, difference-in-differences, matching, propensity weighting, regression discontinuity and instrumental variables.

This free first lesson starts with the problem that makes all of them necessary: confounding, and its most surprising symptom, Simpson’s paradox. We use the same fictional retailer as the lab above, Ashcombe Market, and its spring 2026 win-back coupon. All numbers are illustrative and invented for learning.

Two customer groups compared side by side, the theme of the causal inference for business course
Causal inference asks what would have happened without the action, and builds fair comparisons to answer it.

The core idea: counterfactuals and confounders

For each customer who received the coupon, there is an outcome we see (did they buy again within 30 days?) and an outcome we can never see: whether they would have bought without the coupon. That unseen outcome is the counterfactual. The causal effect is the difference between the two. Since we only ever see one of them per customer, we estimate the average effect by comparing groups, and the comparison is only fair if the groups are alike in everything that matters except the treatment.

A confounder is a variable that influences both who gets the treatment and the outcome. At Ashcombe Market the CRM team sent the win-back coupon mostly to lapsed customers, people who had not bought for a while. Lapsed customers also buy far less often than active ones, coupon or not. So customer segment affects both sides: it decides who gets the coupon and it drives the buy rate. Comparing coupon customers with everyone else therefore mixes two things, the effect of the coupon and the fact that coupon customers were mostly lapsed to begin with.

Why the naive comparison is biased: segment is a confounderSegmentactive or lapsedCoupontreatmentBought againoutcomedecides who getsthe coupon (80% oflapsed, 12% of active)drives the buy rate(lapsed customersrarely buy anyway)effect we wantabout +5.6 ptsCompare coupon vs no coupon within each segment to block the path through Segment.
The confounding structure behind the Ashcombe Market numbers. Segment opens a “back door” path from the coupon to the outcome. Comparing customers within the same segment closes it, as long as segment is the only confounder.

The remedy in this lesson is stratification: compare coupon and no-coupon customers within each segment, where the confounder is held fixed, and then combine the segment differences into one number with a weighted average. That is the simplest form of “adjusting for a confounder”, and it is the same logic that regression controls, matching and propensity weighting extend to many variables at once.

Worked example: the Ashcombe Market win-back coupon

The lab sheet has two segments. Here are the inputs and the rates you calculate, rounded for display:

SegmentCoupon customersCoupon buyersCoupon buy rate (D)No-coupon customersNo-coupon buyersNo-coupon buy rate (G)Difference (H)
Active30019866.0%2,2001,32060.0%+6.00 pts
Lapsed1,20022819.0%3004214.0%+5.00 pts
All customers1,50042628.4%2,5001,36254.5%-26.08 pts

Read the table row by row. Among active customers, 66.0% of coupon recipients bought again, against 60.0% of the others: the coupon is ahead by 6 percentage points. Among lapsed customers, 19.0% against 14.0%: ahead by 5 points. Now look at the total. Only 28.4% of all coupon customers bought again, against 54.5% of the rest. The naive comparison says the coupon reduced the buy rate by about 26 points.

Both statements are arithmetically correct. The total is dragged down because 1,200 of the 1,500 coupon customers (80%) are lapsed, while only 300 of the 2,500 no-coupon customers (12%) are. The coupon group is mostly made of people with a low baseline, so its total rate looks poor even though the coupon helps in each segment. When the total and every segment point in opposite directions, you are looking at Simpson’s paradox.

Buy rate within 30 days, with and without the win-back couponcouponno coupon0%20%40%60%80%66.0%60.0%Activedifference +6.0 pts19.0%14.0%Lapseddifference +5.0 pts28.4%54.5%All customersdifference -26.1 pts
In each segment the coupon bar is higher. In the total it is far lower, because the coupon group is dominated by lapsed customers. This sign flip is Simpson’s paradox.

To get one adjusted number, weight each segment’s difference by the number of customers in that segment: 2,500 active (300 + 2,200) and 1,500 lapsed (1,200 + 300).

Adjusted effect = (6.0 × 2,500 + 5.0 × 1,500) ÷ 4,000 = 5.625 percentage points.

CellMeaningFormulaResult
D2 (copy to D4)Coupon buy rate=C2/B266.0%, 19.0%, 28.4%
G2 (copy to G4)No-coupon buy rate=F2/E260.0%, 14.0%, 54.5%
B6Naive difference, all customers=D4-G4-26.08 pts
H2 (copy to H3)Effect within each segment=D2-G2+6.0 pts, +5.0 pts
B7Adjusted effect, weighted by segment size=SUMPRODUCT(H2:H3,B2:B3+E2:E3)/(B4+E4)+5.625 pts
B8Simpson’s paradox?compare the sign of B6 with H2 and H3Yes

So, adjusted for segment, the coupon raised the 30-day buy rate by about 5.6 points, rather than lowering it by 26. The weights matter. Weighting by all customers answers “what if we sent the coupon to the whole base?”. Weighting by coupon customers only, (6.0 × 300 + 5.0 × 1,200) ÷ 1,500 = 5.2 points, answers “what did the coupon do for the people who actually got it?”. Both are legitimate, but they are different questions, and a report should say which one it answers.

Percentage points become more tangible as customers. Using the effect on the people who got the coupon, about 5.2 points × 1,500 coupon customers ≈ 78 extra customers who bought again within 30 days. If you know the margin per order and the cost of each redeemed coupon, those 78 customers are the starting point of a return-on-investment estimate, for example to decide whether the coupon is worth sending again. The naive figure would have told you to stop a campaign that, on these numbers, was working.

Stratification only removes bias from confounders you have measured and split by. If the CRM team also picked customers based on something not in the data, such as a gut feeling about who would respond, the adjusted number can still be biased. That is exactly why the later lessons move to designs that also deal with unmeasured confounders.

Four questions that reveal a confounded comparison

You will rarely be told that a comparison is confounded. You have to look for it. Before you report any “treated versus untreated” number, work through these four questions. They take a few minutes and catch most of the problems that make campaign reports misleading.

  1. How was the treatment assigned? Ask the people who ran it. “Everyone whose last purchase was more than 90 days ago”, “the stores the regional managers volunteered” and “customers who opted in” are all assignment rules that create differences between the groups. Only a lottery, such as a random split in the e-mail tool, creates groups that are alike on average.
  2. Do the groups look alike before the treatment? Put the treated and untreated groups side by side on things measured beforehand: segment, past spend, region, tenure. At Ashcombe Market a simple PivotTable of segment by coupon shows 80% lapsed in one group and 12% in the other, which is enough to distrust the total.
  3. Does the result survive a split? Recalculate the difference within each level of the variable that differs most. If the segment differences are similar to the total, confounding by that variable is probably small. If they differ a lot, or even change sign as here, the total is not a usable estimate.
  4. What could I not measure? Write down the plausible reasons for being treated that are not in the data. If there are important ones, say so next to the number, and consider one of the designs from the later lessons instead of simple adjustment.

This checklist also explains why the paradox is not a curiosity of textbooks. Targeting is the whole point of most business actions: you send win-back coupons to customers who are drifting away, you train the stores that struggle, you offer discounts to price-sensitive buyers. Every one of those sensible decisions builds a treated group that differs from the untreated one in a way that is linked to the outcome. The better the targeting, the stronger the confounding, and the more a naive comparison can mislead. Good targeting and honest measurement are therefore two separate jobs, and the second one needs either a control group built in from the start or a careful adjustment afterwards.

How to do it in Excel, step by step

These steps reproduce the lab on your own campaign data. They work in any recent Excel version and in Google Sheets.

  1. Start from a customer list with at least three columns: segment (or any suspected confounder), treatment flag (got the coupon: 1/0) and outcome flag (bought again: 1/0).
  2. Choose Insert › PivotTable. Put Segment in Rows, the treatment flag in Columns, and add the customer ID as Count and the outcome flag as Sum in Values. You now have customers and buyers per segment and group.
  3. Copy the numbers into a layout like the lab: one row per segment, with coupon customers and buyers in B:C and no-coupon customers and buyers in E:F. Add an “All customers” row with =SUM(B2:B3) and fill right.
  4. In D2 type =C2/B2, select D2:D4 and press Ctrl+D. Do the same in G2:G4 with =F2/E2. Format both with Ctrl+Shift+%.
  5. In B6 compute the naive difference: =D4-G4.
  6. In H2 type =D2-G2 and copy to H3: the effect within each segment.
  7. In B7 compute the weighted average of the segment effects: =SUMPRODUCT(H2:H3,B2:B3+E2:E3)/(B4+E4). SUMPRODUCT multiplies each effect by its segment size and adds the products.
  8. Compare the signs of B6 and B7. If they differ, you have Simpson’s paradox. An automatic flag: =IF(SIGN(B6)<>SIGN(B7),"Yes","No").
  9. Add a clustered column chart (Insert › Charts › Clustered Column) of D2:D4 and G2:G4. A chart like the one above makes the paradox obvious to readers who do not want to read a table.
With more than two segments, nothing changes except the ranges. With several confounders at once (segment and region and age band), the cells get small and noisy quickly. That is where matching and propensity scores, covered later in the course, take over.

Common mistakes and how to spot them

  • Trusting the total. A comparison of all treated against all untreated customers is only fair if treatment was assigned at random. Spot it: the two groups differ in obvious ways, for example in segment mix, region or past spend.
  • Averaging the segment differences without weights. =AVERAGE(H2:H3) gives 5.5 points and treats a tiny segment like a huge one. Spot it: the result does not change when you double the size of one segment.
  • Averaging the rates instead of the differences. Taking the average buy rate per group across segments and subtracting mixes up weights. Compute the difference within each segment first, then weight.
  • Reversing the sign. Always subtract the control from the treatment (coupon minus no coupon), so a positive number means the coupon helped. Spot it: a “negative effect” where every segment rate is higher with the coupon.
  • Adjusting for something the treatment caused. If you split by “redeemed the coupon” or “visited the store in the following week”, you adjust for an outcome of the treatment and distort the effect. Only adjust for variables fixed before the treatment.
  • Calling the adjusted number causal without caveats. It is only as good as the list of confounders. Spot it: ask “how were people chosen for the treatment, and is all of that in my table?”

Quick reference: functions and shortcuts used

Function or shortcutWhat it does hereExample
Division and relative referencesA rate per row that you copy down=C2/B2
SUMTotals for the “All customers” row=SUM(B2:B3)
SUMPRODUCTWeighted average of the segment effects=SUMPRODUCT(H2:H3,B2:B3+E2:E3)/(B4+E4)
SIGN and IFFlags Simpson’s paradox automatically=IF(SIGN(B6)<>SIGN(B7),"Yes","No")
PivotTableBuilds the segment × coupon table from a customer listInsert › PivotTable
Ctrl+DCopies the formula in the top cell down the selectionSelect D2:D4, press Ctrl+D
Ctrl+Shift+%Formats rates as percentagesSelect D2:H4
Alt+H, 0Adds a decimal place (Home › Increase Decimal)Select B6:B7

Real-world uses

  • Marketing campaigns: evaluate targeted coupons, e-mails or ads, where the targeting rule itself is the confounder, by comparing within targeting segments.
  • Loyalty programmes: members spend more, but loyal customers are also the ones who join. Stratify by pre-joining spend before crediting the programme.
  • Operations and training: stores that received a new process are often the ones managers picked as ready. Compare within store size or region bands.
  • Pricing and discounts: discounted orders may look less profitable simply because discounts go to price-sensitive customers. Compare within customer type.
  • HR and management reporting: a department with a higher overall sick-leave rate can be lower in every age band once you account for its age mix, the same Simpson pattern.

What you will build in the rest of this course

This first lesson is free. The lessons below form the full course, unlocked with a one-time payment of $9.90. Each has its own interactive lab with instant feedback, and each method handles a situation where simple stratification is not enough.

The Gold Standard: Randomised Experiment & Average Treatment Effect. You analyse a randomised test of a new store layout, check that the groups are balanced and see why a before-and-after change score makes the estimate more precise.

Difference-in-Differences: The 2×2 Table and the Regression. You estimate the effect of Sunday opening by comparing the change in treated stores with the change in other stores, then confirm it with a LINEST regression with an interaction term.

Checking Parallel Trends: Pre-Period Slopes, a Placebo Test & a Trend Chart. You test the assumption every difference-in-differences result depends on, with pre-period trends, a placebo test and a chart, and estimate the effect month by month.

Matching: Nearest-Neighbour Controls with MIN, MATCH & INDEX. You pair each trained store with its most similar untrained twin and estimate the effect of training on the stores that were actually trained.

Propensity Scores & Inverse Probability Weighting (IPW). You turn propensity scores into weights that rebalance the groups and estimate the effect of the mobile app on annual spend.

Regression Discontinuity: The Jump at the Gold-Status Cutoff. You fit a line on each side of a 1,000-point loyalty threshold and measure the jump in next-year spend that the status itself causes.

Instrumental Variables: The Wald Estimator from a Randomised Nudge. You use a randomised reminder e-mail as an instrument and estimate the app’s effect for the customers who adopted it because of the reminder.

Summary

A plain comparison of treated and untreated customers measures the effect of the treatment plus every difference in how the groups were chosen. At Ashcombe Market the coupon looks harmful in total (-26.1 points) but helps in both segments (+6 and +5 points), because coupons went mostly to lapsed customers. Comparing within segments and weighting by segment size gives an adjusted effect of about +5.6 points. Whenever the total and the segments disagree, trust the comparison that holds the confounder fixed, and keep asking which confounders you have not measured.

Now scroll back up to the lab and work through the buy rates, the naive difference, the segment effects and the adjusted effect yourself. The Coach checks every step and explains common slips such as reversed signs or unweighted averages. It takes about 15 minutes.

Frequently asked questions

What is a confounder?

A confounder is a variable that affects both who receives a treatment and the outcome. If you do not account for it, the comparison between treated and untreated groups mixes the treatment effect with the effect of the confounder.

What is Simpson’s paradox in simple terms?

It is when a trend that appears in every subgroup reverses or disappears when the groups are combined. It happens when the groups being compared have very different mixes of the subgroups.

How do I adjust for a confounder in Excel?

Compute the treatment-minus-control difference within each level of the confounder, then take a weighted average of those differences with SUMPRODUCT, using the number of customers in each level as weights.

Is correlation ever enough to prove causation?

Only when the treatment was assigned at random, as in a well-run experiment. Otherwise you need a design or adjustment that rules out confounders, and you should state which ones you could not measure.

Should I weight segments by all customers or only treated customers?

Weighting by all customers estimates the effect if everyone were treated. Weighting by treated customers estimates the effect on those who actually received the treatment. Choose the one that matches your business question and say which you used.

Can I do causal inference in Excel?

Yes, for many practical designs. Stratification, randomised tests, difference-in-differences, matching, inverse probability weighting, regression discontinuity and simple instrumental variables can all be built with standard Excel functions.

Keep going: Causal Inference for Business: Difference-in-Differences, Matching & Natural Experiments

This free lab is lesson 1 of 20. Unlock the other 19 hands-on labs, the final exam and your certificate for a one-time $9.90.

  1. The Gold Standard: Randomised Experiment & Average Treatment Effect
  2. Difference-in-Differences: The 2×2 Table and the Regression
  3. Checking Parallel Trends: Pre-Period Slopes, a Placebo Test & a Trend Chart
  4. Matching: Nearest-Neighbour Controls with MIN, MATCH & INDEX
  5. Propensity Scores & Inverse Probability Weighting (IPW)
  6. Regression Discontinuity: The Jump at the Gold-Status Cutoff
  7. Instrumental Variables: The Wald Estimator from a Randomised Nudge
  8. Regression Adjustment & Omitted-Variable Bias: What a Missing Confounder Does to the Effect
  9. Covariate Balance: Standardised Mean Differences Before and After Matching
  10. Overlap & Extreme Weights: Common Support, Trimming and Effective Sample Size
  11. Stratifying on the Propensity Score: Four Blocks and a Weighted Effect
  12. Staggered Rollouts: Cohort DiD and the Already-Treated Control Trap
  13. Synthetic Control: Building a Weighted Twin from Donor Regions
  14. Interrupted Time Series: Extending the Pre-Trend When There Is No Control Group
  15. RD Robustness: Bandwidth Choice and a Bunching Check at the Free-Delivery Threshold
  16. Two-Stage Least Squares by Hand: First Stage, Fitted Values & a Weak-Instrument Check
  17. Who Should Get the Offer? Segment Uplift and Targeting Profit
  18. How Strong Would a Hidden Confounder Need to Be? E-Values and a Bias Factor
  19. Final Project: A Causal Impact Readout for the Loyalty App Pilot

Buy course — $9.90 See the full course