# Causal effect by back-door and front-door adjustments

If we wanted to calculate the causal effect of $X$ on $Y$ in the causal graph below, we can use both the back-door adjustment and front-Door adjustment theorems, i.e., $$P(y | \textit{do}(X = x)) = \sum_u P(y | x, u) P(u)$$

and

$$P(y | \textit{do}(X = x)) = \sum_z P(z | x) \sum_{x'} P(y|x', z)P(x').$$

Is it an easy homework to show that the two adjustments lead to the same causal effect of $X$ on $Y$? • Is this a real homework? Then please add the self-study tag. Then people may give you hints, leaving the thinking (and learning) to you. Tell us what you tried and where you are stuck. Remember CV is not for outsourcing homework... – Knarpie Nov 10 '17 at 8:34
• Hi Knarpie, it is a part of self-study and not a homework. I am currently reading "Causal Inference in Statistics" by Pearl et al. and spend about 1 hour pondering over the question I asked above, as it is a natural question to ask, but couldn't show the equality. Either I am missing something here, or the two expressions are not equal. – Jae Nov 10 '17 at 9:52
• BTW Pearl's "The Book of Why: The New Science of Cause and Effect" has a chapter on front-door adjustment offering a more intuitive understanding of the math. – RobertF Sep 16 at 13:02

The action $do(x)$ corresponds to an intervention on variable $X$ that sets it to $x$. When we intervene on $X$, this means the parents of $X$ do not affect its value anymore, which corresponds to removing the arrows pointing to $X$.So let's represent this intervention on a new DAG. Let's call the original observational distribution $P$ and the post-intervention distribution $P^*$. Our goal is to express $P^*$ in terms of $P$. Notice that in $P^*$ we have that $U \perp X$. Also, the pre interventional and post interventional probabilities share these two invariances: $P^*(U) = P(U)$ and $P^*(Y|X, U) = P(Y|X, U)$ since we did not touch any arrow entering those variables in our intervention. So:

\begin{aligned} P(Y|do(X)) &:= P^*(Y|X) \\ &=\sum_{U}P^*(Y|X, U)P^*(U|X)\\ &=\sum_{U}P^*(Y|X, U)P^*(U)\\ &=\sum_{U}P(Y|X, U)P(U) \end{aligned}

The derivation of the front door is a bit more elaborate. First notice that there's no confounding between $X$ and $Z$, hence,

$$P(Z|do(X)) = P(Z|X)$$

Also, using the same logic for deriving $P(Y|do(X))$ we see that controlling for $X$ is enough for deriving the effect of $Z$ on $Y$, that is

$$P(Y|do(Z)) = \sum_{X'}P(Y|X', Z) P(X')$$

Where I'm using the prime for notation convenience for the next expression. So these two expressions are already in terms of the pre-intervention distribution, and we simply used the previous backdoor rationale to derive them.

The last piece we need is to infer the effect of $X$ on $Y$ combining the effect of $Z$ on $Y$ and $X$ on $Z$. To do that, notice in our graph $P(Y|Z, do(X)) = P(Y|do(Z), do(X)) = P(Y|do(Z))$, since the effect of $X$ on $Y$ is completely mediated by $Z$ and the backdoor path from $Z$ to $Y$ is blocked when intervening on $X$. Hence:

\begin{aligned} P(Y|do(X)) &= \sum_{Z} P(Y|Z, do(X))P(Z|do(X))\\ &= \sum_{Z} P(Y|do(Z))P(Z|do(X))\\ &= \sum_{Z} \sum_{X'}P(Y|X', Z) P(X')P(Z|X)\\ &= \sum_{Z}P(Z|X) \sum_{X'}P(Y|X', Z) P(X') \end{aligned}

Where $\sum_{Z} P(Y|do(Z))P(Z|do(X))$ can be understood in the following way: when I intervene on $Z$, then the distribution of $Y$ changes to $P(Y|do(Z))$; but I'm actually intervening on $X$ so I want to know how often would $Z$ take a specific value when I change $X$, which is $P(Z|do(X))$.

Hence, the two adjustments give you the same post-interventional distribution on this graph, as we have showed.

Re-reading your question it occurred to me you might be interested in directly showing that the right hand side of the two equations are equal in the pre-interventional distribution (which they must be, given our previous derivation). That's not hard to show directly too. It suffices to show that in your DAG:

$$\sum_{X'}P(Y|Z, X') P(X') = \sum_{U}P(Y|Z, U) P(U)$$

Notice the DAG implies $Y \perp X|U, Z$ and $U \perp Z|X$ then:

\begin{aligned} \sum_{X'}P(Y|Z, X') P(X') &= \sum_{X'}\left(\sum_{U}P(Y|Z, X', U)P(U|Z, X') \right)P(X') \\ &= \sum_{X'}\left(\sum_{U}P(Y|Z, U)P(U| X') \right)P(X') \\ &= \sum_{U}P(Y|Z, U) \sum_{X'}P(U| X')P(X') \\ &= \sum_{U}P(Y|Z, U) P(U) \\ \end{aligned}

Hence:

\begin{aligned} \sum_{Z}P(Z|X) \sum_{X'}P(Y|X', Z) P(X') &= \sum_{Z}P(Z|X)\sum_{U}P(Y|Z, U) P(U)\\ &= \sum_{U}P(U)\sum_{Z}P(Y|Z, U)P(Z|X) \\ &= \sum_{U}P(U)\sum_{Z}P(Y|Z, X, U)P(Z|X, U) \\ &= \sum_{U}P(Y| X, U) P(U)\\ \end{aligned}

• This is a very good and exhaustive answer. The bit where you identify the causal effect through the front-door is, however, superfluous (OP has already done it and it follows straight from the front-door theorem), and it also contains a mistake: There is no "law of total probability" for causal effects. That is, $P(Y|do(X))$ does not generally equal $\sum_{Z}P(Y|do(Z))P(Z|do(X)$, but rather $\sum_{Z}P(Y|Z, do(X))P(Z|do(X))$, which is clearly different. See the big Pearl book on pages 87--88. – Julian Schuessler Nov 11 '17 at 14:37
• @JulianSchuessler that’s why I wrote “can be thought as”, as a way to help understanding, but not literally saying it is. Regarding the front door derivation it wasn’t clear the OP knew how to obtain it, that’s why I put it there. – Carlos Cinelli Nov 11 '17 at 17:17
• Great answer. Thanks, Carlos. The second part of your answer was exactly what I asked for. I have two follow-up questions here. 1) What search strategy did you use for algebraically manipulating the expressions in your second answer? (By squinting long enough at the expressions?) Since the search space is large, I am wondering how an algorithm can be written to be able to automatically come to the same conclusion. – Jae Nov 12 '17 at 21:22
• 2) I was also confused with how to interpret $\sum_z P(Y|\textit{do}(Z)P(Z|\textit{do}(X))$, as my first intuition was like Julian's suggestion. But the Pearl et al.'s book I mentioned uses your expression. I am wondering, whether, in general, when factoring a directed chain where the start node is the cause and end node is the effect, each factor has to be conditioned on $\textit{do}(Z)$ and not on $Z$, where $Z$ is an intermediate note in the chain. – Jae Nov 12 '17 at 21:26
• @Jeevaka this is an assumption encoded in the DAG, implied by its factorization and the assumption that the system is composed of modular, autonomous pieces. Thus, changes in $P(X, U)$ do not affect $P(Y|X, U)$. One way to help thinking about this is to write down the structural equations of both models $M$ (observational model) and $M^*$ (interventional model) and then derive the implied distributions $P$ and $P^*$. You will see that the conditional of $Y$ given $X$ and $U$ will be the same in both. – Carlos Cinelli Feb 4 '19 at 23:15