2  What to adjust for: DAGs, intermediates, and colliders

“Put every variable that might be related into the model for now” is a common policy, but there are also variables you must not put in. In this chapter, we use simulations where the answer is known to check which variables should be adjusted for and which should not.

A diagram that draws the causal direction between variables as arrows is called a DAG (directed acyclic graph). Adjustment variables are chosen by distinguishing the following three shapes in the DAG.

Shape Diagram Adjusting for a third variable Z
Confounding (fork) X ← Z → Y A spurious association disappears (should adjust)
Intermediate (chain) X → Z → Y Part of the effect of X disappears (do not adjust if you want the total effect)
Collider X → Z ← Y An association that did not exist appears (must not adjust)

In the simulations below, we decide the true effect of X on Y ourselves, and see which adjustment recovers that value.

2.1 Confounder: adjusting gives the right answer

Suppose Z (e.g., age) affects both X (e.g., smoking) and Y (e.g., blood pressure), and X does not affect Y (true effect = 0).

Without adjustment, the coefficient of X is about 0.5, and X appears to have an effect. Adjusting for Z brings it back to almost 0 (the true value).

flowchart LR
  Z["Z (confounder)"] --> X
  Z --> Y
  X -. "effect 0" .-> Y

2.2 Intermediate: adjusting removes the effect

This is the case where X affects Y through Z (X → Z → Y). For example, the pathway in which obesity (X) raises blood pressure (Z), and blood pressure increases cardiovascular disease (Y).

  • Unadjusted: 0.54 (the theoretical value is the total effect 0.55, the direct effect 0.2 plus the effect through Z, 0.35)
  • Adjusted for Z: 0.20 (the part through Z disappears, leaving only the direct effect)

If you ask “does obesity increase cardiovascular disease?”, what you want is the total effect. Adjusting for blood pressure subtracts the part of the effect of obesity that works by raising blood pressure (overadjustment).

2.2.1 Real data: BMI and cardiovascular disease

A BMI 5 units higher gives a CVD odds ratio of 1.35, but adjusting for blood pressure shrinks it to 1.18. It is not about which one is “correct”: the variables to adjust for differ depending on the question (the total effect, or the effect not mediated by blood pressure).

2.3 Collider: adjusting creates an association that did not exist

This is the case where X and Y are both causes of Z (X → Z ← Y). Assume that there is truly no relation between X and Y.

Without adjustment it is 0, but adjusting for Z created a strong association of −0.48.

2.3.1 “Selecting” on a collider is the same as adjusting

Even without putting it in the model, the same thing happens if you select participants by the value of a collider. For example, even if two diseases X and Y are completely unrelated, when having either one makes hospitalization more likely, studying only hospitalized patients shows a negative association between X and Y (Berkson’s bias).

In everyone the odds ratio is 1 (unrelated), but among inpatients only it is 0.20, and Y appears less common when X is present. When you study only hospital patients, only people who joined a study, or only people who were tested, consider whether the way they were selected forms a collider.

NoteThe “obesity paradox” and colliders

In patients with heart failure or on dialysis, it is often reported that “heavier people have a better prognosis”. One proposed explanation that has been debated is that, because only people who became ill are selected (the disease is a collider arising both from obesity and from other serious causes), a negative association arises between obesity and other risk factors.

2.4 Variables that affect only the outcome, or only the exposure

Variable Adjusting for it
A cause of Y only (e.g., a strong predictor of Y) Bias is unchanged and the estimate becomes more precise (linear regression). Fine to adjust
A cause of X only (e.g., prescribing policy, an instrumental variable) Bias is not reduced and the estimate becomes unstable. It can even amplify residual confounding
A consequence of X (something that happened after X) Can be an intermediate or a collider. As a rule, do not adjust

2.5 Do not interpret the coefficients of adjustment variables

Suppose you built a model adjusted for age and sex in order to estimate the effect of smoking.

Reporting the odds ratios for age or sex from this model as “the effect of age” or “the effect of sex” is a mistake (the Table 2 fallacy). The adjustment variables chosen for the effect of smoking differ from the variables needed to estimate the effect of age (e.g., smoking can be an intermediate between age and death). From one model, report the effect of one exposure only.

ImportantSummary of this chapter
  • Choose adjustment variables by distinguishing confounding (fork), intermediates (chain), and colliders in a DAG (a diagram of causal arrows)
  • Adjust for confounders. Adjusting for an intermediate removes part of the effect (overadjustment). Adjusting for or selecting on a collider creates an association that did not exist
  • As a rule, do not adjust for things that happened after the exposure
  • Report only one exposure’s effect from one model (the Table 2 fallacy)