Part 4 · Module 5

Introduction to Causal Diagrams

Learn to use directed acyclic graphs to express causal assumptions, recognise biasing paths and select defensible covariate adjustment sets.

Learning outcomes

After completing this lecture, you should be able to:

  • explain the purpose and basic elements of a directed acyclic graph
  • distinguish causal, backdoor and non-causal paths among variables
  • identify confounders, mediators, colliders and descendants within a simple graph
  • use a causal diagram to propose a minimally sufficient adjustment set for a defined effect
  • explain the limitations of causal diagrams and the consequences of an incorrectly specified graph

Overview

A directed acyclic graph (DAG) is a diagram that represents assumptions about causal relationships. Variables are shown as nodes, and arrows indicate assumed direct causal effects. Directed means that every arrow has a direction. Acyclic means that following arrows forward cannot return to the starting node.

DAGs help researchers move from an unstructured list of covariates to an explicit causal model. They can identify variables that should be measured and adjusted for, variables that should not be adjusted for, and assumptions that need scrutiny. Their use in epidemiology was formalised through graphical causal models and has become influential in study design and analysis [1–3].

A DAG does not prove causality, estimate effect size or compensate for poor data. It makes causal assumptions visible so that they can be criticised and linked to an analysis plan.

Why this matters

“Adjust for all available variables” is not a safe rule. Adjusting for a mediator can remove part of the total effect. Adjusting for a collider can create an association that was not present. Failing to adjust for a common cause can leave confounding. These problems cannot be resolved by choosing variables solely through statistical significance.

A DAG also forces the team to define the exact causal question. The adjustment set for the total effect of appointment booking on test completion may differ from the set needed for the direct effect not operating through reminders.

Basic language of a DAG

Nodes

A node represents a variable or set of variables. For a causal effect question, clearly mark the exposure or intervention and outcome.

Directed arrows

An arrow A → B means that, within the assumed causal model, changing A could directly change B while other represented causes are held appropriately. It does not mean merely that A precedes or predicts B.

Absence of an arrow

Leaving out an arrow is also an assumption: no direct causal effect is represented between those nodes. Researchers often focus on arrows they draw but overlook the claims implied by omitted arrows.

Paths

A path is any sequence of connected nodes, regardless of arrow direction. A causal path follows arrows from exposure to outcome. A backdoor path enters the exposure through an arrow pointing into it and can transmit non-causal association.

Ancestors and descendants

An ancestor has a directed path to another node. A descendant lies downstream. Exposure descendants require particular care because they may be mediators, consequences or selection variables.

Acyclicity

A DAG cannot contain feedback loops. Real systems may have feedback over time, but they can often be represented using time-indexed nodes such as symptoms at baseline, treatment adherence at month 1 and symptoms at month 3.

Three structures to recognise

Common cause: the fork

C → A
C → Y

C is a common cause of exposure A and outcome Y. The path A ← C → Y is open and can confound the A–Y association. Adjustment for C may block this path if C is measured adequately.

Mediation: the chain

A → M → Y

M is on the causal pathway. When the target is the total effect of A on Y, conditioning on M blocks part of the effect. When the target is a direct effect, mediation analysis requires additional assumptions and methods.

Collider: the inverted fork

A → S ← Y

S is a collider because two arrowheads meet at it. The path between A and Y through S is closed unless S or one of its descendants is conditioned on. Restricting, matching, adjusting or selecting on S can open the path and create collider bias.

Causal structures and adjustment implications

illustrative

Table 1. Basic patterns

StructureSimple graphTypical implication for total-effect estimation
ConfoundingA ← C → YBlock the non-causal path by appropriate control for C
MediationA → M → YDo not adjust for M when targeting the total effect
ColliderA → S ← YDo not condition on S or its descendants without a specific identification reason
Independent cause of outcomeP → YMay improve precision but is not required to remove confounding if unrelated to A

Building a DAG prospectively

1. Specify the target effect

State the population, exposure or intervention contrast, outcome, time horizon and whether the target is total, direct or another effect.

2. Set the causal time order

Place variables according to when they occur in the causal process, not according to column order. Use repeated nodes when status changes over time.

3. Include common causes

Ask what causes the exposure and what causes the outcome. Include relevant common causes even when they are unavailable in the dataset. An unmeasured node is still useful because it reveals possible residual confounding.

4. Include consequences of exposure and outcome

Mediators, treatment changes, surveillance intensity, participation and loss to follow-up may create important pathways.

5. Draw arrows based on knowledge

Use substantive evidence, temporality, biological or service mechanisms and stakeholder knowledge. Do not let sample correlations determine the graph; statistically equivalent data patterns can be compatible with different causal structures.

6. Simplify without changing the question

A DAG need not contain every minor determinant. Variables can sometimes be grouped when they share the same structural role, but grouping should not hide a relevant pathway.

7. Review competing assumptions

Invite subject-matter experts, methodologists and stakeholders to challenge arrows and omissions. Consider alternative plausible DAGs and whether the adjustment set is robust.

Document the DAG development process

  • exact causal question and target effect;
  • exposure, outcome and time origin;
  • evidence used for arrows and omitted arrows;
  • measured and unmeasured nodes;
  • proposed adjustment set and graphical rationale;
  • variables intentionally excluded from adjustment;
  • alternative plausible structures;
  • software and graph version, when used; and
  • planned sensitivity analyses for unresolved assumptions.

A DAG for the illustrative study

Let:

  • B = appointment booking before discharge;
  • Y = test completion by day 112;
  • C = clinic capacity;
  • H = previous health engagement and history;
  • R = reminder receipt after booking;
  • I = interview participation.

The team proposes:

C → B
C → Y
H → B
H → Y
B → R
R → Y
B → Y
H → I
Y → I

This textual representation is illustrative. It implies two backdoor paths from B to Y:

  • B ← C → Y
  • B ← H → Y

Adjusting for C and H blocks those paths. R lies on a causal pathway from B to Y, so adjusting for R would not estimate the total effect. I is a collider on H → I ← Y; restricting to interview participants could open a non-causal path and create selection bias.

DAG-informed variable decisions

illustrative

Table 2. Analysis implications of the proposed graph

VariableStructural roleMain decision
Clinic capacityCommon cause of booking and completionMeasure and control appropriately
Previous health engagementCommon cause of booking and completionMeasure and control appropriately
Reminder receiptPost-booking mediatorExclude from total-effect adjustment set; analyse as process/mechanism separately
Interview participationCollider/selection processDo not restrict the primary linked-record analysis to interview participants
Travel burdenCause of completion only in the simplest graphMay improve precision; reconsider if it also affects booking

The backdoor criterion in accessible terms

To estimate a total causal effect by covariate adjustment, the selected variables should block all open non-causal paths from exposure to outcome while leaving causal paths intact. A valid adjustment set should not include descendants of the exposure that create bias or remove part of the target effect.

A minimally sufficient adjustment set blocks the required paths with no unnecessary variables. There can be more than one valid minimal set. Choosing among them may depend on measurement quality, missingness and efficiency.

Graphical tools such as DAGitty can enumerate adjustment sets and identify implications, but the software cannot decide whether the causal assumptions are correct [2,3].

Why adjusting for more can increase bias

Overadjustment

Controlling for a mediator when estimating a total effect removes part of the pathway and can bias the target estimate. Adjustment for descendants of mediators can cause similar problems [4].

Collider stratification

Conditioning on a common effect of exposure and outcome—or of their causes—can induce association. Examples include restricting analysis to hospitalised patients, complete responders or people selected by a process influenced by both risk factors and outcomes.

Measurement error in confounders

Adjusting for a poorly measured confounder may leave residual confounding. Adding many weak proxies can also create instability and does not guarantee adequate control.

Unnecessary adjustment

A variable that causes only the exposure but not the outcome does not remove confounding and may reduce precision in some settings. A strong cause of the outcome may improve precision. DAGs clarify structural necessity, while statistical considerations help choose among valid sets.

Measured proxies and unmeasured common causes

A DAG should include a relevant common cause even when it cannot be measured. Omitting it from the graph because it is absent from the dataset hides the threat rather than solving it. The graph can show an unmeasured node U, and the protocol can then explain whether a measured proxy is available and how much residual confounding may remain.

A proxy is not equivalent to the underlying cause. A postcode-derived deprivation index may represent some material and environmental conditions but not all individual socioeconomic processes. A diagnosis code may proxy disease severity imperfectly. Adjustment for a noisy proxy can reduce confounding without eliminating it, and differential measurement can introduce additional bias.

When several measured variables are consequences of one unmeasured common cause, adjusting for all of them is not guaranteed to reproduce adjustment for the cause. Their structural positions matter. Some may be mediators or colliders. The DAG should therefore represent why each proxy is generated, not merely label it as a substitute.

Choosing among valid adjustment sets

A graph may yield several minimally sufficient sets. Suppose one set uses previous health engagement and clinic capacity, while another uses detailed causes of each. The choice can consider:

  • measurement validity and consistency;
  • missing-data burden;
  • temporal availability;
  • positivity and overlap;
  • statistical precision;
  • risk that a variable is affected by exposure; and
  • feasibility of collecting the same variables across sites.

A larger valid set is not automatically superior. Adding strong predictors of exposure that are weakly related to outcome can reduce precision, while adding strong baseline causes of outcome can improve precision. These statistical considerations apply only after the set is judged causally valid.

Researchers should report the selected set and rationale rather than presenting adjustment as an opaque software choice. When plausible DAGs produce different valid sets, estimates under each can be compared as a structured sensitivity analysis, with attention to which assumption changes.

Selection diagrams in everyday research

Selection occurs when inclusion, follow-up, complete data or analysis depends on variables in the causal system. A DAG can include a selection node S, with analysis conditioned on S = 1.

Common examples include:

  • studying only patients who reach a tertiary clinic;
  • analysing only participants with complete questionnaires;
  • including only specimens of adequate quality;
  • restricting to survivors at a landmark time; and
  • evaluating experience only among service users.

The question is not whether selection exists—it always does—but whether conditioning on the selection process opens a biasing path relative to the target population and effect.

Time-varying structures

Repeated exposure, confounding and outcome processes require time-indexed nodes. A variable can be both a confounder for a later exposure and a consequence of earlier exposure. Standard adjustment can then block effects or induce bias. Longitudinal causal methods may be required [5].

For an introductory DAG, represent at least:

  • baseline factors;
  • exposure at each relevant time;
  • time-varying covariates;
  • mediators or treatment changes; and
  • outcome and censoring.

Do not collapse all measurements into one node if doing so hides treatment–confounder feedback.

Reporting the graph

Publish or append the graph, node definitions and adjustment rationale whenever space permits. A reader cannot appraise “DAG-selected covariates” without seeing the assumptions. Report material graph changes made after examining the data and distinguish primary from sensitivity structures.

What DAGs do not do

A DAG does not:

  • estimate the magnitude of an effect;
  • show whether measurement is valid;
  • establish that all common causes are measured;
  • solve positivity or overlap problems;
  • guarantee correct model form;
  • remove selection bias automatically;
  • distinguish effect scales unless extended; or
  • replace design, sensitivity analysis and transparent reporting.

Two researchers can draw different plausible DAGs. The productive response is to compare assumptions, not to choose the graph producing the preferred result.

Appraise a causal diagram

  • Is the exposure, outcome, population and target effect explicit?
  • Are arrows causal rather than merely predictive?
  • Is time order plausible?
  • Are important common causes represented, including unmeasured ones?
  • Are selection and missing-data processes considered?
  • Does the proposed adjustment set block backdoor paths without conditioning on mediators or colliders?
  • Are alternative plausible graphs discussed?
  • Does the reported analysis match the graph?

Ethical and equity considerations

Causal diagrams can reveal structural causes that might otherwise be treated as individual traits. For example, travel burden may arise from service distribution, transport policy and income. Demographic categories should not be drawn as biological causes without a defensible mechanism.

Interface with statistical analysis

The DAG informs the adjustment set, but the estimator must also match the outcome, exposure, sampling and data structure. The plan should state:

  • the target estimand;
  • the chosen valid adjustment set;
  • reasons for excluding mediators or colliders;
  • how continuous covariates will be modelled;
  • handling of clustering, repeated measures and missingness;
  • diagnostics and overlap assessment; and
  • sensitivity analyses for unmeasured confounding or alternative DAGs.

A statistically significant coefficient does not validate the DAG. Likewise, a non-significant covariate does not justify removing a required confounder.

D-separation and testable implicationsMMed extension

DAGs imply certain conditional independencies. D-separation is the graphical criterion determining whether paths are blocked by a conditioning set. Some implied independencies can be compared with observed data, helping identify incompatibility between the graph and dataset. Failure of a testable implication may indicate a missing arrow, measurement error, selection or model misspecification. Passing such checks does not prove the DAG because different causal graphs can share the same statistical implications [3].

Worked example

Selecting an adjustment set for appointment booking

Target effect: total effect of discharge appointment booking on laboratory-confirmed testing completion by day 112.

Assumed common causes: clinic capacity and previous health engagement affect both booking and completion.

Mediator: reminder receipt occurs after booking and partly transmits the effect.

Selection process: interview participation depends on health engagement and completion.

Primary adjustment set: clinic capacity and previous health engagement, represented using prespecified baseline measures.

Variables excluded: reminder receipt is excluded from the total-effect model; interview participation is not used to restrict the linked-record cohort.

Alternative assumption: if travel burden also influences whether booking is offered, it becomes another common cause and should be considered for adjustment. The graph and analysis plan should be updated prospectively.

Sensitivity work: compare estimates under plausible alternative adjustment sets, assess measurement limitations, and describe the direction of possible residual confounding rather than treating one model as automatically definitive.

Suggested protocol or reporting wording

Common mistakes

Knowledge check

In the structure A ← C → Y, why can C confound the A–Y association?

Answer and reasoning

C is a common cause of A and Y. The open backdoor path can create an association between A and Y even apart from any causal effect of A. Appropriate control for C can block that path if C is measured adequately.

Why should a mediator usually be excluded when estimating a total effect?

Answer and reasoning

A mediator carries part of the causal effect from exposure to outcome. Conditioning on it blocks that pathway, so the resulting estimate no longer represents the total effect and may also introduce additional bias.

How can conditioning on a collider create bias?

Answer and reasoning

A collider has two causes. Conditioning on the collider or its descendant can open an otherwise blocked path between those causes, inducing a non-causal association that then contaminates the exposure–outcome estimate.

Does a DAG prove that the selected adjustment set removes all confounding?

Answer and reasoning

No. It shows what follows from the stated assumptions. If common causes are omitted, arrows are incorrect or variables are poorly measured, residual bias can remain. The graph makes assumptions transparent but does not verify them automatically.

Key take-home messages

Key take-home messages

  • A DAG represents causal assumptions for a specific question.
  • Confounders, mediators and colliders have different graphical structures and adjustment implications.
  • Valid adjustment blocks non-causal paths without blocking the target causal paths or opening collider paths.
  • More adjustment is not always better.
  • DAG software applies rules to the graph; it cannot guarantee that the graph is correct.

References

  1. Greenland S, Pearl J, Robins JM. Causal diagrams for epidemiologic research. Epidemiology. 1999;10(1):37–48. https://doi.org/10.1097/00001648-199901000-00008
  2. Textor J, Hardt J, Knüppel S. DAGitty: a graphical tool for analyzing causal diagrams. Epidemiology. 2011;22(5):745. https://doi.org/10.1097/EDE.0b013e318225c2be
  3. Textor J, van der Zander B, Gilthorpe MS, Liśkiewicz M, Ellison GTH. Robust causal inference using directed acyclic graphs: the R package ‘dagitty’. Int J Epidemiol. 2016;45(6):1887–1894. https://doi.org/10.1093/ije/dyw341
  4. Schisterman EF, Cole SR, Platt RW. Overadjustment bias and unnecessary adjustment in epidemiologic studies. Epidemiology. 2009;20(4):488–495. https://doi.org/10.1097/EDE.0b013e3181a819a1
  5. Hernán MA, Robins JM. Causal inference: what if. Boca Raton (FL): Chapman & Hall/CRC; 2020.

These materials support learning and research planning. They require adaptation to the study context and do not replace methodological, statistical, ethical, or regulatory consultation.

Report an error in this lecture