Written and maintained by CASRAI Editorial Board
Last updated
“Adjust for everything available” is not a defensible adjustment strategy — it is a coin flip that happens to land right about half the time. A directed acyclic graph (DAG) replaces that coin flip with a procedure: draw the assumed causal structure, trace every backdoor path between exposure and outcome, and adjust for the smallest set of variables that closes them all. Get the set wrong in one direction and confounding survives unadjusted. Get it wrong in the other — by adjusting for a variable that should have been left alone — and the DAG shows you’re about to manufacture bias that did not exist in the raw data. This guide works through that procedure end to end, with a reproducible simulation showing both failure modes numerically.
What a DAG actually encodes
A directed acyclic graph represents a set of assumptions about cause and effect, not just statistical association. Each node is a variable; each directed edge (an arrow) is an assumed direct causal effect of the variable it leaves on the variable it enters. “Acyclic” means no variable can be its own descendant — no path of arrows can loop back to where it started, which matches the ordinary assumption that a cause precedes its effect in time. This causal-diagram framework for confounder identification was formalized for epidemiology by Sander Greenland, Judea Pearl, and James Robins in “Causal Diagrams for Epidemiologic Research” (Epidemiology, 1999) and is now standard across epidemiology, econometrics, and the broader quantitative social sciences.
The critical property a DAG has that a correlation matrix or a list of “variables associated with the outcome” does not: it distinguishes why two variables are associated. Two variables can be correlated because one causes the other, because a third variable causes both (confounding), or because both cause a variable the analysis has conditioned on (collider stratification) — and only the DAG tells you which situation you’re in, which is exactly the information you need to know whether adjusting for a given variable helps or hurts.
Backdoor paths and the backdoor criterion
A backdoor path from exposure X to outcome Y is any path connecting them that starts with an arrow pointing into X — that is, any non-causal route between them created by a shared cause. The simplest case is a single confounder Z: the path X ← Z → Y is a backdoor path, and it is open (transmitting spurious association) unless something on it is controlled for.
A path is blocked at a given variable if that variable is a non-collider on the path and is conditioned on (adjusted for, stratified on, or matched on), or if that variable is a collider on the path and is not conditioned on (and none of its descendants are either). This second half is the part “adjust for everything” gets wrong: conditioning on a collider does not block a path, it opens one that was already closed.
The backdoor criterion (Pearl; formalized for applied epidemiologic use in the Greenland-Pearl-Robins paper above) says a set of variables S is sufficient to identify the causal effect of X on Y if: (1) no variable in S is a descendant of X, and (2) S blocks every backdoor path between X and Y. Any set satisfying both conditions recovers the true causal effect via adjustment; a set that fails condition 1 (adjusts for something downstream of the exposure) or fails condition 2 (leaves a backdoor path open) does not.
The minimal sufficient adjustment set, not the maximal available one
Multiple sets can satisfy the backdoor criterion for the same DAG — the goal is not to find a valid set but a minimal sufficient adjustment set: one that blocks every backdoor path while adjusting for as little as possible beyond that. VanderWeele and Shpitser’s “A New Criterion for Confounder Selection” (Biometrics, 2011) formalized this directly against the common empirical habit of adjusting for every pre-exposure variable available in the dataset, proposing instead that a variable earns a place in the adjustment set only if it is a cause of the exposure, the outcome, or both — not merely because it is correlated with the outcome or was collected on the same form.
Adjusting for more than the minimal sufficient set is not automatically neutral. Beyond re-introducing collider bias if a collider is included (see below), unnecessary adjustment inflates the variance of the effect estimate, and in finite samples with imperfectly measured covariates it can amplify bias from any confounder that is still unmeasured — the DAG-driven procedure exists precisely to separate “variables that close a backdoor path” from “variables that happened to be in the dataset.”
A worked DAG: one confounder, one collider
Consider a DAG with an exposure X, an outcome Y, a pre-exposure confounder Z, and a post-outcome variable C — for example, enrollment in a follow-up study wave, caused independently by both the exposure and the outcome:
Z → X (Z is a common cause of X and Y: a confounder) Z → Y X → Y (the causal effect actually being estimated) X → C (C is a common EFFECT of X and Y: a collider) Y → C
Trace the paths between X and Y:
- X → Y — the direct causal path. This is what the analysis is trying to estimate; it is never adjusted away.
- X ← Z → Y — a backdoor path through the confounder. It starts with an arrow into X, so it qualifies as a backdoor path, and it is open because Z (a non-collider on this path) is not conditioned on. This is the path that needs closing.
- X → C ← Y — this does not start with an arrow into X, so it is not a backdoor path at all, and it is already blocked on its own: C is a collider on this path, and an unconditioned collider blocks the path it sits on. Leaving C out of the model is not an omission — it is the correct, already-satisfied state.
Applying the backdoor criterion: the minimal sufficient adjustment set is {Z} alone. Adjusting for Z blocks the one open backdoor path; C is not a descendant of X that needs including, and conditioning on it would take an already-blocked path and force it open, since C is a collider for exactly that path.
Why this is not just a diagram convention: a reproducible simulation
The consequence above is checkable with real numbers, not just diagram logic. The following synthetic dataset was generated from the exact structural model above with a fixed random seed, so the result is reproducible rather than asserted:
Z ~ Normal(0, 1) X = 1.5·Z + noise Y = 2.0·X + 1.5·Z + noise ← true causal effect of X on Y is set to exactly 2.0 C = 1.0·X + 1.0·Y + noise ← collider: caused by both X and Y n = 200,000; seed = 20260829 (mulberry32 PRNG); OLS via normal equations
Three regressions of Y on X, differing only in what else is included, recover the coefficient on X:
| Model | Adjustment set | Estimated effect of X on Y | True effect is 2.0 |
|---|---|---|---|
| Unadjusted | ∅ (none) | 2.695 | Biased upward — the open backdoor path through Z is still contaminating the estimate. |
| Backdoor-criterion set | {Z} | 2.004 | Correct — matches the true effect to three decimal places. |
| “Adjust for everything available” | {Z, C} | 0.502 | Badly biased — adding the collider C on top of the correct Z destroys an estimate that was already right, cutting it to roughly a quarter of its true value. |
This is simulated data generated for this guide, not a real study or dataset — disclosed explicitly because the point being illustrated is the direction and severity of the bias, not any particular real-world estimate. The mechanism it demonstrates is general: adjusting for a variable that is a common effect of exposure and outcome creates an association between them within strata of that variable, even when — as constructed here — the confounder is already correctly handled. Including more covariates is not automatically more rigorous; it is only correct when every added covariate is actually part of a minimal sufficient adjustment set.
What NOT to add to the adjustment set
| Variable type | DAG position | Effect of adjusting for it |
|---|---|---|
| Confounder | Common cause of X and Y (X ← Z → Y) | Should be adjusted for — this is what closes the backdoor path. |
| Collider | Common effect of X and Y, or of X and any cause of Y (X → C ← Y) | Must NOT be adjusted for — opens a path that was already closed. See the dedicated Collider Bias guide for the mechanism in depth, including the classic birth-weight-paradox example. |
| Mediator | On the causal pathway between X and Y (X → M → Y) | Adjusting for it blocks part of the very effect being estimated, converting a total effect into (at best) a direct effect — a different, deliberately narrower estimand, not a more “controlled” version of the same one. |
| Instrumental variable | Causes X only, no direct or backdoor path to Y | Adjusting for a pure instrument doesn’t bias the estimate but discards information that instrumental-variables methods use deliberately; including it in a standard adjustment set is neutral but pointless. |
| Variable caused by both a confounder and the outcome, downstream of X | Descendant of X that is also associated with Y through Z | Fails the backdoor criterion’s first condition on its own (any descendant of X is excluded) regardless of whether it also happens to look “predictive” of Y in a stepwise-selection sense. |
A step-by-step procedure
- Draw the DAG before looking at the data. The structure must reflect subject-matter knowledge about what causes what, not which variables happen to correlate with the outcome in this particular sample — a DAG built by data-mining associations defeats its own purpose.
- List every path connecting X and Y, not just the direct arrow.
- Classify each path. Does it start with an arrow into X (backdoor) or is it the causal path itself (through X, forward)?
- For each backdoor path, identify whether it is already blocked — a path is blocked if it contains a collider that isn’t conditioned on, or a non-collider that already is.
- Choose adjustment variables that block every remaining open backdoor path, preferring variables that block multiple paths at once and avoiding anything downstream of X.
- Check the chosen set doesn’t include colliders or mediators introduced by convenience (“it was in the dataset”) rather than by the diagram.
- Verify no new backdoor path opens once the chosen variables are conditioned on — this is the step “adjust for everything” skips, and it’s exactly where a collider does its damage.
Software tools exist that automate steps 2-7 once the DAG is specified (identifying all backdoor paths and testing candidate adjustment sets algorithmically) — useful for checking a diagram with more than a handful of nodes, but they don’t substitute for step 1: the causal assumptions still have to come from domain knowledge, not from the software.
Common mistakes this procedure prevents
- “I adjusted for every variable measured at baseline.” Baseline timing alone doesn’t establish that a variable is a confounder — a baseline variable can still be a collider for a different backdoor path, or simply irrelevant, and including it adds variance without removing bias.
- “The variable was significantly associated with the outcome, so I kept it in the model.” This selection rule cannot distinguish a confounder from a collider or a mediator — all three are typically associated with the outcome; only the DAG position determines which ones belong in the adjustment set.
- Treating “adjusted” as synonymous with “more rigorous.” The simulation above shows an adjusted model (with the collider added) landing further from the truth than the unadjusted one, and a correctly minimal adjustment recovering it exactly. The correctness of an adjustment set depends entirely on which paths it blocks, not on its size.
- Confusing effect modification with confounding on the diagram. A variable that modifies the size of the X-Y effect without itself being a common cause of X and Y is not addressed by backdoor closure at all — see Effect Modification vs. Confounding for that distinction.
Related CASRAI resources
This guide covers backdoor-path closure specifically. For the two structures that most often get confused with a confounder on a DAG, see Collider Bias (adjusting for a shared effect) and Mediator vs. Moderator (adjusting for a variable on the causal pathway itself). The underlying concept of a confounding variable is covered operationally in the Confounding Variable dictionary entry. For the broader causal-inference toolkit this adjustment-set procedure feeds into once the DAG is settled, see Causal Analysis, Inverse Probability Weighting, and Doubly Robust Estimation. Where the concern is a confounder that changes over time in response to earlier exposure — a case the static backdoor criterion above does not cover on its own — see Marginal Structural Models and G-Computation. When no measured variable can fully close a backdoor path, Instrumental Variables is the alternative identification strategy, and Correlation vs. Causation covers the broader distinction this whole framework exists to formalize. See also Endogeneity: Sources and Remedies and Selection Bias for adjacent sources of the same X-Y association going wrong for reasons other than an unclosed backdoor path.
Frequently asked questions
Is a DAG required, or can I just list confounders from subject-matter expertise?
Subject-matter expertise is exactly what populates the DAG — the diagram doesn’t replace domain knowledge, it forces that knowledge into an explicit, checkable structure. The value of drawing it out is that “list the confounders” alone gives no systematic way to catch that a variable you’re tempted to add is actually a collider or a mediator; tracing paths does.
What if two analysts draw different DAGs for the same question?
That’s expected and is a feature, not a failure: the DAG makes the disagreement explicit and arguable (which arrow is wrong, and why) instead of leaving it buried inside an unexplained variable-selection decision. Sensitivity analysis across a small number of plausible competing DAGs is standard practice when the causal structure is genuinely contested.
Does the backdoor criterion apply to logistic regression and survival models, not just linear regression?
The criterion for which variables to condition on is model-agnostic — it comes from the DAG, not from the outcome model. What changes across model types is how cleanly the resulting coefficient maps onto a causal effect (collapsibility issues in logistic regression are a separate, well-known complication on top of confounder selection, not a reason to skip the DAG step).
Can adjusting for a collider ever be justified?
Only when the analytic goal is something other than an unconditional causal effect — for example, deliberately estimating a controlled direct effect, or explicitly modeling selection into a sample as its own step (with methods designed for that, like inverse-probability-of-selection weighting) rather than adjusting for the collider directly inside the outcome model.








