Skip to content
Tutorials Center
My learning

Topics

Lesson 16 of 37 ยท Graphs and Identification

The Backdoor Criterion and Adjustment Sets

Use the backdoor criterion to pick a valid adjustment set from a causal DAG: block confounding paths, avoid mediators and colliders, and verify the choice by simulation in Python.

The big practical question in observational studies is: which variables should I adjust for? The backdoor criterion (Judea Pearl) answers it from the causal graph. It replaces "control for everything" and "control for what is correlated" with a precise rule.

The criterion

A set of variables Z satisfies the backdoor criterion for the effect of T on Y if

  1. Z contains no descendant of T (nothing caused by the treatment), and
  2. Z blocks every backdoor path from T to Y, that is, every path that starts with an arrow into T.

If so, the causal effect is identified by adjusting for Z:

TEXT
P(Y | do(T = t)) = sum over z of  P(Y | T = t, Z = z) * P(Z = z)

This is the stratification formula from stratification and standardization, now justified by a graph.

Worked example

flowchart LR
  A["Age"] --> T["Treatment"]
  A --> Y["Outcome"]
  W["Wealth"] --> T
  W --> H["Health"]
  H --> Y
  T --> Y
  T --> M["Side effect"]
  M --> Y

Causal path: T -> Y and T -> Side effect -> Y. Backdoor paths: T <- Age -> Y, and T <- Wealth -> Health -> Y.

Valid adjustment sets:

  • {Age, Wealth}: blocks both backdoor paths.
  • {Age, Health}: blocks the second path at Health instead.
  • {Age, Wealth, Health}: also valid.

Invalid sets:

  • alone leaves the Wealth path open.
  • {Age, Wealth, Side effect} violates rule 1: Side effect is a descendant of the treatment, and adjusting for it blocks part of the effect.

Verifying the choice by simulation

Python Valid versus invalid adjustment sets

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

{age, wealth} and {age, health} both give about 2.9. is still biased. Adding side removes the mediated part and gives only the direct 2.0, answering a different question.

Finding adjustment sets with code

You can automate the rule for small graphs: enumerate backdoor paths, then test candidate sets. The helper below implements d-separation checking by blocking rules on simple paths.

Python A tiny backdoor checker

Press Run (or Ctrl + Enter) to see the result here.

Program input ยท what you'd type while the program runs

Type the answers before you press Run, one per line. Each time the program reads a line (with input()), it gets the next line from this box.

The output lists every valid set; the empty set and are missing, as are all sets containing Side. For larger graphs, libraries such as DoWhy or pgmpy automate this, but the logic is exactly this.

Minimal adjustment sets and practical advice

  • Several valid sets usually exist. Prefer ones made of well-measured variables, and small ones for efficiency.
  • Variables that cause only the outcome ("precision variables") do not remove bias but can shrink variance.
  • Variables that cause only the treatment (instrument-like) can hurt precision and amplify bias from hidden confounding. Do not add them without reason.
  • If a backdoor path goes through an unmeasured variable and no valid set exists, the effect is not identified by adjustment. Look for instrumental variables, a front-door path or a different design.

Pre-treatment is not the same as "safe". A pre-treatment variable can still be a collider (see selection and collider bias), and adjusting for it can create bias. Check against the graph.

Check your understanding

Quick check ยท 4 questions

of 4 answered You scored / 4 ยท perfect!

  1. 1. A backdoor path from T to Y is a path that:

    Backdoor paths begin with an arrow pointing into the treatment and carry non-causal association.
  2. 2. Which variables must a backdoor adjustment set NOT contain?

    Adjusting for descendants (mediators, colliders from the effect) can block causal paths or open new ones.
  3. 3. In the simulation, adjusting for {age} alone was still biased because:

    Both backdoor paths must be blocked.
  4. 4. A variable that affects only the outcome, when added to the adjustment set, mostly:

    It soaks up outcome noise without being a confounder.

Summary

  • The backdoor criterion: block all backdoor paths and include no descendants of the treatment.
  • Several adjustment sets can be valid; invalid ones include missing confounders and mediators.
  • Check choices by simulation and by code that tests d-separation.
  • When no valid set exists because of unmeasured confounding, you need other identification strategies.

Next: Mediators and Bad Controls