# Law of iterated expectations with two random variables

Let $X$ and $Y$ be two random variables. I want to calculate $E[X|X<Y]$. I am wondering whether I can use the law of iterated expectations in order to calculate it, i.e. $E[E[X|X<Y,Y]]$. Do I threat $Y$ as a constant in the inner expectation?

Updated.

$E[X|X<Y] = \int_{-\infty}^\infty\left(\int_{-\infty}^y x P(x,y)dx\right) dy$
$E[X|X,Y,Y]$ is simply the inner integral $\int_{-\infty}^y x P(x,y)dx$, so if you try to apply LIE the way you showed, you'll end up with the same integral, i.e. you'll get where you started from: $E[E[X|X<Y,Y]] = \int_{-\infty}^\infty\left(E[X|X<Y,Y]\right) dy=\int_{-\infty}^\infty\left(\int_{-\infty}^y x P(x,y)dx\right) dy$
• I did it because in the sample selection models (econometrics), we have something like $E[v_2|x,y_2] = E[v_2|x,v_2>-x\delta_2] = \lambda(x \delta_2)$ with $\lambda (\cdot) = \phi(\cdot)/\Phi(\cdot)$. Thus, I thought that $E[v_2|y_2] = E[\lambda(x \delta_2)]$ and it should work in both directions. But I don't understand this point well, thus a good explanation would be very helpful. – Kolibris Dec 10 '14 at 18:49
• It's difficult to understand where exactly you're struggling, because the example you gave in the comment is different from the case in your question. There's no jump from $E[v_2|y_2]$ to $E[v_2|x,y_2]$ for you to expect that there has to be the jump backwards. Because that's what you're trying to do in your question. – Aksakal Dec 10 '14 at 19:41
• I thought about it, but still I don't understand. So, if I want to calculate $E[v_2|y_2=1] = E[E[v_2|y_2=1,x]] = E[E[v_2|x,v_2 > x \delta_2]]$. But is is the same what I have, isn't it? – Kolibris Dec 10 '14 at 22:07