GMM with Robust Errors

Econometrics questions and discussions
nadia

GMM with Robust Errors

Unread post by nadia »

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.
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GMM with Robust Errors

Unread post by TomDoan »

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: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GMM with Robust Errors

Unread post by TomDoan »

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.
asmith05
Posts: 15
Joined: Thu Mar 24, 2011 8:33 pm

Re: GMM with Robust Errors

Unread post by asmith05 »

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
TomDoan
Posts: 7814
Joined: Wed Nov 01, 2006 4:36 pm

Re: GMM with Robust Errors

Unread post by TomDoan »

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).
asmith05
Posts: 15
Joined: Thu Mar 24, 2011 8:33 pm

Re: GMM with Robust Errors

Unread post by asmith05 »

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
Post Reply