Causal Thinking — DAGs · Potential Outcomes · Confounding · IPW · G-Computation

Dr. R. Düsing · Osnabrück University

Example
TRegular exercise (yes / no) — treatment YHeart-health score (0–100) — outcome CSocioeconomic status (SES, high / low) — confounder
People who exercise have, on average, ~19 points better heart health — but is that a causal effect? SES influences both exercise and heart health. All five modules analyze this confounding problem step by step: DAGPotential OutcomesConfoundingIPWG-Computation.
Module of
Causal Structure — Directed Acyclic Graphs
A DAG shows who causally influences whom. Before we estimate any effect, we need to know the causal structure — because it determines which variables we must control for, which we may control for, and which we must never control for.
The problem: not every observed association is causal. And not every adjustment helps — some make the bias worse.
Approach: Steps A–D explain the four basic types. Step E shows the complete model of our study — the foundation for all following modules.
Module of
Potential Outcomes — The Fundamental Problem
What would have happened if a person had not exercised — even though they did? We can never answer this question directly. The potential outcomes framework makes this impossibility mathematically tractable and shows how we can still draw causal conclusions.
The core idea: every person i has two potential outcomes: Y_i(1) — their health score if they exercise — and Y_i(0) — their score if they don't. The individual causal effect would be ICE_i = Y_i(1) − Y_i(0). The problem: we only ever see one of these worlds — the other is counterfactual and forever unobservable. We can never have the same person both exercise and not exercise at the same time.
The solution: instead of individual effects, we estimate average effects over groups: ATE = E[Y(1) − Y(0)] for the overall population, ATT for the treated, ATU for the untreated. This requires assumptions (SUTVA, ignorability) — and methods like IPW or G-computation, explained in modules and .
Person SES T (exercise) Y(1) — with exercise Y(0) — without exercise ICE = Y(1)−Y(0) observed Y
ICE = Individual Causal Effect · hover over "?" for the hypothetical value · scale: heart-health score (0–100)
Module of
ConfoundingWhy the Naive Comparison Deceives
A simple comparison of T=1 vs. T=0 does not measure the causal effect. It measures the effect including the entire confounding bias. How big is the difference?
The problem: people with high SES exercise more often and are naturally healthier. The naive comparison wrongly attributes the SES effect to exercise.
1
Look at the left panel: the naive group comparison. Notice that the T=1 group contains far more high-SES people (orange).
2
Look at the right panel: the comparison within each SES level. The effect is much smaller — that's the true causal effect.
3
Move the slider on the left and watch how the bias grows with confounding strength.
Naive Group Comparison biased
Stratified by SES adjusted
Module of — Solution 1
Inverse Probability WeightingPseudo-Population
IPW creates a weighted pseudo-population in which T and SES are statistically independent — as if exercise had been randomly assigned. Every observation gets a weight corresponding to its rarity.
The problem: the top panel shows the massive imbalance: almost all high-exercise people come from the high-SES group, almost all non-exercisers from low-SES.
The solution: weight units that behave "contrary" to their expectation more heavily. A low-SES person who exercises anyway is especially valuable for the estimate.
1
Top: propensity-score distribution — mirrored. ▲ Exercise (T=1) above, ▼ No exercise (T=0) below. The imbalance is clearly visible.
2
Choose an estimand (ATE/ATT/ATU) on the left and click "Apply weighting." Watch the distribution become symmetric.
3
The IPW estimator appears on the left — compare it to the naive value from module .
Propensity-Score Distribution — Raw Counts
▲ Exercise T=1  |  ▼ No exercise T=0
Propensity score p(T=1 | SES) — unweighted
Weighted Pseudo-Population
Click "Apply weighting" to see the pseudo-population
Module of — Solution 2
G-ComputationStandardization
G-computation is the statistical counterpart to the potential outcomes from module . There we wanted to know Y_i(1) and Y_i(0) for every person — that's impossible. G-computation estimates exactly these counterfactual worlds from an outcome model and then standardizes over the covariate distribution.
The connection to potential outcomes: Ê[Y(1)] from G-computation corresponds directly to E[Y_i(1)] from the PO framework — the mean outcome if everyone were treated. Ê[Y(0)] corresponds to E[Y_i(0)]. The difference Ê[Y(1)] − Ê[Y(0)] is the ATE. G-computation makes the counterfactually invisible estimable.
Approach: step fits the outcome model E[Y|T,SES]. Steps and show the two counterfactual worlds (everyone exercises vs. no one exercises). Click "Show G-computation" for the estimator and the comparison with IPW and the doubly robust estimator.
1
The outcome model shows the predicted Y values for T=1 and T=0, split by SES.
2
The two worlds below show: Ê[Y(1)] if everyone exercises, Ê[Y(0)] if no one exercises — with the same SES distribution.
3
Click "Show G-computation" on the left — the estimator appears together with the comparison to IPW from module .
Outcome Model: Ê[Y | T, SES]
● T=1 (exercise)  ·  ● T=0 (no exercise)  ·  Points = observed data · Lines = model prediction
Individual Prediction Panel — Ŷ(1) and Ŷ(0) for Every Person
The outcome model predicts two values for every person: what would their score be if they exercised (Ŷ(1)), and what if they didn't (Ŷ(0))? These predictions are based on the SES group — every person is assigned the group mean of their combination group (T×SES). The last column (Ŷ(1)−Ŷ(0)) is the estimated individual effect — exactly what was called ICE in module , but was unobservable there.
Counterfactual World T=1 — Everyone Exercises
Counterfactual World T=0 — No One Exercises
Flashcards — Concepts at a Glance
Potential Outcomes & the Fundamental Problem
Every person has two potential outcomes: Y(1) (with treatment) and Y(0) (without). The individual effect would be Y(1)−Y(0) — but we only ever observe one world; the other remains counterfactual. That's why we estimate average effects across groups instead of individual effects. ATE = whole population, ATT = treated only, ATU = untreated only.
DAG Building Blocks: Confounder · Mediator · Collider · Precision Variable
The causal structure determines what you're allowed to control for. Confounder (X→T, X→Y): must be adjusted for. Mediator (T→M→Y): do not adjust, or the effect you want to measure disappears. Collider (T→K←Y): adjusting creates a spurious association. Precision variable P (only P→Y, no arrow to T) — the classic covariate from an ANCOVA model: it only needs to be associated with Y, not with T (or X), to be used correctly. No confounding, adjustment is optional — it doesn't bias, but reduces the variance of the estimate (more power). Rule of thumb: draw the DAG first, then choose the model — not the other way around.
Confounding & Backdoor Bias
The naive comparison E[Y|T=1] − E[Y|T=0] measures the causal effect plus the entire confounding bias through the open "backdoor" path T←X→Y. In the example, high-SES people exercise more often and are healthier — the SES effect gets attributed to exercise. The OVB formula decomposes the bias into (effect of X on Y) × (imbalance of X between the T groups).
IPW — Pseudo-Population
Inverse probability weighting weights every observation by 1/P(T=t|X) (propensity score). Rare constellations — say, a low-SES person who exercises anyway — get a large weight. This creates a pseudo-population in which T and X are independent, as if treatment had been randomized. Requirement: the propensity model must be correct.
G-computation fits an outcome model E[Y|T,X], predicts both counterfactual worlds for every person (Ŷ(1), Ŷ(0)), and standardizes over the covariate distribution. It is the statistical counterpart to module . Doubly robust combines the outcome and propensity models: consistent if at least one of the two is correct — a double safeguard.
Identification Assumptions & Related Tools
Causal estimation stands or falls with three assumptions: SUTVA (no interference, a single treatment version), ignorability (all confounders measured — not testable!), and positivity (every person could receive either treatment, 0<P(T=1|X)<1). → Simpson's Paradox · → Collider/Berkson · → Mediation · → Propensity Score Matching