Dear All,
I need to run an IV estimation, but for some specific reasons I need to do it manually. Obviously, it is necessary to correct the s.e. at the second stage. A post on Stata website suggests the procedure to do so (the only difference is that I included in the first stage even x1, the exogenous regressor in the second stage):
The red part of the code is used to compute correctly the standard errors.
As you can note the result is the same, if I estimate the model using ivregress 2sls:
Manually
ivregress
if I use robust standard errors in both the manual procedure and in the ivregress one the results are substantially different:
Manually with robust s.e.
ivregress with robust s.e.
Theoretically, this is expected, as the variance-covariance matrix is different when robust standard errors are used. However, I cannot figure out how I can reformulate the correction above (the red part) to include to account for the robust variance-covariance matrix. Any suggestion?
Thanks in advance
Dario
I need to run an IV estimation, but for some specific reasons I need to do it manually. Obviously, it is necessary to correct the s.e. at the second stage. A post on Stata website suggests the procedure to do so (the only difference is that I included in the first stage even x1, the exogenous regressor in the second stage):
Code:
sysuse auto, clear
rename price y1
rename mpg y2
rename displacement z1
rename turn x1
regress y2 z1 x1
predict double y2hat
regress y1 y2hat x1
rename y2hat y2hold
rename y2 y2hat
predict double res, residual
rename y2hat y2
rename y2hold y2hat
replace res = res^2
summarize res
scalar realmse = r(mean)*r(N)/e(df_r)
matrix bmatrix = e(b)
matrix Vmatrix = e(V)
matrix Vmatrix = e(V) * realmse / e(rmse)^2
ereturn post bmatrix Vmatrix, noclear
ereturn display
As you can note the result is the same, if I estimate the model using ivregress 2sls:
Manually
Code:
------------------------------------------------------------------------------ y1 | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- y2hat | -882.4067 317.3699 -2.78 0.007 -1515.224 -249.5891 x1 | -626.99 315.5781 -1.99 0.051 -1256.235 2.254868 _cons | 49817.44 19060.57 2.61 0.011 11811.74 87823.15 ------------------------------------------------------------------------------
Code:
ivregress 2sls y1 x1 (y2=z1), small ------------------------------------------------------------------------------ y1 | Coefficient Std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- y2 | -882.4067 317.3699 -2.78 0.007 -1515.224 -249.5891 x1 | -626.99 315.5781 -1.99 0.051 -1256.235 2.254868 _cons | 49817.44 19060.57 2.61 0.011 11811.74 87823.15 ------------------------------------------------------------------------------
Manually with robust s.e.
Code:
------------------------------------------------------------------------------ | Robust y1 | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- y2hat | -882.4067 389.2006 -2.27 0.026 -1658.451 -106.3628 x1 | -626.99 381.1144 -1.65 0.104 -1386.911 132.9304 _cons | 49817.44 23418.69 2.13 0.037 3121.906 96512.98 ------------------------------------------------------------------------------
Code:
------------------------------------------------------------------------------ | Robust y1 | Coefficient std. err. t P>|t| [95% conf. interval] -------------+---------------------------------------------------------------- y2 | -882.4067 313.0633 -2.82 0.006 -1506.637 -258.1763 x1 | -626.99 281.2112 -2.23 0.029 -1187.709 -66.27079 _cons | 49817.44 17619.86 2.83 0.006 14684.45 84950.44 ------------------------------------------------------------------------------
Thanks in advance
Dario
Comment