BookmarkSubscribeRSS Feed
mspak
Quartz | Level 8

Dear all,

Good days to everyone here. I wish to run regression using Fama Macbeth approach. I obtained the following macro program:

%macro  FamaMacbeth(dset, depvar, indvars);

/******run cross-sectional regressions by fyear for all firms and report the means. ****/
proc sort data=&dset.; by fyear ; run;

ods listing close;
ods output parameterestimates=pe;

proc reg data=&dset. ;
    by fyear;
model &depvar. = &indvars.; run;
quit;

ods listing;

proc means data=pe mean std t probt;
     var estimate; class variable;
title "Fama Macbeth estimates";
ods output summary=summary parameterestimates=pe;
run;
%mend;

I can get the average estimates of the coefficient, t statistics and so on. However, the average adjusted R square ( = sum of adjusted R square for all the years divided by number of year)  is not shown.

I wish to seek for helps on how to get the average adjusted R square from SAS.

Thank you and hope to get the reply sooner.

Regards,

mspak

6 REPLIES 6
SteveDenham
Jade | Level 19

Without going into a lot of matrix algebra, how is such a value meaningful?  Averages of proportions (which is what an Rsquare is) are not good estimators.  Consider that one of your adjusted R squares refers to a year with a LOT of residual variation, and consequently, the average Rsquare will be considerably lower than what is seen in all other years.  Does an average even make sense here?  Wouldn't something like (total explained variability summed over all years)/(total variability summed over all years) be a better estimate?  And that assumes that there is no covariance between years.

Not really helpful with the question posed, but it is something you ought to think about, in my opinion.

Steve Denham

mspak
Quartz | Level 8

Hi Steve,

Thank you for your suggestion. My method is suggested by prior researchers. I have to run OLS for each year. The program will provide me with adjusted R-square for each model (each year). I have 12 years in my dataset, then I will have 12 regressions. All of the estimates (parameters) will be averaged over 12, same as to the adjusted R-square.

I found the following program is workable for calculating the average adjusted R square:

data
MSE (drop=label2 cValue2 nValue2 cValue1)
RSquare (drop=label1 cValue1 cValue2 nValue1)
AdjRSQ (drop=label1 cValue1 cValue2 nValue1);
set fitstats;
if label1 = "Root MSE" then output MSE;
if label2 = "R-Square" then output RSquare;
if label2 = "Adj R-Sq" then output AdjRSq;
run;

DATA mse1 (drop=label1); set mse;
RENAME nValue1 = MSE;
RUN;

DATA RSquare1 (drop=label2); set RSquare;
RENAME nValue2 = RSquare;
RUN;

DATA AdjRSq1 (drop=label2); set AdjRSq;
RENAME nValue2 = AdjRSq;
RUN;

data stat;
merge mse1 RSquare1 AdjRSq1;
by fyear model dependent; run;

proc transpose data= stat
out=stat1; id fyear;
run;

DATA STAT2 (keep=_NAME_ average); SET STAT1;
average = MEAN(of _:);
run;

proc print data=stat2;
title 'Average Fit statistic of Fama Macbeth regression';
run;

Thank you for your comment. I also provide the program for reference (to others).

Regards,

mspak

Reeza
Super User

Wait, you mean the Finance/Wall Street is doing something that doesn't make sense? Smiley Happy

SteveDenham
Jade | Level 19

It's what happens when you hire physics majors to do non-Bayesian statistics... Smiley Wink

Steve Denham

mspak
Quartz | Level 8

Hi Steve,

I am not majoring in econometrics. I am doing corporate finance (with firm-year observations) research, therefore, we normally don't use a very advanced method.

There is no perfect method in the the world. Most of the time, due to the limitation of data, we can't apply a very sophisticated method with many lags.

Happy New Year to you Smiley Happy

Regards,

Mspak

SteveDenham
Jade | Level 19

If any offense from my comments, I sincerely apologize.

I think Reeza and I were making an observation that sometimes methods become "standard" and there may be technical problems that weren't originally recognized.  It's very common in the field where I work (pharmaceutical and medical device safety).

Happy New Year to you as well, Mspak.

Steve Denham

sas-innovate-2024.png

Don't miss out on SAS Innovate - Register now for the FREE Livestream!

Can't make it to Vegas? No problem! Watch our general sessions LIVE or on-demand starting April 17th. Hear from SAS execs, best-selling author Adam Grant, Hot Ones host Sean Evans, top tech journalist Kara Swisher, AI expert Cassie Kozyrkov, and the mind-blowing dance crew iLuminate! Plus, get access to over 20 breakout sessions.

 

Register now!

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
  • 3411 views
  • 5 likes
  • 3 in conversation