Counterfactual simulation from a fitted causal model

Description

Use a model fitted to an assumed causal graph to simulate what happens to an outcome when a variable is set to new values, including effects through mediators.

Regression coefficients answer predictive questions; product teams usually ask 'what if we changed X?'. This method answers that by simulation. Given a directed acyclic graph, a model is fitted for every variable on the path from the intervention to the outcome. The intervention variable is then set to chosen values, which cuts all arrows entering it, and each downstream variable is simulated in causal order from the posterior samples, carrying parameter and outcome uncertainty. Plotting simulated outcomes against set values gives a counterfactual plot of the total effect, and contrasts between two set values give a causal estimate. Rigour depends entirely on the DAG being right and the effect identified; implausibly large counterfactuals are a warning that linear models are extrapolating.

Attributes

Loss type
Unmigrated
Effort
Days

Steps

  1. Take the DAG as given and fit a model for every variable on the path from the intervention to the outcome (a joint model, for example of mediator on cause and outcome on both).
  2. Choose the intervention variable and the range of values to set it to, for example from 2 standard deviations below to 2 above the mean.
  3. Remove all arrows entering the intervention variable, so its usual causes no longer act on it.
  4. For each posterior sample and each set value, simulate downstream variables in causal order, carrying parameter and outcome uncertainty.
  5. Summarise and plot the distribution of simulated outcomes against the set values.
  6. Compute contrasts, such as the expected change in outcome between two set values, and check whether they are plausible given the data range.

Sources

  • Statistical Rethinking (McElreath, 2020)

Also known as

  • Counterfactual (intervention) simulation
  • Counterfactual plot
  • Intervention simulation
  • do-operator simulation

Categories

  • Analytics & Behaviour
  • Experimentation & Causal Inference