BookmarkSubscribeRSS Feed
Songchan
Calcite | Level 5

Hello guys,

 

I'm working on estimating capm and FF-3-factor model alphas and betas. I downloaded data over 40-year period, and divided all data into ten deciles. I need to estimate the two models in every deciles. My codes are as follow, but the coefficients are all zeros in two models and intercept are the same. I dont know how to fix that problems, could anybody help me out?

proc sort data=aa03; by myrank date ; run;

proc reg noprint data=aa03 outest=ff;
      by myrank date;
      model exret= mkt_rf smb hml/sse;
quit; 

proc means data=ff n mean t probt;
 where 1972<=year(date)<=2017;
     class myrank;
	 var intercept;
run;
proc sort data=aa03; by myrank date ; run;
data aa03; set aa03;
     where 1972<=year(date)<=2017;
run;
proc reg noprint data=aa03 outest=capm;
      model exret= mkt_rf / sse ;
	  by myrank date;
quit; 
proc means data=capm n mean t probt;
where 1972<=year(date)<=2017;
class myrank;
var intercept;
run;
8 REPLIES 8
Reeza
Super User
Do you really want your regression by rank and date? I feel like it should just be rank.
Songchan
Calcite | Level 5

Yes, it works when there is only by rank, but because i'm doing momentum portfolios, I need (alpha in rank 10 - alpha in rank 1 )to calculate WML, if I only have one value for each rank, how could I get t-value for WML

Reeza
Super User
How many records do you have per rank/date combination?
Songchan
Calcite | Level 5

I only have one for per rank/date combination. but my next stop is proc means class rank, to make sure i get one result for every rank

Reeza
Super User
How can you run a regression on a single row of data?
Songchan
Calcite | Level 5

sorry, I meant my result had one for per combination.

 

Around 190 observations.

mkeintz
PROC Star

Your model

 

     model exret= mkt_rf / sse ;
	  by myrank date;

doesn't make sense to me.  The MKT_RF is market rate of return  (commonly SP500 return) excess over risk-free assets, correct?   This is a constant for each date.  Using "by myrank date" means you are regressing EXRET for a collection of companies against a constant.  You should not be surprised to get a zero coefficient for mkt_rf. And the intercept estimate should effectively be the mean of EXRET.   if you want the CAPM (capital asset pricing model) for each company you have to run this regression for each company over the entire time span of interest.  Then you will have CAPM alphas and betas for each company.

 

 

Also, I don't recall you reporting on what variables you were using to assign companies to deciles. What are they?

--------------------------
The hash OUTPUT method will overwrite a SAS data set, but not append. That can be costly. Consider voting for Add a HASH object method which would append a hash object to an existing SAS data set

Would enabling PROC SORT to simultaneously output multiple datasets be useful? Then vote for
Allow PROC SORT to output multiple datasets

--------------------------
Songchan
Calcite | Level 5

I divided data into ten deciles based on past 1-year stock returns

SAS Innovate 2025: Save the Date

 SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!

Save the date!

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

 Ready to level-up your skills? Choose your own adventure.

Browse our catalog!

Discussion stats
  • 8 replies
  • 4425 views
  • 0 likes
  • 3 in conversation