Causal Graphs & Identification — DAGs, Confounders & Backdoor
DAGs make identification inspectable before any DML fit. Distinguish confounders, colliders, and mediators; apply backdoor and positivity; name unmeasured confounding and confounding by indication.
- 1Gist
- 2Maps
- 3Q&A
- 4Sandbox
Voice readout needs Web Speech Synthesis in this browser.
Before you fit anything
Prefer
Write the graph, then the adjustment set
Identification asks: given this DAG, can we write P(Y | do(T)) from observational distributions?
- Block backdoor paths; do not condition on colliders.
- Leave mediators alone if you want the total effect.
- Positivity is part of identification, not a later plotting nicety.
Alternative
Throw all EHR columns into a GBM
More X is not more identification. Wrong controls open bias paths; unmeasured common causes stay unmeasured.
- Structure learning is fragile; interviewers want domain DAGs plus sensitivity.
- Feature importance is not a causal graph.
- DML with the wrong Z is still biased — flexibly.
Identification before estimation
The estimator only inherits validity from a correct set Z and overlap.
- 1
Draw a candidate DAG
Treatment T, outcome Y, measured covariates, unmeasured U you are willing to name. - 2
List paths from T to Y
Causal arrows vs backdoor (common cause) vs collider vs mediator. - 3
Choose Z
Backdoor: Z blocks all backdoors and contains no descendants of T. - 4
Check positivity on Z
Propensity near 0 or 1 → trim or redefine the target population. - 5
Hand off
Matching, IPW, g-formula, or DML. Unmeasured confounding → design or sensitivity.
Overview
Before you fit DML or a causal forest, you must answer: what is identifiable from the data? Directed Acyclic Graphs make assumptions inspectable. Interviewers expect you to distinguish confounders, colliders, and mediators — and to know that adjusting for the wrong variables can open bias paths.
Health classic: confounding by indication (sicker patients get the drug). Naive treated-vs-untreated mixes severity with effect.
DAGs in one page
- Nodes are variables; arrows mean direct causal influence, not mere association.
- No cycles. The graph encodes conditional independencies.
- Identification: given this graph, can we write
P(Y | do(T))using observational distributions?
This is a graph + assumptions problem. DML only protects a well-identified parameter from nuisance estimation error.
Confounders vs colliders vs mediators
| Role | Shape | Adjust? |
|---|---|---|
| Confounder (common cause) | U → T and U → Y | Yes — block backdoor T ← U → Y |
| Mediator | T → M → Y | No for total effect; yes only if you want a direct effect |
| Collider | T → C ← Y (or T → C ← U → Y) | No — conditioning opens a non-causal association |
Health spelling:
- Disease severity confounds assignment and outcome (confounder).
- Lab markers on the pathway from drug to recovery are mediators.
- Hospital admission can be a collider between frailty and acute illness.
Conditioning on a collider is Berkson’s paradox in interview clothes.
Backdoor, frontdoor, instruments
Backdoor criterion: a set Z blocks all backdoor paths from T to Y and contains no descendants of T. Then adjust for Z (standardization, matching, IPW, regression, DML).
Frontdoor: identify via a mediator that captures all effect of T and is shielded from confounding. Rarer in practice; useful talking point.
Instrumental variables: Z affects T, affects Y only through T, independent of unmeasured confounders. Different assumptions, different estimator — not “just another covariate.”
Positivity / overlap
Every unit in the analysis population must have a non-zero chance of each treatment level given Z. Near-violations (propensity ≈ 0 or 1) make IPW unstable and DML residuals noisy.
Interview answer: plot propensity histograms; trim or redefine the target population rather than inventing effects off support. Same rule reappears for CATE subgroups.
Unmeasured confounding
If an important common cause is unobserved, backdoor fails. Options:
- Design: RCT, natural experiment
- Proxies (not magic)
- DiD / synthetic control under extra assumptions (parallel trends, donors)
- Sensitivity analysis — how large must hidden bias be to explain the effect away?
Never claim “causal” from a black-box feature-importance plot.
Comparative: adjustment strategies
| Strategy | Pros | Cons |
|---|---|---|
| Conditioning / matching | Intuitive | Curse of dimensionality; misspecified sets |
| IPW | Targets ATE with propensity | Extreme weights under poor overlap |
| Standardization / g-formula | Clear marginal effects | Needs an outcome model |
| DML | Flexible ML for nuisances + orthogonal scores | Still needs the correct confounder set |
Architecture (identification flow)
Decisions
- 1
1 Draw candidate DAG
- next2 List paths T to Y
- 2
2 List paths T to Y
- next3 Confounder path?
- ?
3 Confounder path?
- yes4 Choose adjustment Z
- no4 Collider only?
- 4
4 Choose adjustment Z
- next6 Overlap ok?
- ?
4 Collider only?
- yes5 Do not adjust
- no5 Mediator?
- 6
5 Do not adjust
- ?
5 Mediator?
- total5 Do not adjust
- direct6 Adjust for direct
- 8
6 Adjust for direct
- ?
6 Overlap ok?
- yes7 Hand off to DML
- noTrim / redefine pop
- 10
7 Hand off to DML
- 11
Trim / redefine pop
Lesson map
Causal Graphs & Identification — DAGs, Confounders & Backdoor
DAGs make identification inspectable before any DML fit. Distinguish confounders, colliders, and mediators; apply backdoor and positivity; name unmeasured confounding and confounding by indication.
Architecture. Architecture
Select a node to see why it exists, or an edge to see the protocol, direction, effect, and consequence.
Mermaid export
flowchart TB d["1 Draw candidate DAG"] s["2 List paths T to Y"] c["3 Confounder path?"] z["4 Choose adjustment Z"] d -->|1 Draw candidate DAG| s s -->|2 List paths T to Y| c c -->|yes| z
Sandbox: path classifier (Python)
Press Run. Snippets must be self-contained — no network, files, or native modules.
Same helpers (TypeScript)
Press Run. Snippets must be self-contained — no network, files, or native modules.
Pitfalls
Drug vs no-drug on 30-day mortality. Sicker patients get the drug. Sketch severity → T, severity → Y, T → Y. What happens if you also condition on ICU admission (a collider)? What happens if you adjust for a lab that is on the pathway from drug to recovery?
Interview Q&A
Why is adjusting for a collider bad?
Answer
It opens a non-causal path and can induce selection bias (Berkson’s paradox). “More covariates” is not a safety property.
What is confounding by indication?
Answer
Clinicians prescribe based on prognosis. Naive treated-vs-untreated comparisons mix severity with drug effect. Severity is a confounder you must measure or bound — not a reason to dump every lab into a GBM.
Can ML discover the DAG automatically?
Answer
Structure learning is fragile. The interview answer prefers domain DAGs plus sensitivity, not pure discovery. Algorithms can propose; clinicians still have to disagree on arrows.
What if positivity fails?
Answer
Redefine the estimand to the overlap population. Do not extrapolate off support. Trimming is a change of target, not a free lunch.
Backdoor vs RCT?
Answer
An RCT removes confounding by design. Observational backdoor requires measured confounders and a correct graph. If U is unobserved, backdoor fails no matter how flexible the outcome model is.
Total vs direct effect — do I adjust for the mediator?
Answer
Total effect of T: do not adjust for M on T → M → Y. Direct effect: adjust for M (and watch intermediate confounding). Say which estimand you want.
When is an instrument the right story?
Answer
When you have a variable that shifts treatment, affects the outcome only through treatment, and is independent of unmeasured confounders. That is not “a strong predictor of T.” Different assumptions than backdoor.
Does DML fix a wrong DAG?
Answer
No. Orthogonal scores protect against nuisance estimation error, not against omitting the real confounder. Depth: DML.
How do DiD and synthetic control relate?
Answer
They identify under different assumptions (parallel trends, donor weights) when backdoor is implausible. Depth: causal time series.
What do I do when clinicians disagree on the DAG?
Answer
Do not average two graphs in software and ship. Report competing adjustment sets, run sensitivity, and often do not deploy. Depth: health.