Tutorials › Regression Analysis (Undergraduate) › Drawing Directed Acyclic Graphs for Adjustment Questions

Adjusted Associations and Confounding · Tutorial 174 of 991

Drawing Directed Acyclic Graphs for Adjustment Questions

Build and check labeled causal diagrams by deciding which variables are involved, what each arrow assumes, and whether the proposed directions form an acyclic graph.

Intermediate 11 min read

What You'll Learn

  • Identify exposures, outcomes, common causes, mediators, and selection variables in a substantive question.
  • Translate assumed causal relationships into directed arrows with concise mechanism labels.
  • Check a proposed graph for cycles and inconsistencies with the assumed time order.
  • Distinguish a causal diagram from a fitted regression model or a summary of observed associations.
  • Represent sample inclusion explicitly when selection is part of the question.

Why Draw a Causal Diagram?

A regression model lists variables and describes an association conditional on the predictors included. It does not, by itself, explain why those variables are related or which ones may have caused others. A directed acyclic graph, or DAG, makes a set of proposed causal relationships visible: each variable is a node, and each directed arrow represents an assumed causal influence. Drawing the assumptions can expose ambiguities before an analyst decides how to describe or estimate an association.

A DAG is not discovered simply by looking at correlations, and it is not proof that its arrows are true. It is a compact way to state subject-matter assumptions. Its value depends on whether the variables and arrows represent a plausible account of how the data came about. In this tutorial, arrow labels are short descriptions of the proposed mechanism; they are not regression coefficients, effect sizes, or estimates from data.

Definition: A directed acyclic graph (DAG) is a graph whose nodes represent variables and whose arrows represent directed relationships, with no sequence of arrows that eventually returns to its starting node. In a causal DAG, an arrow \(A \to B\) represents the assumption that \(A\) is a direct cause of \(B\) at the level of detail represented by the graph. “Direct” means that the relationship is not represented as passing through another node in this graph; it does not mean that no biological or social mechanism lies between \(A\) and \(B\).

Start With the Question and the Variables

Before drawing arrows, define the question in words. Identify the exposure \(X\), whose relationship with the outcome is of interest, and the outcome \(Y\), the result being studied. Specify the population and the time period as clearly as the question requires. The same variable may be an exposure in one question and an outcome in another; its role depends on the question, not on the variable’s name.

Next, list other variables that could be relevant to the assumed causal story. A common cause of \(X\) and \(Y\) is a variable assumed to cause both. A mediator is a variable assumed to be caused by \(X\) and, in turn, to cause \(Y\); it represents one proposed route by which the exposure affects the outcome. A selection variable records whether an individual is included in the analyzed sample, or otherwise enters the group being studied. It can have causes of its own, such as eligibility, attendance, or willingness to participate.

These labels describe roles in a stated causal question, not permanent properties of variables. For example, a person’s age could be a common cause in one question, an outcome in another, or irrelevant to a third. Do not add a variable merely because it is available in a data set: include it when it belongs to the substantive assumptions you want the graph to express.

Constructing and Labeling Arrows

For each pair of variables you think may be causally related, ask which one is assumed to come first in the causal account. Draw an arrow from the proposed cause to the proposed effect. Then label it with a short, specific mechanism or description. For example, “prior experience affects practice time” is more informative than an unexplained arrow between two abbreviations. The label clarifies the assumption; it does not make that assumption certain.

An arrow is not just a statement that two variables are associated. Association alone does not establish which variable causes the other, whether both have a common cause, or whether another process produced the pattern. Conversely, leaving out an arrow states that the graph does not assume a direct causal effect between those two nodes as drawn. This is a substantive modeling choice, not a claim that the variables could never be statistically associated.

Keep time and the level of detail in view. An exposure may affect an outcome through a mediator, and the graph can show that sequence explicitly. A variable that occurs after the exposure should not be drawn as causing an earlier exposure unless the defined variables or time periods make that direction sensible. When direction is unclear, pause and refine the variable definitions or acknowledge that the causal assumption is uncertain rather than choosing an arrow based only on correlation.

Drawing rule: State the question and define \(X\), \(Y\), and the other nodes; add arrows only for proposed direct causal influences; label each arrow with its assumed mechanism; then check that the directions are coherent and that no directed cycle exists. A graph is acyclic only if no sequence such as \(A \to B \to C \to A\) is present.

Worked Examples

Worked Example: Exercise, Weight, and Blood Pressure

Hypothetical question. A health analyst wants to describe the causal assumptions relevant to the relationship between weekly exercise and later blood pressure. Consider age, body weight measured after the exercise period, and blood pressure. Assume, for this simplified example, that age may influence both exercise and blood pressure; exercise may influence later weight and blood pressure; and later weight may influence blood pressure.

Define the nodes. Let \(X\) be weekly exercise, \(Y\) be later blood pressure, \(A\) be age, and \(W\) be body weight measured after the exercise period. Here \(X\) is the exposure, \(Y\) the outcome, \(A\) a proposed common cause, and \(W\) a proposed mediator.

Draw and label the arrows. The assumed relationships are:

$$ A \xrightarrow{\text{influences activity}} X,\qquad A \xrightarrow{\text{influences blood pressure}} Y,\qquad X \xrightarrow{\text{may change weight}} W,\qquad W \xrightarrow{\text{influences blood pressure}} Y,\qquad X \xrightarrow{\text{may affect blood pressure}} Y. $$

The graph represents age as a common cause because it has arrows to both \(X\) and \(Y\). It represents \(W\) as a mediator because the assumed arrows place it after exercise and before blood pressure. The direct arrow from \(X\) to \(Y\) allows an effect not represented through \(W\). The labels describe the assumed mechanisms, not measured amounts of change. The order \(A\), \(X\), \(W\), \(Y\) is consistent with the arrows, so this proposed graph has no directed cycle.

Worked Example: Treatment and Recovery in a Hospital Sample

Hypothetical question. Suppose a team studies whether a treatment is related to recovery among people admitted to a hospital. Assume that illness severity before treatment influences both the chance of receiving treatment and the chance of recovery. Also suppose severity and access to care can influence hospital admission. The analysis includes only admitted patients.

Define the nodes. Let \(T\) be treatment, \(R\) be recovery, \(V\) be pre-treatment illness severity, \(C\) be access to care, and \(S\) be hospital admission, with \(S=1\) indicating inclusion in the analyzed sample. The exposure is \(T\), the outcome is \(R\), \(V\) is a proposed common cause, and \(S\) is a selection variable.

Draw and label the arrows. Under the stated assumptions, the arrows are:

$$ V \xrightarrow{\text{guides treatment decisions}} T,\qquad V \xrightarrow{\text{affects prognosis}} R,\qquad T \xrightarrow{\text{may affect recovery}} R,\qquad V \xrightarrow{\text{affects admission}} S,\qquad C \xrightarrow{\text{affects admission}} S. $$

This graph makes the sample restriction visible instead of treating the observed patients as if they were selected for no reason. It also distinguishes admission from treatment: admission determines who enters the analysis, while treatment and severity have their own proposed relationships. The graph is acyclic: the arrows go from pre-treatment characteristics to treatment, recovery, or admission, and none returns to an earlier node. The diagram states assumptions only; it does not establish that the treatment caused recovery or prescribe which variables should be adjusted for.

Worked Example: Tutoring, Study Time, and an Exam Score

Hypothetical question. A school wants to describe assumptions about tutoring and a later exam score. Assume that prior achievement influences both whether a student receives tutoring and the later score. Assume also that tutoring can change subsequent study time, which may affect the score, and that tutoring may have an additional direct influence on the score. Finally, the analysis includes only students who complete the exam; attendance can affect completion.

Define the nodes. Let \(T\) denote tutoring, \(Y\) the later exam score, \(P\) prior achievement, \(M\) study time after tutoring begins, \(A\) attendance, and \(S\) exam completion, with \(S=1\) for students whose scores are analyzed. \(P\) is a proposed common cause of \(T\) and \(Y\), \(M\) is a proposed mediator, and \(S\) is the selection variable.

Draw and label the arrows. The assumptions translate into:

$$ P \xrightarrow{\text{influences tutoring access}} T,\qquad P \xrightarrow{\text{predicts later performance}} Y,\qquad T \xrightarrow{\text{changes study time}} M,\qquad M \xrightarrow{\text{supports exam performance}} Y,\qquad T \xrightarrow{\text{may affect performance directly}} Y,\qquad A \xrightarrow{\text{affects exam completion}} S. $$

The study-time node is downstream of tutoring under the assumptions, so it is represented as a mediator rather than a pre-tutoring common cause. Completion is shown as a separate node because only students with \(S=1\) contribute an exam score to the analysis. The graph does not claim that these assumptions have been confirmed, and it does not dictate an adjustment strategy. It simply records a coherent set of claims that can be inspected and discussed.

Why Acyclicity Matters

A causal graph cannot contain a directed cycle. For instance, \(A \to B \to C \to A\) would assert that \(A\) causes \(B\), \(B\) causes \(C\), and \(C\) in turn causes \(A\), all at the graph’s defined level and time scale. Such a cycle conflicts with representing the variables in a one-way causal ordering. Sometimes an apparent cycle signals that the variables need clearer time indices: “study time this week” could affect “exam performance next week,” while performance on an earlier exam could influence study time this week. Those are distinct time-indexed variables, not a same-time cycle.

A simple check uses a proposed ordering of nodes. If every arrow points forward in that ordering, a cycle is impossible. To see why, assign each node a rank \(r\) in the ordering. Every arrow \(U \to V\) must satisfy \(r(U) < r(V)\). A directed cycle would require rank to increase at every arrow and then return to its starting node, which would imply \(r(U) < r(U)\). That is impossible. This is a useful check, though it does not prove that the chosen ordering or causal assumptions are substantively correct.

$$ r(U) < r(V)\ \text{for every arrow } U \to V \quad\Longrightarrow\quad \text{no directed cycle}. $$

Common Mistakes and Practical Checks

  • Drawing arrows from association alone. “Exercise and blood pressure are related, so exercise must cause blood pressure” is not enough to determine an arrow. The correction is to state a substantive causal assumption and consider plausible alternative explanations, such as a common cause.
  • Reversing cause and effect without checking time. An arrow from a later measurement to an earlier event is usually incoherent for the stated variables. Define the timing of each variable before drawing the arrow.
  • Treating labels as estimates. The label “improves recovery” is a verbal assumption, not an estimated effect size. A DAG does not supply a slope, a \(p\)-value, or evidence that the effect exists.
  • Leaving sample selection invisible. If the analysis includes only people who were admitted, enrolled, or completed a survey, ask whether sample inclusion belongs in the diagram. A selection node can show the assumed causes of entering the analyzed group.
  • Adding every available variable. A crowded graph is not automatically a better graph. Include nodes that clarify the causal assumptions for the question, and explain important omissions rather than using arrows as decoration.

A useful final check is to read every labeled arrow aloud as a sentence: “\(U\) causes \(V\) through this proposed mechanism.” If the sentence is unclear, the arrow direction or its label needs reconsideration. Then check that the exposure, outcome, common causes, mediators, and selection variables have been assigned roles consistently with their definitions and timing.

Key takeaway: A labeled DAG is an explicit, inspectable statement of assumed causal relationships. Define the question and variables, direct arrows from proposed causes to effects, label the assumed mechanisms, represent relevant sample selection, and verify that the graph has no directed cycles. A diagram organizes assumptions; it does not prove them.

Check Your Understanding

Answer each question by referring to the definitions and drawing rules in this tutorial.

  1. In a question about a training program and later job performance, what information is needed to decide which variable is the exposure and which is the outcome?
  2. Suppose a pre-treatment characteristic is assumed to influence both treatment and the outcome. What arrows should appear from that characteristic, and what role does it play?
  3. A proposed graph contains \(A \to B\), \(B \to C\), and \(C \to A\). Explain why it is not a DAG and give one way clearer time definitions might help.
  4. Why is an arrow label such as “affects admission” not an estimate of the size of an effect?
  5. An analysis includes only participants who completed a follow-up survey. What node could represent inclusion, and what should determine whether arrows point into it?