Case Study

do() vs obs() Gap — IatrogenicMedications.bayes

Computes the confounding bias: the difference between obs(X=x) and do(X=x). obs() infers the typical Age/SES profile for that intervention level via Gaussian backward inference. do() holds ancestors at prior means and severs the back-door.

Why the obs() / do() gap matters

The gap between obs(X=x) and do(X=x) is confounding made visible and quantified. Observational data tells you what tends to co-occur with X=x; interventional data tells you what would happen if you forced X=x regardless of how it got there. In practice this gap separates a randomised trial from retrospective records, a deliberate policy from a natural correlation.

When the gap is large, naive analysis of observational data gives the wrong answer for planning — even when the model fits the data well. When the gap is small, the causal and associational estimates align and existing data may suffice. Quantifying the gap is the first step in deciding whether an experiment is needed or whether observational evidence will support a causal conclusion.

obs() — inferred demographics
Age (inferred)
SES (inferred)
Typical profile for this intervention level, derived via Gaussian backward regression.
do() — prior means
Age (prior mean)
SES (prior mean)
Random patient from the population — back-door paths severed.
obs() vs do() — downstream predictions
obs(X=x)
do(X=x)
Outcomeobs(X=x)do(X=x)Gap (bias)Gap %