Causal inference
Causal DAGs and Assumption Maps
Represent causal assumptions with directed acyclic graphs, paths, d-separation, adjustment sets, and graph uncertainty.
By the end you can
- Interpret nodes, arrows, paths, ancestors, and descendants in a causal DAG
- Use d-separation to reason about conditional independencies
- Identify backdoor paths and candidate adjustment sets
- Document uncertainty when more than one causal graph is plausible
Example
The sample was selected on 811 characteristics at once
UK Biobank has 486,967 participants. When the cohort was turned on the question of who catches COVID-19 and who gets severely ill, only 1,410 of them had COVID-19 testing data at the time of the analysis. Everyone else had no test result to model. So the analysis ran on the tested. Being tested looked like a matter of data availability rather than a matter of biology.
It was not data availability. Someone checked 2,556 participant characteristics, one by one, against whether a person had been tested at all. 811 of them — 32 per cent — came back with a false discovery rate below 0.05. Griffith and colleagues ran that check in 2020. Whether a person was inside the analysed sample was itself caused by hundreds of the things anyone would want to study.
That is the structure, and it is worth being slow about. Being tested is a variable that many other variables point into: symptoms, health status, occupation, willingness to present, age. Restricting the analysis to tested people means conditioning on that variable. Conditioning on it changes what the remaining participants look like. Among the tested, someone with no routine reason to be tested was more likely to be there because they were unwell. So the exposures and the outcome arrived in the data linked to each other. Nothing had linked them in the cohort before anyone was selected.
The estimate was not merely noisy. It was produced by the step that was supposed to make the data usable. The paper in Nature Communications opens by saying so: “Collider bias can induce associations between two or more variables which affect the likelihood of an individual being sampled, distorting associations between these variables in the sample.”
What separates a variable that is safe to adjust for from one that wrecks the study is not how useful it looks in a model. It is where it sits in the causal story. There are only a few questions to ask of it. Baseline severity: does it cause both the treatment decision and the outcome? Adherence: is it itself affected by the treatment, and by prognosis? Selection into the sample: do exposure and outcome risk both influence who gets tested, recruited or retained at all? The measurement device: does one shared artifact make the observed variables move together for reasons that have nothing to do with the people?
- An arrow in the graph is a claim that one variable acts directly on another, and the study assumes it rather than demonstrates it.
- A path is any chain of links joining two variables, and it still counts when some of its arrows point back the way you came.
- A collider is a variable that two others both point into, the place where two separate causes meet — being tested for COVID-19 was pointed into by 811 measured characteristics at once.
- Condition on a collider, or on anything downstream of one, and you can open a path that was shut until you touched it.
Analogy
Association travels backwards along an arrow as easily as forwards
A route from treatment to outcome does not have to run forward. It can leave the treatment, climb backwards up an arrow into a common cause, and come down the far side into the outcome. The association it delivers arrives in the data looking exactly like an effect.
So trace routes the way you would trace a journey across a network: the direct line, the detours through a shared origin, and the interchanges that stay shut until someone opens them. The interchanges are the colliders. One of them has been watched being opened, in a real birth cohort, with the numbers written down.
ALSPAC recruited 14,541 pregnancies with due dates between 1 April 1991 and 31 December 1992 — 75 per cent of the eligible women. Who stayed in the study was itself caused by the traits under study. Among 11,319 mothers, the odds of later retention fell with body mass index (OR 0.85 per SD, 95% CI 0.81 to 0.88). Among smoking mothers they fell with heaviness of smoking (N = 3,534, OR 0.97 per extra cigarette/day, 95% CI 0.96 to 0.98). Then look at ARIES, a sub-study of 1,018 mother-offspring pairs selected on DNA availability. There, a smoking genetic risk score was associated with maternal education. In the full ALSPAC sample that association is absent. Same two variables, no link in the cohort, a link in the sub-sample. Nothing sits between the two but who was left. Munafò and colleagues published those numbers in 2018.
Their abstract puts the general case: “In simulations, we show that even modest influences on selection into, or attrition from, a study can generate biased and potentially misleading estimates of both phenotypic and genotypic associations.”
A network map, though, is a thing you can go out and observe. A causal graph is a set of claims somebody made about how the world works. Any line in it can be wrong.
Adjustment is a decision about which routes to block, not a contest about which variables predict best.
A DAG is a compact record of causal assumptions
A causal DAG holds the variables and the direct relations someone is willing to assume between them, with no cycles allowed. What it buys you is the ability to tell a causal path from a backdoor path, and to see in advance whether conditioning on a variable will block an association or manufacture one.
No software builds this graph for you out of a correlation matrix. Correlation is symmetric and the graph is not, so direction has to come from elsewhere: from what practitioners know about the domain, from what happened before what, from how the measurements were actually taken, from how people ended up in the sample, and from the rival explanation a colleague would offer if you asked them to attack the study.
This matters more here than it does in prediction work, because one measured column can demand opposite handling depending only on its position. A confounder is a common cause of treatment and outcome, and leaving it alone leaves a backdoor path open. A mediator carries part of the effect you are trying to measure, and adjusting for it quietly deletes the part it carries. A collider is the common effect of two variables, and adjusting for it opens the path that being tested for COVID-19 opened.
One column has been put through those roles in public. Among US infants born in 1991, infants of smokers had higher risks of both low birth weight and infant mortality. That is the direction anyone would expect. Now stratify on birth weight. Within the low-birth-weight stratum, mortality was lower for infants of smokers: relative rate = 0.79. The sign reverses. Nothing about smoking became protective. Birth weight is affected by the exposure and shares common causes with the outcome, so stratifying on it is conditioning on a collider. The reversal is the artifact of the stratification rather than a finding inside it. Hernández-Díaz and colleagues drew that out in 2006, and concluded: “Under realistic causal diagrams, adjustment for birth weight is unwarranted when the analytical goal is to estimate overall effects of prenatal variables on infant mortality.”
Same column, same summary statistics, opposite instruction.
A DAG makes assumptions inspectable; it does not turn an uncertain arrow into a fact.
Visual
The last step in the trace is the one that gets skipped
Name the variables first, including the ones that decide who is in the sample at all, because a variable nobody wrote down cannot be argued about. Then draw the arrows you are prepared to defend, and only those. Then enumerate the paths joining treatment to outcome, forward routes and backward ones alike. Then apply d-separation to each path, to see which are already closed, which are open, and which a candidate adjustment set would close or open.
That much most teams are assumed to manage. Somebody counted instead of assuming. A 2021 review by Tennant and colleagues went through every health research article published between 1999 and 2017 that mentioned directed acyclic graphs or cited DAGitty. 234 of them reported using one. A fifth — 48 papers, 21 per cent — reported the target they were trying to estimate. About half, 115, reported the adjustment set their own graph implied. Only 144, 62 per cent, made any DAG available at all. The graphs themselves averaged 12 nodes (IQR 9-16) and 29 arcs (IQR 19-42), with median saturation 46 per cent. Only 53 of them — 37 per cent — included a single unobserved variable. Most of them quietly asserted that nothing anyone had failed to measure mattered.
So the drawing gets done and the trace gets skipped. The step that gets left off most reliably is the last one: stress the graph. Take the arrow you are least sure of, flip it or delete it, redraw, and run the same trace again.
If the adjustment set survives that, you have a decision. If it does not, what you have is a question, and the honest output of the exercise is the question.
- 1
Define variables
Include treatment, outcome, common causes, selection, and measurements.
- 2
Draw causal arrows
Use temporal and domain constraints, not observed correlation alone.
- 3
Enumerate paths
Separate directed causal paths from backdoor paths.
- 4
Apply d-separation
Determine which paths are blocked by a candidate set.
- 5
Stress graph uncertainty
Repeat the conclusion under plausible alternative graphs.
Key idea
Adjusting for everything is not a safe default
The belief that produced the COVID-testing result is that one more control can only help. It can hurt in three separate ways, and they are not versions of one another.
Adjust for a mediator and you strip out part of the very effect you set out to measure. The estimate shrinks, and the shrinkage reads as evidence that the treatment does little. Adjust for a collider and you invent an association where there was none, as restricting to the tested did. Adjust for something the treatment itself caused, a descendant of treatment, and you are no longer measuring the treatment, because part of what you are holding fixed is the treatment's own work.
The third one has a number attached to it, and the number is enormous. The Coronary Drug Project was a five-year randomised trial in 8,341 men with prior myocardial infarction. Five-year mortality was 20.0 per cent in the 1,103 men on clofibrate and 20.9 per cent in the 2,789 on placebo. The randomised comparison found essentially nothing. Then split the trial by adherence. Inside the placebo arm alone, where every capsule was inert, mortality was 15.1 per cent among good adherers — those taking at least 80 per cent of the protocol prescription — and 28.3 per cent among poor adherers (P = 4.7x10-16). Thirteen points of mortality, in a group that received no drug at all. It was produced entirely by conditioning on a variable the treatment itself could affect.
The investigators said so themselves, in the New England Journal of Medicine in 1980: “These findings and various other analyses of mortality in the clofibrate and placebo groups of the project show the serious difficulty, if not impossibility, of evaluating treatment efficacy in subgroups determined by patient responses (e.g., adherence or cholesterol change) to the treatment protocol after randomization.”
The same data were re-analysed in 2018. Murray and Hernán used inverse-probability weighting on post-randomisation predictors, and the 5-year mortality risk difference between placebo adherers and non-adherers came down to 0.01 percentage points (95% CI -12.2, 13.2). The 13 points were the adjustment, not the patients.
So the adjustment set is chosen from the causal question and the graph, never from a ranking of how much each variable helps the fit. Selecting features to predict well and selecting covariates to estimate an effect are different problems that happen to be typed into the same function call.
A variable can improve prediction and still make a causal estimate worse.
Steps
Draw the graph your critic would draw
Build more than one plausible DAG, and not as a formality. Build the version a skeptical colleague would defend. Build the version where the arrow you are least confident about points the other way. Build the version where selection into the sample is drawn explicitly instead of assumed away — the version that would have caught the COVID-testing problem before anyone estimated anything.
The bill for skipping that arrives itemised. Decades of observational studies suggested hormone therapy protected postmenopausal women against coronary heart disease. Then the Women's Health Initiative randomised 16,608 women aged 50-79 with an intact uterus, recruited by 40 US clinical centres in 1993-1998. 8,506 took conjugated equine estrogens plus medroxyprogesterone acetate; 8,102 took placebo. The trial found the opposite of protection. CHD hazard ratio 1.29 (nominal 95% CI 1.02-1.63, 286 cases). Invasive breast cancer 1.26 (1.00-1.59, 290 cases). Stroke 1.41 (1.07-1.85, 212 cases). Pulmonary embolism 2.13 (1.39-3.25, 101 cases).
The trial's own report in JAMA states what followed: “On May 31, 2002, after a mean of 5.2 years of follow-up, the data and safety monitoring board recommended stopping the trial of estrogen plus progestin vs placebo because the test statistic for invasive breast cancer exceeded the stopping boundary for this adverse effect and the global index statistic supported risks exceeding benefits.” The NHLBI stopped that arm and announced the decision on 9 July 2002. The rival graph won, and it won expensively.
What repaired the disagreement is the part worth copying. The trial's design was emulated inside the Nurses' Health Study, an observational cohort. The emulation recovered intention-to-treat hazard ratios of 1.42 (0.92-2.20) for the first two years and 0.96 (0.78-1.18) over full follow-up. Hernán and colleagues attributed the original discrepancy to time since menopause and length of follow-up, not to the data being observational. The fix was a re-specified estimand and an eligibility structure drawn out in the open — the things a graph forces you to write down. It was not another column of controls.
So run the trace on each of your graphs. Write down which conclusions hold across all of them and which depend on a single disputed arrow. That list is the real product of a graph review. It says, before an estimate exists, precisely which argument someone has to win for your result to stand.
- 1
Set the estimand
Total, direct, mediated, or policy effect.
- 2
Draw the primary graph
Use domain experts and time ordering.
- 3
Propose alternatives
Reverse uncertain arrows or add latent common causes.
- 4
Find adjustment sets
Check backdoor paths for each graph.
- 5
Record fragile claims
Identify estimates that change across plausible structures.
What the graph is worth when it cannot settle the question
A graph earns its keep at the moment it forces a room full of people to disagree out loud. What counts as the treatment, and is it the same treatment for everyone who received it. What happened before what. Who entered the sample, and what decided that. Whether the instrument was measuring the patient or partly measuring itself. Which common causes nobody recorded. Those arguments are worth having, and without something drawn on a page they tend not to happen at all.
Which is why the graph belongs with the analysis rather than in a slide someone made once. Version it beside the code. Tie each arrow to the assumption it stands for, so a reader can see which claim a given number is leaning on.
Sometimes the disagreement does not resolve. Two graphs both survive scrutiny and imply different adjustment sets, or different estimands altogether. Report that, rather than picking the graph with the cleaner answer. Then reach for something that can actually help: show how far the conclusion moves as the disputed arrow changes, find a design that does not depend on that arrow, or state the range of effects the data can support instead of one number it cannot.
That last instruction is not this lesson's opinion. Medicines regulators already enforce it, in a numbered guideline. ICH E9(R1) was adopted on 20 November 2019 and came into effect on 30 July 2020. It requires that the target of estimation be fixed before the method of analysis: “The targets of estimation are to be defined in advance of a clinical trial.” Its glossary then defines a sensitivity analysis as “A series of analyses conducted with the intent to explore the robustness of inferences from the main estimator to deviations from its underlying modelling assumptions and limitations in the data.” Assumptions documented and stress-tested, in other words, instead of assumed away. That is the same instruction as stressing the graph. A regulator wrote it, and gave it a document number.
The graph's job is to make the assumptions contestable while there is still time to change the study.
Key takeaways
- A causal DAG records the direct relations you are assuming, not relations the data established. Of 234 DAG-using health papers reviewed, only 48 — 21 per cent — reported the estimand those assumptions were meant to serve.
- d-separation is the rule that turns the shape of a graph into a claim about which associations should be absent.
- A backdoor path carries association from treatment to outcome without any effect travelling along it.
- Conditioning on a collider, or on something a collider caused, can open a biasing path that was closed: 811 of 2,556 characteristics predicted being tested for COVID-19 in UK Biobank, and stratifying on birth weight made smoking look protective at relative rate = 0.79.
- Which variables belong in the adjustment set follows from the estimand and the graph, not from predictive strength. Adherence split the Coronary Drug Project's placebo arm 15.1 against 28.3 per cent mortality with no drug involved, and inverse-probability weighting reduced that difference to 0.01 percentage points.
- Where rival graphs are equally defensible, carry them into the sensitivity analysis instead of quietly choosing one; ICH E9(R1) requires exactly that of clinical trials.