Causal Inference
Getting from correlation to cause when you cannot run the experiment.
The Question Behind Most Analyses
The counterfactual is what you actually want: what would have happened to these same users had they not been treated. It is unobservable by definition, so every method here is a strategy for constructing a credible stand-in for it.
Confounding & DAGs
A confounder causes both the treatment and the outcome, so it manufactures an association that is not causal. Users who install the mobile app spend more — but engaged users are likelier both to install and to spend, and engagement is doing the work.
| Structure | Do |
|---|---|
| Confounder — causes treatment and outcome | Control for it |
| Mediator — sits on the causal path | Do not control: it removes the effect you want |
| Collider — caused by both | Do not control: it creates false association |
Drawing the assumed causal graph first is what makes those distinctions visible. "Control for everything available" is not a strategy — conditioning on a mediator or a collider actively introduces bias rather than removing it.
Why Randomisation Wins
A randomised experiment settles the problem by construction: assignment is independent of every characteristic, observed or not, so the groups differ only by chance and by the treatment. That is why an A/B test beats any amount of clever observational modelling when it is available.
| Run the experiment unless | |
|---|---|
| It is unethical | Deliberately degrading someone's service |
| It is impossible | A pricing change across a whole market |
| It is too slow | The effect takes a year to appear |
| It already happened | You are evaluating a launch after the fact |
The methods below are what you reach for in those cases — each buying credibility with a different assumption, stated explicitly.
Difference-in-Differences, Matching & IV
Difference-in-differences compares the change in a treated group with the change in an untreated one over the same period, cancelling anything that affected both. Its assumption is parallel trends: without treatment the two would have moved together — which you support by showing they did before the intervention.
| Method | Idea | Assumption to defend |
|---|---|---|
| Difference-in-differences | Compare changes, not levels | Parallel pre-trends |
| Matching / propensity scores | Build a comparable control group | No unobserved confounders |
| Instrumental variables | Use a nudge that only affects the outcome via treatment | The instrument is truly exogenous |
| Regression discontinuity | Compare either side of a cutoff | Nothing else jumps at the cutoff |
| Synthetic control | Build a weighted control from other units | The synthetic tracks the pre-period well |
Be honest about what is being estimated, too. Most of these recover the effect for a particular subgroup — those near a cutoff, or those a nudge actually moved — which is not the same as the average effect across everybody.
Interview Questions
Why is correlation insufficient for a business decision?
The decision is causal — would acting change the outcome. Observational groups differ in unrecorded ways, so the association may be entirely produced by a confounder.
What is a confounder, and how does it differ from a mediator?
A confounder causes both treatment and outcome and must be controlled for. A mediator sits on the causal path, and controlling for it removes part of the very effect you are measuring.
Why should you not control for a collider?
A collider is caused by both variables. Conditioning on it creates an association between them that does not exist, so it introduces bias rather than removing it.
Why does randomisation solve confounding?
Assignment is independent of every characteristic, observed or not, so the groups differ only by chance and by the treatment itself.
What does difference-in-differences assume?
Parallel trends: absent the treatment, both groups would have moved together. You support it by showing their pre-treatment trends already tracked each other.
What is the weakness of matching?
It balances observed variables only. Any unobserved confounder survives the matching, so the estimate is credible only where you can argue nothing important was unmeasured.