BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
lioradam
Obsidian | Level 7

Hello all,

I run the following Fama-Macbeth regression and don't receive R squared and Adj. R squared in the results.

Could you please assist in updating this code, so I will receive the R squared and Adj. R squared?

 

Thank you,

Lior
PROC REG data=final
outest=fm_reg noprint outseb ;
model y=x1 x2 x3;

by GVKEY01;
run;
quit;


proc means data=fm_reg n mean t probt ;

run;

1 ACCEPTED SOLUTION

Accepted Solutions
sbxkoenk
SAS Super FREQ

Here you are :

proc sort data=sashelp.class out=work.sclass;
 by sex; 
run;

ods trace off;
ods output FitStatistics=work.FitStatistics;
proc reg data=work.sclass;
 by sex;
 model height=weight age;
run;

title; footnote;
title1 'mean R**2';
proc means data=work.FitStatistics mean nway;
 where Label2='R-Square';
 var nValue2;
run;

title1 'mean Adjusted R**2';
proc means data=work.FitStatistics mean nway;
 where Label2='Adj R-Sq';
 var nValue2;
run;
title; footnote;
/* end of program */

Koen

View solution in original post

6 REPLIES 6
sbxkoenk
SAS Super FREQ

Hello,

If you get rid of the 'noprint' option in your PROC REG statement, you will get the R-Square(d) in the output window.

Koen

 

lioradam
Obsidian | Level 7

Thank you Koen for the quick answer!  I removed the 'noprint' and receive the results of each separate regression with its R squared and Adj. R squared.

However, I haven't received the mean of all the R squared and Adj. R squared (of all the regressions).

Is there a way to receive the mean R squared and Adj. R squared?

 

Thanks,

Lior

sbxkoenk
SAS Super FREQ

Here you are :

proc sort data=sashelp.class out=work.sclass;
 by sex; 
run;

ods trace off;
ods output FitStatistics=work.FitStatistics;
proc reg data=work.sclass;
 by sex;
 model height=weight age;
run;

title; footnote;
title1 'mean R**2';
proc means data=work.FitStatistics mean nway;
 where Label2='R-Square';
 var nValue2;
run;

title1 'mean Adjusted R**2';
proc means data=work.FitStatistics mean nway;
 where Label2='Adj R-Sq';
 var nValue2;
run;
title; footnote;
/* end of program */

Koen

lioradam
Obsidian | Level 7

Thank you very much Koen!

it's working  (-:

 

Best Regards,

Lior

SteveDenham
Jade | Level 19

I know this is going to sound snarky, but why in the world would you want to average Rsq over multiple regressions?  Each has its own numerator and denominator, but the overall should have the overall explained variance/overall total variance, with the regressions with the highest variability contributing more to the estimate.  The mean of the individual Rsq values would only have value if all of the regressions had approximately the same total variance and approximately the same number of observations.

 

SteveDenham

lioradam
Obsidian | Level 7

Hi Steve,

I know that including Rsq in Fama Macbeth regression is controversial and I probably will not include it in my paper. I also found that SAS calculates the mean of all Rsq including Rsq which are equal to 1 due to lack of  DF which leads to an overestimation of the mean Rsq.

Thanks for your comment,

Lior

Ready to join fellow brilliant minds for the SAS Hackathon?

Build your skills. Make connections. Enjoy creative freedom. Maybe change the world. Registration is now open through August 30th. Visit the SAS Hackathon homepage.

Register today!
What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 6 replies
  • 1174 views
  • 0 likes
  • 3 in conversation