Expectation of structural equation I am trying to learn about structural equations, and in this post here Correlation, regression and causal modeling I am having difficulties trying to prove the answer.
The problem is, given structural equations
$$U=\epsilon_u$$
$$X=\delta U +\epsilon_x $$
$$Y=\beta X+\gamma U+\epsilon_y$$
Where all terms denoted by ϵ are mean zero and mutually independent and U, X and Y have been standardized (mean zero and unit variance). Suppose U is unobserved, then if we observe X=x:
$$E[Y|X=x]=(\beta +\gamma \delta )x \:\:\:\:\:\:\:equation  1$$
If we set X=x, then:
$$E[Y|X=x]=\beta x\:\:\:\:\:\:\:equation  2$$
How can I prove equation 1 and equation 2? I'm stuck at equation 1 because if U is unobserved, how do you do the expectation?
 A: Cure's answer is incorrect.
The formula of the conditional expectation of a bivariate gaussian is:
$$
E[Y\mid X=x] = E[Y] + \frac{Cov(Y,X)}{Var(X)}(x-E[X])\\
$$
Since the variables are standardized, we have that $E[Y] = E[X] = 0$ and that $Var(X) =1$.
And $Cov(Y, X) = \beta Var(X) + \gamma Cov(X, U) = \beta + \gamma\delta$. Thus,
$$E[Y|X=x]=(\beta +\gamma \delta )x$$
As in the original answer.
A: Edit: Carlos Cinelli's answer is the right one.

In this part we don't need to worry about unobservancy. We know DGP, so we know everything. We calculate expectations, as for standard probability calculus random variables.

In the first situation we can calculate $U$ as a function of X:
$U = \frac{(X - \epsilon_x)}{\delta}$
So then when we derive $Y$, it would be:
$Y = \beta X + \frac{\gamma}{\delta}(X - \epsilon_x) + \epsilon_y$
and after some simplification:
$Y = (\beta  + \frac{\gamma}{\delta})X - \frac{\gamma}{\delta} \epsilon_x + \epsilon_y$
When we take expectation, we use assumption, that every $\epsilon$ has expectation zero and $X$ is equal to x. Then:
$\mathbb E(Y|X=x) = (\beta  + \frac{\gamma}{\delta})x$
(So we can see, that the author of mentioned post made a mistake.)
The problem, that $U$ is not observed only has the consequences, that we can not calculate $\mathbb E(Y|X=x, U=u)$ using observed data. We would wish to do so in order to statistically estimate parameter $\beta$ instead of calculating observable $E(Y|X=x)$, which gives us some different value.

In second situation it is much easier, however when we set value of X, we change DGP, because we performed an experiment (which is denoted as $do(X=x)$):

*

*$U=\epsilon_u$

*$X=x$

*$Y=\beta X+\gamma U+\epsilon_y$
In this situation we just substitute for $X$ and $U$:
$Y=\beta x+\gamma \epsilon_u+\epsilon_y$
And calculate the expectation:
$\mathbb E(Y|do(X=x)) = \beta x$
In this situation we do not care about unobserved $U$, because we achieve desired effect, when we estimate this expectation with only $x$.
