Would you please help me on the following question?
I want to look at the effect of x on y. I suspect that x affects y in 4 ways: (1) a direct effect, (2) an indirect effect through a, (3) an indirect effect through b, and (4) an indirect effect through c. I have a set of control variables, and instrumental variable a1 for a, b1 for b, and c1 for c.
I run the following code:
gsem (a <- a1 x controls) (b<-b1 x controls) (c<-c1 x controls) (y <- a b c x controls)
Then I calculate the following:
(2) indirect effect through a
nlcom _b[y:a]*_b[a:x]
(3) indirect effect through b
nlcom _b[y:b]*_b[b:x]
(4) indirect effect through c
nlcom _b[y:c]*_b[c:x]
Total effect
nlcom _b[y:x]+(2)+(3)+(4)
Could you please advise me if the above procedure is correct?
Thank you.