# Double expected value, which comes first?

In the following equation, the outer expectation is over the distribution $X_i|T_i = 1$

$\tau|_{T = 1} = E(E(Y_i|X_i, T_i = 1) - E(Y_i|X_i, T_i = 0)|T_i =1)$

Are we taking the expected value of $X_i$ given $T_i = 1$ and then taking the expected values of the $Y$s or the other way around? Essentially, do we work out the inner expectations or the outer expectations first, or are they the same thing?

• The variables come from a paper on propensity score matching where $Y_i$ is an outcome variable, $T_i$ is a treatment indicator, and $X_i$ is a pretreatment variable. The parameter of interest, $\tau|_{T = 1}$, is the average treatment effect on the treated – EconStats Jul 2 '15 at 19:23
• Intuitively, I would have thought that the equation meant we take the expected value of $X_i$ for the treated observations, and then, take the expected values of the outcomes for the observations with respect to this specific value of $X$ and their treatment status? – EconStats Jul 2 '15 at 19:26