# Definition of covariate-specific effect: why after, not before intervention?

Pearl et al. "Causal Inference in Statistics: A Primer" (2016) p. 70 contains the following text regarding conditional interventions and covariate-specific effects:

[S]uppose a doctor decides to administer a drug only to patients whose temperature $$Z$$ exceeds a certain level, $$Z=z$$. In this case, the action will be conditional upon the value of $$Z$$ and can be written $$do(X=g(Z))$$, where $$g(Z)$$ is equal to one when $$Z>z$$ and zero otherwise (where $$X=0$$ represents no drug). <...> The result of implementing such a policy is a probability distribution written $$P(Y=y | do(X=g(Z)))$$, which depends only on the function $$g$$ and the set $$Z$$ of variables that drive $$X$$.

In order to estimate the effect of such a policy, let us take a closer look at another concept, the “$$z$$-specific effect” of $$X$$ <...>. This effect, written $$P(Y=y | do(X=x), Z=z)$$ measures the distribution of $$Y$$ in a subset of the population for which $$Z$$ achieves the value $$z$$ after the intervention. For example, we may be interested in how a treatment affects a specific age group, $$Z=z$$, or people with a specific feature, $$Z=z$$, which may be measured after the treatment.

Question: Why is the “$$z$$-specific effect” defined for a subset of the population where $$Z$$ achieves value $$z$$ after the intervention? The preceding discussion motivates the case for considering a case before the intervention (and it seems likely to me that such cases should be widespread). In some (many) cases there will be no difference between before and after (the above mentioned age group or feature seem to fall in that category), but when there is, what is the reason for preferring a definition involving after rather than before?

(I suppose the answer could be that it is just a definition that needs no justification. I am just wondering if there is more to it than that.)

If you look at page 63, the author talks about a $$w$$-specific effect (same idea, different letter), and mentions that:

How then do we compute the causal effect of $$X$$ on $$Y$$ for a specific value $$w$$ of $$W?$$ In Figure 2.8, $$W$$ may represent, for example, the level of posttreatment pain of a patient, and we might be interested in assessing the effect of $$X$$ on $$Y$$ for only those patients who did not suffer any pain.

So in this example, we are interested in a $$W$$-specific effect that can't even be measured until after the treatment! Just a little later on, the author continues:

Computing such $$W$$-specific causal effects is an essential step in examining effect modification or moderation, that is, the degree to which the causal effect of $$X$$ on $$Y$$ is modified by different values of $$W.$$

And he goes on with an illustrative example.

I would think that if you were interested in a pre-treatment variable, you would include that inside the do operator (or you'd AND it with another do operator). So suppose you wanted to consider the pre-treatment effects of $$S$$ on the causal effect of $$X$$ on $$Y$$. Then I think you'd be interested in computing $$P(Y=y|\operatorname{do}(X=x),\operatorname{do}(S=s)).$$ Alternatively, if you don't want to intervene on a pre-treatment variable, you could use the same expression as for post-treatment variables: $$P(Y=y|\operatorname{do}(X=x),Z=z).$$

• Thank you, this makes sense. I do not necessarily agree with your last paragraph, though. I think the example included in my question is one where we do not want to intervene on $Z$ but are interested in conditioning on it. Other than that, things have been clarified. (I am inclined to accept your answer, but I usually wait a few days before doing that just in case someone else chips in with a conflicting view.) Commented Apr 7, 2020 at 13:28
• @RichardHardy True, you wouldn't necessarily need to intervene on a pre-treatment variable, although you certainly could. If you don't want to intervene on a pre-treatment variable, then I see no reason you couldn't just use the same expression $$P(Y=y|\operatorname{do}(X=x),Z=z)$$ as you do for post-treatment variables. Commented Apr 7, 2020 at 13:58
• I guess you are right. Thank you. Commented Apr 7, 2020 at 14:06
• Or maybe not quite? It might happen that an intervention on $X$ affects $Z$, so the pre-intervention value of $Z$ might differ from the post-intervention value. Then I could no longer use $P(Y=y|do(X=x),Z=z)$ when wishing to condition on the pre-intervention value $z_{pre}$ of $Z$. Commented Apr 7, 2020 at 14:18
• Wouldn't that depend on when you measured $Z?$ What would stop you from measuring $Z$ before the treatment? Commented Apr 7, 2020 at 14:19