8.3 DAGs and Observational Identification: Control Variables Can Also Introduce Bias
The core of observational causal inference isn't any single algorithm; it's: which assumptions make the data comparisons equivalent to the target counterfactual comparison?
Learning Objectives
- Use DAGs to distinguish confounders, mediators, and colliders;
- State the assumptions of consistency, exchangeability, and positivity;
- Understand when regression, matching, and weighting work and when they don’t;
- Review instrumental variables, difference-in-differences, and regression discontinuity identification conditions.
1. Turn an Association Question into a Causal Question
First, write the basic elements of the target trial:
- The population of interest;
- Treatment strategies and time zero;
- Control strategy;
- Outcomes and follow-up window;
- Allocation mechanism;
- estimand and analysis plan
For example, "teams with more training have higher success rates" is just an association; only "the average impact on future 30-day task success rate of increasing training from 10 to 20 hours for eligible teams" approaches an identifiable cause-and-effect question.
Align eligibility, treatment assignment, and the start of follow-up. Defining baseline treatment by future training completion, then crediting the treated group with time during which units had to remain alive or event-free to qualify, can create immortal time bias. Other date misalignments can cause different biases; they are not all immortal time bias. See Hernán and colleagues on target trials.
2. A DAG expresses assumptions
Consider:
Experience → Training Duration → Collaboration Proficiency → Success Rate
└────────────────────────────→ Success rate
Training duration ──→ Injury ──← Task difficulty ──→ Success rate- Experience simultaneously affects both treatment and outcome, acting as a confounding variable;
- Collaboration proficiency lies on the path from treatment to outcome and is a mediator;
- Injury is jointly caused by training duration and task difficulty and is a collider.
When estimating the total effect of training, you should block backdoor paths created by experience, but typically do not control for collaborative proficiency; in this diagram, controlling for injury will open training duration → injury ← task difficulty → success rate path.
The arrows in a DAG come from domain knowledge, temporal order, and mechanistic evidence, not from automatically generating truth based on correlation matrices. Nodes for omitted variables should be included even in the absence of data, because they determine whether identification is possible.
Run the NumPy blocks in order. This example uses centered abstract variables to demonstrate collider bias. Let
import numpy as np
A = np.array([-1., -1., 1., 1.])
U = np.array([-1., 1., -1., 1.])
C = A + U
Y = U.copy()
plain = np.linalg.lstsq(np.column_stack([np.ones(4), A]), Y, rcond=None)[0]
adjusted = np.linalg.lstsq(np.column_stack([np.ones(4), A, C]), Y, rcond=None)[0]
print(round(plain[1], 6), round(adjusted[1], 6))
# 0.0 -1.0Without
3. Three Basic Identification Criteria
Consistency
The observed outcome for units assigned to treatment
Conditional Exchangeability
Given sufficient pretreatment confounders
It means there is no remaining unmeasured confounding, an assumption typically unverifiable from the observed data itself.
Positivity
For binary treatment
If the most dangerous task never accepts short training, we can't compare the two strategies of this group from data. Out-of-distribution extrapolation can't create real overlap.
4. An adjustment set is not "all available variables"
For total-effect identification through the backdoor criterion, block every backdoor path and exclude descendants of treatment. Adjusting for a treatment-induced mediator changes the target effect; adjusting for a collider may open a path. The relevant distinction is causal role, not merely when a column appears in a table.
You don’t need to control for all pre-treatment variables: some instrumental variable predictors strongly predict treatment but don’t directly predict the outcome, and in small samples they can increase variance and amplify unmeasured confounding bias. Variable selection should be guided by causal diagrams and the estimand, then balanced with statistical efficiency.
“Stratified correlation coefficients decreasing” is not sufficient causal analysis. Direct estimation of the target effect is needed, along with propagation of model and sampling uncertainty.
5. Outcome Regression, Matching, and Weighting
Outcome Model
Fit
Propensity Score
The propensity score
For a binary-treatment ATE, inverse probability weights can be written as
- Propensity overlap between treatment and control groups;
- Weighted covariate balance, rather than the propensity model AUC alone;
- Extreme weights and effective sample size;
- Sensitivity to weight truncation and model selection.
Matching can only balance variables that have been measured and entered into the design. Using independent sample standard errors immediately after matching may also be incorrect.
Construct ten units at each of two covariate levels, with treatment fractions 0.2 and 0.8 and a true effect of two. The propensity scores are known in this example:
L = np.repeat([0., 1.], 10)
A = np.array([1] * 2 + [0] * 8 + [1] * 8 + [0] * 2)
Y = 3 * L + 2 * A
propensity = np.where(L == 0, 0.2, 0.8)
assert np.all((propensity > 0) & (propensity < 1))
w = np.where(A == 1, 1 / propensity, 1 / (1 - propensity))
raw = Y[A == 1].mean() - Y[A == 0].mean()
weighted = np.average(Y[A == 1], weights=w[A == 1]) - np.average(
Y[A == 0], weights=w[A == 0]
)
ess = [(w[A == a].sum() ** 2 / np.square(w[A == a]).sum()) for a in (0, 1)]
print(round(raw, 6), round(weighted, 6), np.round(ess, 6).tolist())
# 3.8 2.0 [6.4, 6.4]The raw difference is 3.8 and the weighted difference is two. Both weighted arm means of
Doubly Robust Methods
Combine the outcome model with the propensity score model; under appropriate conditions, correctness of either model suffices to maintain consistency. However, "doubly robust" does not protect against unmeasured confounding, positivity violations, or incorrect time ordering.
AIPW augments outcome-model predictions with inverse-probability-weighted residual corrections. In the preceding example, deliberately misspecify each model in turn, then both:
def aipw(m0, m1, e):
return np.mean(m1 - m0 + A * (Y - m1) / e - (1 - A) * (Y - m0) / (1 - e))
correct_outcome = aipw(3 * L, 3 * L + 2, np.full(len(A), 0.5))
correct_propensity = aipw(np.zeros(len(A)), np.zeros(len(A)), propensity)
both_wrong = aipw(np.zeros(len(A)), np.zeros(len(A)), np.full(len(A), 0.5))
print(np.round([correct_outcome, correct_propensity, both_wrong], 6).tolist())
# [2.0, 2.0, 3.8]Either correct model recovers two in this construction; two incorrect models give 3.8. The general property is consistency under suitable regularity conditions, not exact recovery in every finite sample. Flexible machine learning for these nuisance models requires attention to cross-fitting and convergence conditions for inference. See Bang and Robins on doubly robust estimation.
6. Four Assumptions to Examine for Instruments
For an instrument
- Relevance:
actually changes ; - Independence:
is independent of unmeasured factors that affect the outcome; - Exclusion restriction:
influences only through ; - Treatment-version and interference assumptions support the target interpretation.
In randomized trials with noncompliance, adding monotonicity and other conditions typically identifies the local average treatment effect (LATE) of compliers, but not necessarily the overall average treatment effect (ATE).
For a binary assignment that raises the outcome mean by 0.02 and receipt probability by 0.40, the assumptions above plus monotonicity give a Wald LATE of
Weak instruments lead to unstable estimates and amplify finite-sample bias. Statistical significance in the first stage is not sufficient proof; strength diagnostics, confidence intervals, and arguments about the exclusion restriction should be reported.
7. Quasi-experiments still rely on design
The Difference in Differences (DiD)
Compare the groups’ before-after changes. The key assumption concerns parallel trends in potential outcomes without treatment. Failure to reject a pretrend test does not prove future parallel trends. Check anticipation, concurrent policies, and composition changes. Under staggered adoption with heterogeneous effects, an ordinary two-way fixed-effects coefficient need not estimate the desired average effect.
Regression Discontinuity (RD)
Treatment assignment changes at a threshold of a running variable. RD identifies a local effect near that threshold under conditions including continuity of potential outcomes and no precise sorting around the cutoff. The observed outcome may jump; that jump is the signal being studied. Check bandwidth and functional-form sensitivity, and distinguish sharp assignment from fuzzy changes in treatment probability.
Natural Experiment
A naturally occurring change is not automatically random. Explain why it is plausibly exogenous for the target comparison and who is affected. If it serves as an instrument, separately justify that it affects the outcome only through the target treatment.
8. Sensitivity Analysis and Falsification Checks
Observational conclusions should demonstrate stability under changes in assumptions:
- Change the adjustment set, model form, bandwidth, or weight truncation;
- Use negative control outcomes/exposures to check for relationships that should not exist;
- Check whether future treatment predicts pretreatment outcomes;
- Quantify how strong unmeasured confounding would need to be to overturn the conclusion;
- Identify groups with inadequate overlap and narrow the target population;
- Present the results of different identification strategies side by side, rather than selecting only the favorable ones.
Sensitivity analysis can't prove that an assumption is correct, but it can show how much a conclusion depends on that assumption.
9. Minimum Contents of a Causal Report
Target trial and estimand
Data sources, inclusion criteria, and time zero
DAG and justification for the adjustment set
Identification assumptions and their untestable components
Overlap, balance, and weight diagnostics
Main effects, intervals, and absolute risk
Alternative models and sensitivity analysis
Applicable population and questions the analysis cannot answerCommon Misconceptions
- The more control variables you have, the closer you get to establishing causality: mediators and colliders can change the estimand or introduce bias.
- Propensity score matching equals a randomized experiment: It only addresses measured confounders and relies on overlap.
- An instrument’s association with treatment is sufficient: Independence and exclusion restrictions are usually harder to justify.
- DAGs learned from data are inherently objective: Pure observational distributions usually can't uniquely determine causal directions.
Practice
- Draw a DAG for training duration, experience, collaboration proficiency, injury, and success rate, and identify the total effect adjustment set.
- Use simulated data to demonstrate how controlling for a collider creates an association.
- Conduct propensity score weighting, report standardized differences before and after weighting, overlap, and effective sample size.
- Review a candidate instrumental variable for relevance, exogeneity, exclusion restriction, and target estimand.
Summary
Causal inference requires agreement among the target trial, causal graph, timing, and identification assumptions. Methods estimate effects under those assumptions; a successful model run does not establish them.
The next chapter tackles scalability: when a single machine's memory can't hold the data, first understand partitioning, shuffle, fault tolerance, and execution semantics, then decide whether to use a distributed system.