# Get the R2 from GMM Newey-West in SAS

I'm running a simple cross-sectional regression where I first run regressions for every year of observations and then I'm running this code to get the Newey-West corrected standard errors:

ods listing close;
ods output parameterestimates=pe;
proc reg data=dset;
by year;
model depvar = indvars; run;
quit;
ods listing;

proc means data=pe mean std t probt;
var estimate; class variable;
run;

proc sort data=pe; by variable; run;

%let lags=3;
ods output parameterestimates=nw;
ods listing close;
proc model data=pe;
by variable;
instruments / intonly;
estimate=a;
fit estimate / gmm kernel=(bart,%eval(&lags+1),0); run;
quit;
ods listing;

proc print data=nw; id variable;
var estimate--df; format estimate stderr 7.4;
run;


What's the best way to get the R2 once I correct for the standard errors for the cross-sectional regression?

-
add comment

## 1 Answer

Newey-West standard errors only change the estimates of the standard errors. Since the estimates of the coefficients themselves don't change, the $R^2$ of the model doesn't change.

-
ah right...I see! Thanks, so should I simply take the average R2 from my first regression? proc reg data=dset; by year; model depvar = indvars; run; quit; –  CharlesM Aug 7 '12 at 20:45
Averaging $R^2$ isn't something that you'd want to do. I guess that I don't understand what you are trying to achieve. –  Charlie Aug 7 '12 at 21:12
Which R2 should I report?...from my first regression where I regress by year or the cross-sectional one once I correct using the NW method? I don't know how to retrive the R2 in SAS once I correct for the NW method. –  CharlesM Aug 7 '12 at 21:31
If you have multiple models, then you have many $R^2$'s. You could join all your models together in one regression, but that would be another subject (look for panel data or SUR). –  Charlie Aug 7 '12 at 21:48
Oh right! I see thanks a lot! –  CharlesM Aug 8 '12 at 0:41
add comment