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;
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
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
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
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
Thank you very much Koen!
it's working (-:
Best Regards,
Lior
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
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
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.