Section 4.7

Causal DAGs & Confounding

"Correlation isn't causation" is where most stats courses stop. Causal inference is where you start asking the follow-up: under what assumptions would this association reflect a cause? The modern toolkit begins with a picture, a DAG (directed acyclic graph) of what you believe causes what, and the picture tells you which variables to adjust for. The twist: adjusting for the wrong variable doesn't just fail to help. It can manufacture bias out of thin air.

Confounders: the classic villain

A confounder Z is a common cause of both your predictor X and outcome Y (Z → X and Z → Y). It opens a "backdoor path" X ← Z → Y that mixes a spurious association into the X–Y relationship. The naive regression of Y on X then reports the causal effect plus the backdoor contamination. The fix you already know from multiple regression: include Z in the model, closing the backdoor, and the X coefficient recovers the true effect.

Colliders: the trap nobody warns you about

Now flip the arrows. A collider C is a common effect: X → C ← Y. That path is naturally blocked: colliders don't bias anything if you leave them alone. But condition on C (adjust for it, select on it, stratify by it) and you open the path, creating a spurious association between X and Y that wasn't there. This is why "control for everything you measured" is terrible advice: whether adjustment helps or hurts depends entirely on the causal structure, which is exactly what the DAG makes explicit.

🎮 Adjust, or Don't: Confounder vs Collider

The graph shows the true causal structure generating the dots below (colored by the third variable: teal = low, indigo = mid, orange = high). Compare the naive slope to the adjusted one against the true effect you set. Then switch structures and watch the right move become the wrong one.

True effect β
Naive slope (Y ~ X)
Adjusted slope

The backdoor rule of thumb

The general recipe (Pearl's "backdoor criterion") boils down to: adjust for common causes, never for common effects, and leave mediators alone unless you specifically want the direct effect (see mediation). Colliders also explain a family of famous paradoxes (selection bias, "why are attractive people jerks in my dating pool," Berkson's hospital paradox), which are all collider conditioning by another name.

The alternative to adjusting at all

Everything above is what you do when the exposure was not under your control. Random assignment solves the same problem at the design stage and solves it better: if a coin decides who gets X, then nothing that came earlier can be a cause of X, so every backdoor path into X is closed before you collect a single observation, including the paths through variables you never thought to measure. That last clause is the part adjustment can never match, because the backdoor criterion only closes paths through variables you have. When randomization is impossible, quasi-experimental designs try to recover some of the same leverage from a naturally occurring assignment rule, and a DAG is how you argue that the attempt worked.

What a DAG buys you

A DAG will not tell you whether your arrows are right: that's subject-matter knowledge. What it does is make your assumptions public and checkable, and turn "which covariates should I include?" from a fishing expedition into a derivation. Two researchers who agree on the graph must agree on the adjustment set; two who disagree can now argue about the actual disagreement.

Why it matters: statistical adjustment is a scalpel, not a vacuum cleaner. Controlling for a confounder removes bias; controlling for a collider creates it — and the data alone can't tell you which is which. Only a causal model of how the data came to be can.

Problem 38 of the practice problems hands you a press release about an optional online module that "raises exam scores" by nine marks, and asks you to name the confounding that self-selection introduced and say what design would have answered the question properly.

Common questions

What is a collider in simple terms?

A variable caused by two others: X → C ← Y. Left alone, it transmits nothing. But select or adjust on it and you create a spurious X–Y association. The classic intuition: among hospitalized patients (being hospitalized = the collider), two diseases look negatively correlated even if independent in the population — because having either one is enough to get you admitted.

Should I control for every variable I measured?

Emphatically no: "kitchen-sink regression" is a recipe for bias, not rigor. Adjusting for confounders (common causes) removes bias; adjusting for colliders (common effects) creates it; adjusting for mediators erases the very effect you're estimating. Since the data alone can't tell these apart, the covariate list must come from a causal diagram of how the data was generated. That's the DAG's whole job.

What if I can't tell whether a variable is a confounder or a collider?

The data will not tell you, and this is the part people find hardest to accept: adjusting for either one changes your estimate, and the output looks equally respectable both ways. The decision has to come from what you know about how the variables arose. The most useful practical handle is time: a variable measured before X was in place cannot be a common effect of X and Y, so it is a confounder candidate rather than a collider. Anything measured after both is the opposite worry. When temporal order genuinely does not settle it, do not split the difference. Draw the two graphs, report the adjustment set implied by the one you think is right, and show the other as a sensitivity analysis, so a reader who disagrees with your arrow can see what their assumption would have produced.