liveBook · Manning

Do operator

As explained in Causal Inference for Data Science

The do operator denotes an intervention that sets a variable to a specified value in a causal graph while replacing its usual assignment mechanism.

The do operator denotes an intervention: it sets a variable to a specified value and replaces that variable’s usual assignment mechanism. Unlike observing X = x, do(X = x) asks what happens when X is actively fixed, while the rest of the system operates normally. section 6.2.4 section 10.2.2

Use the operator to formulate causal questions and connect graphical and potential-outcomes reasoning:

  • Write the average treatment effect for two treatment values as ATE = E[Y|do(X = A)] − E[Y|do(X = B)]. section 6.2.4
  • Represent do(X = x₀) on a causal graph by removing incoming arrows to X and setting X to x₀. section 6.2.4
  • Translate a potential outcome into an intervention: Yᵗ(i) = Y(i)|do(T(i) = t). The two frameworks express the same causal quantity. section 10.2.1
  • Specify the intervention carefully when effects vary by context, such as estimating surgery generally versus estimating each surgeon’s effect. section 10.2.2

Pricing and competing products

To ask whether setting Bike1’s price to p changes its purchase probability, write P(Bike1 = Yes|do(Price1 = p)). This intervention fixes Price1, but the interpretation depends on what happens to other prices: randomizing Price2 can create interference that differs from the intended real-world setting. section 10.2.2

Table 6.15 DAG and linear models after an intervention on node x0.
DAG
In equations
The effect of an intervention do(X = x0) on the DAG in table 6.14. You can see that the arrow from Z to x0 has been removed, and the value of X is set to x0.
sidebar figure
sidebar figure
where ε Z, ε X, ε M, and ε Y are independent of each other.

Inspect the intervened DAG and equations for do(X = x₀), including the removed arrow from the confounder to X. section 6.2.4

How Causal Inference for Data Science covers it

How deep it goes
Explains intervention notation, graph surgery, average treatment effects, and potential-outcome equivalence, while exposing interference complications.
Examples
Uses surgery outcomes, competing bicycle prices, and a linear DAG containing confounders, mediators, and colliders.
What it assumes
Assumes familiarity with causal graphs, treatments, outcomes, expectations, and potential outcomes while reinforcing their equivalence.
What you can do after
Evaluate causal effects by writing intervention expressions, modifying DAGs, and translating between potential outcomes and graph notation.
How it connects
Connects causal graphs, potential outcomes, average treatment effects, linear regression, confounding, mediation, colliders, and interference.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Causal Inference for Data Science. The section links point to the parts of the book it draws on.