Can comparing students who take an extracurricular course with those who do not treat exam-score differences as course effects? A raw comparison is not enough: prior preparation may shape both enrollment and scores. Putting every available variable into a regression is not always better either—some variables lie on the path through which the course acts, and some can introduce new bias once adjusted. Causal diagrams help state how variables connect before deciding what to adjust.[1]
Draw the question, then find the paths
First fix the effect to estimate. Here the question is: in the target population, how would average exam scores differ if students took or did not take the same extracurricular course? That is the course's total effect, including any direct influence and influence through later study time and related pathways.
A directed acyclic graph (DAG) uses nodes for variables and arrows for assumed direct causal influences; following arrows must not return to the same node. Arrows come from the research question and domain knowledge, not from automatically drawing wherever correlations are large. Missing arrows are assumptions too: among the variables shown, the corresponding direct effects are ruled out.[1][2]
A simplified teaching graph distinguishes several roles. Let X be course enrollment, Y exam score, U pre-enrollment academic foundation, M post-enrollment study time, and S inclusion in the analysis sample. Assume:
U → X → M → Y
U → Y
X → Y
X → S ← Y
U points to both X and Y; M lies on a directed path from X to Y; S receives arrows from both X and Y. The last structure is a possible sample-selection mechanism: analysis inclusion depends on enrollment and on scores. All three relate to scores, but they play different roles in the graph.
Common causes: block confounding paths
In the structure formed by U → X and U → Y, academic foundation is a common cause of enrollment and scores. Even if the course had no effect, enrolled students might score differently because of prior preparation. Association along X ← U → Y cannot be credited to the course; it is a backdoor path that enters X against an arrow.[1]
If the sample has not yet been selected on S, U is measured appropriately, and other identifying conditions hold, one can compare enrolled and non-enrolled students within similar foundation levels, then standardize to the target population's foundation distribution. Stratification, regression standardization, and weighting on suitable covariates are different ways to implement such adjustment. In this simplified graph, adjusting for U blocks X ← U → Y while keeping causal paths from X to Y; it does not remove selection bias from the collider path X → S ← Y opened by conditioning on S.
Choose U for its position in the assumed causal structure, not because its sample p-value clears a threshold. Lack of statistical significance in a sample does not erase a common cause; likewise, a significant association with the outcome does not prove a variable should be adjusted.[1][2]
Mediators: paths total effects should keep
In X → M → Y, enrollment first changes later study time, which then affects scores; M mediates that path. When the question is total effect, changes in study time are part of how the course may work. Fixing M at one level and then comparing blocks the path through M and answers a different question than the original total effect.[1]
If the question instead becomes some direct effect of the course not through study time, both the target and the required conditions change. Researchers must define how the mediator is fixed or set and handle related confounding; adding study time to a regression does not by itself make the course coefficient a direct effect.[1][3]
Timing therefore matters: pre-enrollment foundation and post-enrollment study time are not the same class of covariate merely because both predict scores. When drawing the graph, record when each measure occurs; the same concept at different times may need separate nodes.[2]
Colliders: adjustment can open paths
In X → S ← Y, two arrows meet at S; S is a collider on that path. Without selecting or adjusting on S, the path is closed; conditioning on S can open it and induce a non-causal association between X and Y. Selecting or adjusting on descendants of a collider can create the same problem.[1]
Suppose a follow-up survey includes only students who took the course or who scored excellently. Among those selected, non-enrollees must be high scorers, while enrollees may score high or low. Even if the course does not change scores, that inclusion rule can manufacture a score difference between groups. Bias comes from analyzing only people with S=1; S need not appear in a regression for the problem to arise.
Collider status is relative to a path. In complex graphs the same node can play different roles on different paths; whether adjustment is appropriate depends on which paths the whole adjustment set closes or opens, not on deleting every variable labeled “collider.”[1][2]
Choices on a surgical-research graph
Byeon and Lee's tutorial discusses a surgical-research causal graph where the interest is the total effect of surgical approach on venous thromboembolism. Under that graph's assumptions, age, body-mass index, and endometrial-cancer status form an adjustment set sufficient to block backdoor paths. Operative time and length of stay lie on post-treatment pathways; the tutorial notes that adjusting for them as mediators or mediator descendants is unsuitable for the total effect specified in the graph.[1]
That choice is not a fixed checklist for every surgical study. It illustrates that among case variables, preoperative factors such as age and postoperative length of stay serve different paths in this graph; a different causal graph or a different effect question can change the adjustment set.
From paths to an adjustment set
To estimate a total effect, list backdoor paths that leave X against an arrow, then find variable sets that block those paths while keeping causal paths from X to Y. Also check whether selection, attrition, or extra adjustments open collider paths; such new paths need not begin against an arrow into X.[1][2]
More than one set may work. Another graph in the tutorial gives two alternatives: {A, G} and {D, G} both block the listed backdoors. Each is a minimal sufficient adjustment set: dropping any variable from either set leaves it insufficient. If one scheme's variables are unmeasured, the other may still be usable.[1]
Failing to measure a common cause does not erase it from the graph. If every usable adjustment set lacks a necessary variable, routine adjustment with the available variables cannot close all relevant bias paths in the graph. Options then include further measurement, a different design, or methods that rest on different assumptions.[1][3]
After choosing variables, check positivity: within strata defined by the adjustment variables, both treatments should be observable. If one type of student always enrolls and another never does, within-stratum data alone cannot complete the needed comparisons. Adjustment models or weights must also adequately reflect relationships among covariates, treatment, and outcome.
For complex graphs, DAGitty can mark X as exposure and Y as outcome, draw assumed arrows, and flag unobservables as latent; after selecting total-effect analysis, inspect the software's minimal sufficient sets and bias paths. The software computes implications of the drawn graph, so keep variable definitions and arrow justifications, and compare whether the adjustment set changes when key arrows change.[1][3]
References
-
Byeon S, Lee W. Directed acyclic graphs for clinical research: a tutorial. 2023-09-15.
-
Suzuki E, Shinozaki T, Yamamoto E. Causal Diagrams: Pitfalls and Tips. 2020-04-05.
-
Textor J. Drawing and Analyzing Causal DAGs with DAGitty. 2023-07-18.
-
Research Methods · Rituals can be imitated; understanding cannot be faked
-
Compiled and published by the Scholay academic platform; report infringement for takedown requests.
-
Also published on Enter Scholar, a scholar community for the intelligent age