GMM with Robust Errors
Posted: Mon Mar 02, 2009 7:05 pm
I need some help with the following. I'm very new to RATS so please take it easy on me
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.
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.