How to regress a variable $Z$ on $X$ if $X$ generates $Y$ which generates $Z$? Suppose variable X generates Y and that Y generates Z, i.e., X → Y → Z. Let X be a standard Gaussian variable, $Y = 0.5X + E_Y$ , where $E_Y$ follows the Gaussian distribution with mean 0 and variance 0.36, and $Z = 0.7Y + E_Z$, where $E_Z$ follows the Gaussian distribution with mean 0 and variance 0.25. Let the sample size go to infinity.
I am trying to regress Z on Y so that it fits the equation of $\tilde{z} = \alpha{x}$. I attempted to just substitute $Y = 0.5X + E_Y$ into the equation of $Z = 0.7Y + E_z$ and got $\tilde{z} = 0.35{x}$. I was wondering if this was correct? Also, if I wanted to regress Z on (X,Y), is this the right method to do so?
 A: Here you can have a simulation in R to give you an insight:
rm(list=ls())

set.seed(42)
n = 1000000
x = rnorm(n)
y = 0.5*x+rnorm(n,mean=0,sd=sqrt(0.36))
z=0.7*y+rnorm(n, mean=0, sd=sqrt(0.25))

#########################################################################

lm(z~x-1) # this is the model z on x without intercept

Call:
lm(formula = z ~ x - 1)

Coefficients:
 x  
0.3507 

#########################################################################

lm(formula = z ~ x + y - 1) # this is the model z on x and y (without intercept)

Coefficients:
  Estimate   Std. Error  t value   Pr(>|t|)    
x 0.0015368  0.0006501   2.364     0.0181 *  
y 0.6988401  0.0008333   838.687   <2e-16 ***

As stated in the comments, yes, you can plug the equation of $Y$ in the equation of $Z$ and get $Z = 0.35X + 0.7 \epsilon_Y + \epsilon_Z$. Where the expectation $E[Z] = 0.35X$.
For your second question, as you can see the estimated coefficient of $Y$ is close to the $0.7$ of the equation of $Z$, while $X$ is irrilevant.
