Sunday Stata Tip | OLS & IV Regressions using GMM:
In this video I show how to estimate an OLS, an IV, and both an OLS and IV simultaneously using GMM in Stata. Code below:
sysuse auto, clear
*GMM, OLS Price on MPG & Instrument MPG with Weight
reg price mpg
ivregress 2sls price (mpg=weight)
gmm (ols:price-{ols_mpg}*mpg-{ols0}), instruments(ols:mpg)
gmm (iv:price-{iv_mpg}*mpg-{iv0}), instruments(iv:weight) winit(unadjusted) onestep
#delimit ;
gmm
(ols:price-{ols_mpg}*mpg-{ols_cons})
(iv: price-{iv_mpg}*mpg-{iv_cons})
,
instruments(ols:mpg)
instruments(iv:weight)
winit(unadjusted, independent)
nolog
;
#delimit cr;
test _b[/ols_mpg]==_b[/iv_mpg]
Негізгі бет You Can Estimate GMM in Stata Part 1, OLS and IV Regressions
Пікірлер: 3