# Solve for iteration of conditional expections

I have been reading The Perils of Peer Effects paper by Josh Angrist http://www.nber.org/papers/w19774

On page 4, he transforms a condition expectation function:

$E(y|x,z)=\beta\mu_{(y|z)}+\gamma x$ where $\mu_{(y|z)}=E(y|z)$

to "a reduced form relation" by "iterating over x"

$E(y|z)=\frac{\gamma}{1-\beta} E(x|z)$

(All variables are mean zero)

I'm not quite sure how it is done and what he exactly means by "iterating over x". I have tried applying the law of total expectation with reference to x. In particular, I don't see how $E(x|z)$ enters the equation.

• Typo, should it be $E(y | z) = \frac{\gamma}{1 - \beta} E(x \mid z)$? May 19 '16 at 6:18

For every value $x$ and $z$ of the random variables $X$ and $Z$, the following relation holds:
$$E[Y \mid X=x, Z=z] = \beta E[Y \mid Z=z] + \gamma x$$
Let $P(X=x \mid Z=z)$ be the probability random variable $X$ takes the scalar value $x$ given that $Z=z$. Multiply both sides: $$E[Y \mid X=x, Z=z] P(X=x\mid Z=z) = \beta E[Y \mid Z=z] P(X=x\mid Z=z) + \gamma x P(X=x \mid Z = z)$$ $$\left(\sum_y y P(Y=y \mid X=x, Z=z)\right) P(X=x\mid Z=z) = \beta E[Y \mid Z=z] P(X=x\mid Z=z) + \gamma x P(X=x \mid Z = z)$$ Bayes rule: $$\sum_y y P(Y=Y, X=x \mid Z=z) = \beta E[Y \mid Z=z] P(X=x\mid Z=z) + \gamma x P(X=x \mid Z = z)$$
Take the summation of both sides over all possible values of x: $$\sum_x \sum_y y P(Y=Y, X=x \mid Z=z) = \sum_x \beta E[Y \mid Z=z] P(X=x\mid Z=z) + \sum_x \gamma x P(X=x \mid Z = z)$$ $$\sum_y y P(Y=Y \mid Z=z) = \beta E[Y \mid Z=z] + \sum_x \gamma x P(X=x \mid Z = z)$$ $$E[Y \mid Z=z] = \beta E[Y \mid Z=z] + \gamma E[X \mid Z=z]$$