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;
ods listing;

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

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;
 fit estimate / gmm kernel=(bart,%eval(&lags+1),0); run;
ods listing;

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

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


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.

  • $\begingroup$ 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; $\endgroup$ – CharlesM Aug 7 '12 at 20:45
  • $\begingroup$ 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. $\endgroup$ – Charlie Aug 7 '12 at 21:12
  • $\begingroup$ 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. $\endgroup$ – CharlesM Aug 7 '12 at 21:31
  • $\begingroup$ 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). $\endgroup$ – Charlie Aug 7 '12 at 21:48

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.