# Conditional expectation given event and random variable

Let $W$ be a random variable that only takes on the values $1$ or $0$. Let $X$ and $Y$ be two other random variables. I came across the following: $$\mathbb{E}(Y|W=1, X)$$ How is this 'conditional expectation' even defined? It doesn't seem to fit the usual definition of a conditional expectation because $W=1$ is an event while $X$ is a random variable.

I was hoping to find a definition similar to that of $\mathbb{E}(Y|X)$, which has the property that $$\int_{B} \mathbb{E}(Y|X) dP=\int_{B} Y dP$$ for all $B \in\sigma(X)$.

Suppose we have observations $Y_i=W_i Y_i(1)+(1-W_i)Y_i(0)$ where the random variable $W_i \in\{0,1\}$ and the two random variables $Y_i(0), Y_i(1)$ can each be described by a regression model, that is $$Y_i(w)=\beta_{w,0}+\beta_{w,1}X_i+\epsilon_{w,i}, \hspace{5mm} w\in\{0,1\}$$ When the author writes $E(Y_i|W_i=1, X_i)$, I am pretty sure he means that $$E(Y_i|W_i=1, X_i)=\beta_{1,0}+\beta_{1,1}X_i$$ but I am wondering if this conditional expectation is well defined or made up notation.

• $E(Y|W=1,X)$ may be shorthand notation for $g(X)$ where $g(x)=E(Y|W=1, X=x)$. So it's a function of the random variable $X$ and thus itself a random variable. – Jarle Tufto Jun 17 '18 at 12:55
• @JarleTufto does the tower law hold in that case, that is $\mathbb{E}(\mathbb{E}(Y|W=1, X))=\mathbb{E}(Y|W=1)?$ – Joogs Jun 17 '18 at 16:02
• Yes, all laws of probability also hold conditionally. – Jarle Tufto Jun 17 '18 at 16:40
• @JarleTufto , it appears I made a mistake in the above, it should be $$\mathbb{E}(\mathbb{E}(Y|W=1, X)|W=1)=\mathbb{E}(Y|W=1)$$ which looks very similar to the tower law $$\mathbb{E}(\mathbb{E}(Y|W, X)|W)=\mathbb{E}(Y|W)$$, but how do we know that the first expression is true as well? It seems that your general statement "all laws of probability also hold conditionally" plays a role here: namely, the tower law also holds conditionally on the event $W=1$. Do you have any reference explaining why this is the case? – Joogs Jun 17 '18 at 18:09
• @Joogs: Most introductory books in probability theory will establish that a conditional probability with a given condition is a probability measure (i.e., obeys the Kolmogorov axioms). Once that is established, all theorems applying to probability measures hold. – Reinstate Monica Jun 28 '18 at 4:56

This is a fairly standard notation, $\mathbb{E}[Y|W,X]$ being the random variable derived from the pair $(W,X)$. When the realisation of $W$ is one (1) and the realisation of $X$ is $x$, this random variable has as realisation $\mathbb{E}[Y|1,x]$, or in a clearer representation $\mathbb{E}[Y|W=1,X=x]$. Since the only possible realisations of $W$ are $0$ and $1$, the random variable $\mathbb{E}[Y|W,X]$ can only take as values $\mathbb{E}[Y|W=0,X]$ and $\mathbb{E}[Y|W=1,X]$.

• So you are saying that $\mathbb{E}(Y|W=1,X)$ should be intepreted as $f(W=1, X)$ where $f$ is the function in $\mathbb{E}(Y|W, X)=f(W,X)$, which makes sense. Can you give a measure theoretic definition of this expression (similar to the usual conditional expectation $\mathbb{E}(Y|X)$ I gave above) ? Also, does it hold that $\mathbb{E}(\mathbb{E}(Y|W=1, X))=\mathbb{E}(Y|W=1)?$ – Joogs Jun 17 '18 at 15:57
• It should be $$\mathbb{E}(\mathbb{E}(Y|W=1, X)|W=1)=\mathbb{E}(Y|W=1)?$$ – Xi'an Jun 17 '18 at 16:39
• This looks very similar to the the tower property which says that $$\mathbb{E}(\mathbb{E}(Y|W,X)|W)=\mathbb{E}(Y|W)$$, but it is definitely not the same since the RHS in the usual tower property, $\mathbb{E}(Y|W)$, is a random variable while $\mathbb{E}(Y|W=1)$ is just a real number. How do we know $$\mathbb{E}(\mathbb{E}(Y|W=1, X)|W=1)=\mathbb{E}(Y|W=1)$$ is true? – Joogs Jun 17 '18 at 18:04

I will post this as an answer to my own question, but I am not entirely sure if it is correct.

$\mathbb{E}(Y|W=1, X)$ is the random variable defined by having the property:

$$\int_B \mathbb{E}(Y|W=1,X) dP=\int_B Y dP$$ for all $B$ in $\sigma(\{W=1\}\cap C: C \in\sigma(X))$.

From this property it immediately follows that the 'conditional' tower law holds since by definition of the property above $$\mathbb{E}(I_{\{W=1\}}E(Y|W=1,X))=E(I_{\{W=1\}}Y)$$ which implies that $$\mathbb{E}(\mathbb{E}(Y|W=1,X)|W=1)=\frac{\mathbb{E}(I_{\{W=1\}}E(Y|W=1,X))}{P(W=1)}\\=\frac{\mathbb{E}(I_{\{W=1\}}Y)}{P(W=1)}=E(Y|W=1)$$