Skip to the causal inference lab

The causal inference lab

Interactive Causal Inference Lab

Five hands-on experiments in telling what an action changed from what merely came with it: an effect that reverses when a hidden variable is ignored, a campaign measured by a randomised test and by an observational comparison, retention offers ranked by churn risk and by uplift, a launch measured with no control group, and one dataset asked a seeing, a doing and an imagining question.

SYNTHETIC DATA

These demos are illustrative. Every customer, account, region and order is synthetic, generated and analysed in your browser, and every number shown is computed from that synthetic data. They show general principles of causal analysis, not the results of any real campaign, product or project.

Nothing is uploaded. No customer data is used.

01

Confounding / Simpson’s paradox

Helps in every segment. Looks harmful overall.

What this shows: a call that raises renewal for at-risk accounts and for healthy accounts can still show a lower renewal rate among called accounts, when at-risk accounts are the ones that get called.

Open as a page: Simpson’s paradox and confounding: why does the effect reverse? →

Compare the accounts

Comparison

At 0% every account is equally likely to be called. At 100%, 90% of at-risk accounts and 10% of healthy accounts are called. The call’s true effect stays the same throughout.

Renewal rate: called vs not called

20,000 synthetic accounts

Blue: calledWhite: not called

Pooled difference—
At-risk accounts—
Healthy accounts—
Adjusted for segment—
True effect of a call—
At risk: called / not called—

Synthetic data · illustrative · not results from a real business

Where this matters

Any action aimed at the cases that need it most: retention calls, discounts for price-sensitive customers, escalations for difficult tickets, maintenance for the oldest machines. A dashboard that compares treated with untreated then measures who was chosen as much as what the action did.

What this experiment models

20,000 synthetic accounts; half are at risk. Without a call, 80% of healthy and 40% of at-risk accounts renew; a call adds 8 percentage points in both segments. The slider sets how strongly calls depend on the segment: at 0% every account has a 50% chance of a call, at 100% it is 90% for at-risk and 10% for healthy accounts. The adjusted figure is the within-segment difference averaged over the two segments by size. Each account keeps the same random draws at every slider position, and the data is fixed by a seed, so the same settings always give the same numbers.

02

Experiments / selection bias

One campaign. Two measurements.

What this shows: when a campaign is sent to the customers most likely to buy, comparing recipients with everyone else reports a lift several times the true one. A coin-flip test on the same customers does not.

Open as a page: A/B test vs observational data: why do the results disagree? →

Set the targeting

At 0% the campaign reaches customers at random in both measurements. Higher settings send it to customers who were already more likely to buy. Try a true lift of zero.

Estimated effect on purchase rate

50,000 synthetic customers
True effect—
Randomised test—
95% interval, pts—
Observational comparison—
Observational, adjusted—
Bands with overlap—

Who received the campaign in the observational data

Share of customers who received the campaign, by prior propensityShare of customers who received the campaign, by prior propensity.

Amber: observational targetingBlue dashed: randomised test, 50% in every band

Synthetic data · illustrative · not results from a real business

Where this matters

Campaign, promotion and feature reports built on recipients versus non-recipients, or adopters versus non-adopters. The better the targeting, the larger the apparent lift, whether or not the campaign changed anyone’s behaviour.

What this experiment models

50,000 synthetic customers with a prior propensity score; the chance of buying without the campaign is a logistic function of it. The campaign adds the chosen lift to every customer’s purchase probability. The randomised test assigns the campaign by coin flip. The observational version sends it with a probability that rises with prior propensity; the slider sets how steeply. The interval is a normal-approximation 95% interval for a difference of two proportions. The adjusted estimate compares recipients and non-recipients within ten equal-sized propensity bands and averages by band size, skipping any band with fewer than 30 customers on either side. Fixed seed: the same settings always give the same numbers.

03

Uplift modelling / targeting

Most likely to leave. Not most worth an offer.

What this shows: with a fixed number of retention offers, ranking customers by estimated uplift retains more of them than ranking by churn risk, when the customers at highest risk are hard to move.

Open as a page: Uplift modelling vs churn prediction: who should get the offer? →

Set the budget

Both scores are fitted on a randomised pilot of 20,000 customers and applied to 20,000 others. Untick the box to make the offer work better the higher the risk.

Extra customers retained

20,000 synthetic customers ranked
Extra customers retained against share of customers who get the offerExtra customers retained against share of customers who get the offer.

Blue: ranked by upliftAmber: ranked by churn riskGrey dashed: offers at randomWhite dashed: your budget

Offers sent—
Retained: uplift ranking—
Retained: churn-risk ranking—
Retained: random—
Per 100 offers: uplift—
Per 100 offers: churn risk—

Synthetic data · illustrative · not results from a real business

Where this matters

Retention offers, win-back calls, discounts and any other action with a cost per customer. The business result is the number of outcomes the action changed, which a churn model’s accuracy does not measure.

What this experiment models

40,000 synthetic customers with two observed features, usage decline and past response to offers. Churn risk without the offer rises with usage decline. The offer’s effect grows with past response; with the box ticked it is largest at middling risk and smaller at the extremes, and unticked it grows with risk. Customers with little past response become slightly more likely to churn when contacted. 20,000 customers form a randomised pilot (offer by coin flip); in a 5 × 5 grid of segments the churn score is the churn rate without the offer and the uplift score is that rate minus the churn rate with the offer. The other 20,000 are ranked by each score, ties in simulation order. Extra customers retained counts customers who churn without the offer and stay with it, minus those who do the reverse; the simulation holds both outcomes for every customer. Fixed seed.

04

Quasi-experiments / difference-in-differences

No control group. One assumption.

What this shows: difference-in-differences recovers a launch effect when the two regions were moving in parallel, and reports a wrong effect, with no warning of its own, when they were not.

Open as a page: Difference-in-differences: what happens when parallel trends fails? →

Change the regions

At zero extra trend the regions move in parallel apart from noise. Any other value breaks the parallel-trends assumption. Try a true effect of zero.

Weekly orders in two regions

36 weeks · launch after week 24
Weekly orders in the launch region and the comparison regionWeekly orders in the launch region and the comparison region.

Blue: launch regionAmber: comparison regionWhite dashed: launch region without the launch, as the method assumes

True effect, orders / week—
Difference-in-differences—
Before and after only—
Placebo on pre-launch weeks—
Pre-launch gap trend / week—
Error of the estimate—

Synthetic data · illustrative · not results from a real business

Where this matters

Launches, price changes and policy changes rolled out to one region, store group or customer tier without a randomised control. Regions are often chosen for a launch because they are growing, and that growth is then reported as the launch’s effect.

What this experiment models

Two synthetic regions, 36 weeks of orders, launch in one region after week 24. Both share a trend of +0.5 orders a week and independent week-to-week noise (standard deviation 3). The launch adds a constant number of orders a week. The extra trend applies to the launch region from week 1. Difference-in-differences is the change in the launch region’s mean (weeks 25–36 minus weeks 1–24) minus the same change in the comparison region. The placebo applies the same calculation to weeks 13–24 against weeks 1–12. The gap trend is the least-squares slope of the difference between the regions over weeks 1–24. The dashed line is the comparison region shifted by the average pre-launch gap. Fixed seed.

05

Association / intervention / counterfactual

Three questions. Three different numbers.

What this shows: how often offered customers renew, what the offer does to renewal, and how many renewals the offer caused are three questions. One dataset gives each a different answer.

Open as a page: What is the ladder of causality? One dataset, three answers →

Choose the question

Rung of the ladder

15% of the other customers get the offer at every setting. At 15% the offer is unrelated to risk.

One retention offer, asked three ways

10,000 synthetic customers
Seeing: difference in renewal—
Doing: effect of the offer—
Imagining: renewed because of it—
Doing, estimated from data—
Imagining, estimated from data—
At risk: offered / not offered—

Synthetic data · illustrative · not results from a real business

Where this matters

Forecasting is a seeing question, a rollout decision is a doing question, and attribution or credit for an outcome is an imagining question. Using the number from a lower rung for a decision on a higher one is a common and costly mix-up.

What this experiment models

10,000 synthetic customers, 40% at risk. Without the offer 35% of at-risk and 80% of other customers renew; the offer adds 25 and 5 percentage points. 15% of other customers get the offer; the slider sets the share of at-risk customers who do. Every customer has both outcomes fixed in advance, and the offer never turns a renewal into a loss. Seeing is the difference in observed renewal rates. Doing is the difference between everyone’s outcome with the offer and without it; the estimate from the data is the within-group difference averaged over the two groups by size. Imagining counts offered customers who renewed and would not have without the offer; the estimate from the data uses, within each group, the ratio of renewal rates without and with the offer, which is valid only because the offer never hurts. Fixed seed.

MLAIA DATA SCIENCE

Tell us what
you’re working on.

Share the problem, the data you have and what success would look like. We’ll discuss a practical next step.

Please don’t include confidential datasets, credentials or patient information.

yochai@mlaia.com
WhatsApp: +972 52 484 6282

Your inquiry is handled under our Privacy Policy.