Stata The Stata listserver
[Date Prev][Date Next][Thread Prev][Thread Next][Date index][Thread index]

st: 2SLS eivreg with robust standard errors

From   "Henrik Andersson" <[email protected]>
To   <[email protected]>
Subject   st: 2SLS eivreg with robust standard errors
Date   Sat, 15 Jan 2005 18:18:53 +0100


I would like to run a 2SLS errors-in-variables regression with robust
standard errors but do not know how to get robust standard errors. 

I have estimated a 2SLS eiv-regression using the Stata command eivreg
and adjusted the covariance matrix using the following syntax (z1 is the
instrument, and x3 the variable assumed to be measured with error):

.eivreg x1 x2 z1, r(x3 .9)  /* first stage */
.predict x1hat

.eivreg y x1hat x2, r(x3 .9)  /* second stage */

.rename x1hat newx1hat
.rename x1 x1hat
.predict double res, residual
.rename x1hat x1
.rename newx1hat x1hat
.replace res=res^2
.summarize res
.scalar realmse=r(mean)*r(N)/e(df_r)
.matrix bmatrix=e(b) 
.matrix Vmatris=e(V) 
.matrix Vmatrix=e(V)*realmse/e(rmse)^2 
.estimate post bmatrix Vmatrix, noclear
.estimate display

I then tried to use the _robust command, but was not able to get it
right. (I tested my model by running one ivreg with robust standard
errors and compare it with the same syntax as above but with the reg
command instead of ivreg.)

Does anyone know if it is possible to estimate a 2SLS eiv-regression
with robust standard errors in Stata, and if so, how?

Best regards

Henrik Andersson

*   For searches and help try:

© Copyright 1996–2024 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   What's new   |   Site index