Confounders, Mediators, and Colliders
Whether to adjust for a variable depends on its place in the causal structure and on the estimand. The same measured attribute can play different roles in different questions or graphs.
Prerequisites
Complete Causal Graphs and DAGs. Keep the target as the total effect of assigning Study Sprint access on final score.
Learning goals
- Distinguish confounders, mediators, and colliders by graph position.
- Choose adjustment variables relative to a stated estimand.
- Recognize overadjustment and collider-selection bias.
Three roles
Confounder
Prior preparedness is a common cause when and . The backdoor path mixes the treatment contrast with pre-existing differences. Adjusting for an adequate measurement of can help exchange treated and untreated students within preparedness levels.
A confounder must be defined relative to an exposure-outcome contrast and time order. A variable cannot be a pre-treatment confounder if treatment causes it.
Mediator
Study hours may lie on . For the total effect, conditioning on post-assignment study hours removes part of the pathway being estimated and may introduce additional bias if mediator-outcome causes are uncontrolled. A direct-effect question is a different estimand and requires stronger, specialized assumptions; “add the mediator to a regression” is not a complete mediation analysis.
Collider
Suppose survey response is caused by program engagement and exam outcome: . The path through is closed without conditioning. Analyzing only survey respondents, controlling for , or controlling for its descendants can open an association between its causes. This is selection bias, even if survey response strongly predicts the outcome.
A decision workflow
- State the treatment, outcome, population, follow-up, and total or direct effect.
- Establish temporal order and draw plausible causal structures.
- Seek a sufficient pre-treatment adjustment set that blocks noncausal paths.
- Do not adjust for variables merely because they predict treatment or outcome.
- Compare conclusions across plausible graphs and document unmeasured common causes.
Baseline variables can improve precision in a randomized study, but randomization—not prediction—supplies exchangeability. In observational data, measured adjustment addresses only the common causes adequately represented by the chosen set.
Assumptions and limits
Calling prior preparedness a sufficient confounder assumes no remaining common cause of enrollment and score after adjustment, meaningful measurement, correct timing, and overlap across enrollment groups. These claims cannot be certified by covariate balance or a high-dimensional model alone.
The labels are graph-dependent. For example, attendance can be a mediator of assignment-to-access but part of the treatment definition in an attendance intervention. Redefining the treatment changes the graph and estimand.
Common mistakes
- Using “confounder” as a synonym for any correlated covariate.
- Adjusting for all available columns, including post-treatment variables.
- Selecting controls solely by p-value or feature importance.
- Restricting to complete cases without graphing why values are missing.
- Interpreting a smaller coefficient after mediator adjustment as the indirect effect.
Practice
Classify baseline motivation, post-assignment study hours, and voluntary survey response in two different graphs. Explain which variables you would adjust for when estimating the total effect and why.
Next steps
Potential Outcomes connects these graph-based decisions to formal treatment contrasts.
Primary sources
Checked 2026-10-15: Greenland, Pearl, and Robins, “Causal Diagrams for Epidemiologic Research” and Hernán and Robins, Causal Inference: What If.