# What is the correct way to calculate the covariate-specific effect in causal inference?

My question is related to the concept named "Covariate-Specific Effects" in the book "Causal Inference in Statistics: A Primer". In Section 3.3, it is called the "w-specific effect" and is calculated as:

$$P(Y=y|do(X=x),W=w) = \sum_t P(Y=y|X=x, W=w, T=t) P(T=t|X=x,W=w).$$

And in Section 3.5, it is called the "z-specific effect" and is calculated as:

$$p(Y=y|do(X=x),Z=z) = \sum_s P(Y=y|X=x,S=s,Z=z) P(S=s|Z=z).$$

I am a bit confused since both of the two formulas calculate the Covariate-Specific Effect but they are indeed different w.r.t the second term. Is this a mistake? What causes this difference?

• My guess is that either Pearl intended to include $X=x$ in the $z$-specific effect, or he intended not to include it in the $w$-specific effect. I would lean towards the latter interpretation, since in the explanation immediately following your second equation, Pearl compares it to Eq. (3.5), but the differences don't mention the $X=x.$ There is no $X=x$ in Eq. (3.5) in the second term. – Adrian Keister Jun 10 at 14:20
• It seems like the second formula is used to calculate the covariate-specific effect in most cases, but how to derive it is not so straightforward. I think it would be more clear if we know how to derive these two formulas. Unluckily, the book didn't detail this. – Charles Jun 10 at 14:45
• Well, it's basically the adjustment formula. If you read the surrounding text, you can see his justification for the tweaks. – Adrian Keister Jun 10 at 15:33
• Yea, just look up the derivation of the adjustment formula, the rest follows from standard probability calculus. – persephone Jun 16 at 16:00