## 3.12 Law of Iterated Expectations

SW 2.3

Another important property of conditional expectations is called the law of iterated expectations. It says that

$\mathbb{E}[Y] = \mathbb{E}\big[ \mathbb{E}[Y|X] \big]$ In words: The expected value of $$Y$$ is equal to the expected value (this expectation is with respect to $$X$$) of the conditional expectation of $$Y$$ given $$X$$.

This may seem like a technical property, but I think the right way to think about the law of iterated expectations is that there is an inherent relationship between unconditional expectations and conditional expectations. In other words, although conditional expectations can vary arbitrarily for different values of $$X$$, if you know what the conditional expectations are, the overall expected value of $$Y$$ is fully determined.

A simple example is one where $$X$$ takes only two values. Suppose we are interested in mean birthweight ($$Y$$) for children of mother’s who either drank alcohol during their pregnancy ($$X=1$$) or who didn’t drink alcohol during their pregnancy ($$X=0$$). Suppose the following (just to be clear, these are completely made up numbers), $$\mathbb{E}[Y|X=1] = 7$$, $$\mathbb{E}[Y|X=0]=8$$ $$\mathrm{P}(X=1) = 0.1$$ and $$\mathrm{P}(X=0)=0.9$$. The law of iterated expectation says that \begin{aligned} \mathbb{E}[Y] &= \mathbb{E}\big[ \mathbb{E}[Y|X] \big] \\ &= \sum_{x \in \mathcal{X}} \mathbb{E}[Y|X=x] \mathrm{P}(X=x) \\ &= \mathbb{E}[Y|X=0]\mathrm{P}(X=0) + \mathbb{E}[Y|X=1]\mathrm{P}(X=1) \\ &= (8)(0.9) + (7)(0.1) \\ &= 7.9 \end{aligned}

The law of iterated expectations still applies in more complicated cases (e.g., $$X$$ takes more than two values, $$X$$ is continuous, or $$X_1$$,$$X_2$$,$$X_3$$) but the intuition is still the same.