Dear Colleagues,
Need some help here to replicate an example from "ivreg" described here: http://www.stata.com/support/faqs/st...rsive-systems/ . I was attracted to a Note in the page where it says:
Example of ivreg:
As the Note above from the page suggests, the model can be fiitted with SEM and that is what I am interested in. What I would like to know is what would be the relevant SEM code to reproduce the same result. If I type the following:
Can anyone help in implementing the 2sls in SEM as the page prescribed? Many thanks.
Need some help here to replicate an example from "ivreg" described here: http://www.stata.com/support/faqs/st...rsive-systems/ . I was attracted to a Note in the page where it says:
Note: This model could also be fit with sem, using maximum likelihood instead of a two-step method.
Code:
sysuse auto ivregress 2sls price displacement (trunk=headroom), small Instrumental variables (2SLS) regression Source | SS df MS Number of obs = 74 -------------+------------------------------ F( 2, 71) = 11.29 Model | 108641939 2 54320969.4 Prob > F = 0.0001 Residual | 526423457 71 7414414.89 R-squared = 0.1711 -------------+------------------------------ Adj R-squared = 0.1477 Total | 635065396 73 8699525.97 Root MSE = 2722.9 ------------------------------------------------------------------------------ price | Coef. Std. Err. t P>|t| [95% Conf. Interval] -------------+---------------------------------------------------------------- trunk | -222.3396 175.7292 -1.27 0.210 -572.7338 128.0545 displacement | 22.19871 6.071088 3.66 0.000 10.0933 34.30411 _cons | 4844.184 1620.835 2.99 0.004 1612.331 8076.037 ------------------------------------------------------------------------------ Instrumented: trunk Instruments: displacement headroom
Code:
sem (trunk <- headroom) /// (price <- displacement trunk),method(ml) It poduces the following and they are very different: ------------------------------------------------------------------------------ | OIM | Coef. Std. Err. z P>|z| [95% Conf. Interval] ---------------+---------------------------------------------------------------- Structural | trunk <- | headroom | 3.347171 .4405193 7.60 0.000 2.483769 4.210573 _cons | 3.73786 1.36955 2.73 0.006 1.05359 6.422129 -------------+---------------------------------------------------------------- price <- | trunk | 14.33919 87.76796 0.16 0.870 -157.6828 186.3612 displacement | 15.4894 4.087875 3.79 0.000 7.47731 23.50148 _cons | 2911.98 1005.215 2.90 0.004 941.7949 4882.165 ---------------+---------------------------------------------------------------- var(e.trunk)| 10.13883 1.666814 7.346008 13.99345 var(e.price)| 6477314 1064864 4693083 8939878 --------------------------------------------------------------------------------
Can anyone help in implementing the 2sls in SEM as the page prescribed? Many thanks.
Comment