I have a mediation model in which I want X to occur before M which occurs before Y.
When using the gsem command, how do I lag the variables correctly?
I have now done it as follows, but I'm not sure I'm doing it correctly, both when it comes to my year variable lag and the X and Control variables lag in the second equation.
gsem (L2.X i.L2.year L2.Controls -> L1.M, ) (L2.X L1.M i.L2.year L2.Controls -> Y, family(bernoulli) link(probit)), vce(robust) nocapslatent
Also, I seem to lose one year of data too much. Instead of losing two years of observations I lose three. Could the year dummies have anything to do it? I get the following error for the year that 'goes missing':
note: 2019.year omitted because of collinearity
When I use a normal probit regresion with the lags as such: xtprobit Y L2.X L1.M i.L2.year, re vce(robust)
The 2019.year is not omitted, so I don't know what could lead to the collinearity error?
Help would be much appreciated!
When using the gsem command, how do I lag the variables correctly?
I have now done it as follows, but I'm not sure I'm doing it correctly, both when it comes to my year variable lag and the X and Control variables lag in the second equation.
gsem (L2.X i.L2.year L2.Controls -> L1.M, ) (L2.X L1.M i.L2.year L2.Controls -> Y, family(bernoulli) link(probit)), vce(robust) nocapslatent
Also, I seem to lose one year of data too much. Instead of losing two years of observations I lose three. Could the year dummies have anything to do it? I get the following error for the year that 'goes missing':
note: 2019.year omitted because of collinearity
When I use a normal probit regresion with the lags as such: xtprobit Y L2.X L1.M i.L2.year, re vce(robust)
The 2019.year is not omitted, so I don't know what could lead to the collinearity error?
Help would be much appreciated!
Comment