GMM with Robust Errors

Econometrics questions and discussions

GMM with Robust Errors

Postby nadia » Mon Mar 02, 2009 8:05 pm

I need some help with the following. I'm very new to RATS so please take it easy on me :lol:
I submitted the following syntax to run a GMM (at least, this is how is was directed to submit). I computed the weight matrix in a previous 2sls
CODE:
instruments x1 x2 x3 x4 x5 x6 x7
linreg(inst,robusterrors,wmatrix=imcov) y
## x1 x2 x3 x4

Now, I tried to replicate this in SAS (since I know what I'm doing there) and I was able to duplicate everything except for the standard errors. I know that the 'Robusterrors' is used to get a consistent estimate of the covariance matrix based on White 1980, so I used the following formula
A= inv(X`*Z*inv(Z`*Z)*Z`*X) *X`*Z*inv(Z`*Z);
B=inv(Z`*Z)*Z`*X*inv(X`*Z*inv(Z`*Z)*Z`*X);
mcov = Z`*diag(u)*Z;
acov = A*mcov*B;
There are no lags in this model. Here X is n x k matrix of regressors, Z is an n x l matrix of instruments, and u is and n x 1 vector of squared residuals. But this results in the SAS standard errors slightly different from RATS (ie. SAS Std Error - .013256 vs. RATS Std Error .013219). Should I even worry about this? I would love to have SAS do it for me, but it only offers this on OLS, SUR, 2SLS, and 3SLS - no GMM. I know that my formula works because I duplicated the results for OLS and 2SLS. Any feedback would be greatly appreciated. Thank you in advance.
nadia
 
Posts: 1
Joined: Fri Feb 27, 2009 8:00 pm

Re: GMM with Robust Errors

Postby TomDoan » Tue Mar 03, 2009 11:19 am

There can be some very minor differences in standard errors (and these are quite minor) due to various factors, including whether to "correct" for degrees of freedom. If you check this, you might find that the ratio of the two standard errors is sqrt(nobs/(nobs-4)).
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: GMM with Robust Errors

Postby TomDoan » Tue Mar 03, 2009 7:08 pm

nadia wrote:I need some help with the following. I'm very new to RATS so please take it easy on me :lol:
I submitted the following syntax to run a GMM (at least, this is how is was directed to submit). I computed the weight matrix in a previous 2sls

Code: Select all
instruments x1 x2 x3 x4 x5 x6 x7
linreg(inst,robusterrors,wmatrix=imcov) y
## x1 x2 x3 x4



You should also probably be using

Code: Select all
instruments x1 x2 x3 x4 x5 x6 x7
linreg(inst,optimalweights) y
## x1 x2 x3 x4


which does all the work of computing the weight matrix.
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: GMM with Robust Errors

Postby asmith05 » Thu Apr 28, 2011 9:23 pm

If I understand optimalweights correctly, it estimates the GMM estimator for Heteroskedasticity of the unknown form (i.e. it uses White's consistent estimator).

What if I want to use GMM estimation and I have serial correlation of the unknown form? Can I use optimalweights and replace White's estimator with the Newey-West estimator somehow?

Thanks,

Lee
asmith05
 
Posts: 5
Joined: Thu Mar 24, 2011 8:33 pm

Re: GMM with Robust Errors

Postby TomDoan » Fri Apr 29, 2011 7:22 am

asmith05 wrote:If I understand optimalweights correctly, it estimates the GMM estimator for Heteroskedasticity of the unknown form (i.e. it uses White's consistent estimator).

What if I want to use GMM estimation and I have serial correlation of the unknown form? Can I use optimalweights and replace White's estimator with the Newey-West estimator somehow?

Thanks,

Lee


Yes. OPTIMALWEIGHTS with LWINDOW=NEWEY and the LAGS option. See Section 4.9 in the version 8 User's Guide (section 7.8 in the version 7 UG).
TomDoan
 
Posts: 2720
Joined: Wed Nov 01, 2006 5:36 pm

Re: GMM with Robust Errors

Postby asmith05 » Fri Apr 29, 2011 8:57 pm

Tom,

Thanks so much for the quick reply. For some reason when I read that section in the User's Guide I interpreted it as saying optimalweights used White's only and the lwindow and lags option only corrected the final covariance matrix and didn't actually use it in the estimation of the parameters. This clarifies that for me.

I appreciate it!

Lee
asmith05
 
Posts: 5
Joined: Thu Mar 24, 2011 8:33 pm


Return to General Econometrics

Who is online

Users browsing this forum: No registered users and 1 guest