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;
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
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
sorry, I meant my result had one for per combination.
Around 190 observations.
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?
I divided data into ten deciles based on past 1-year stock returns
SAS Innovate 2025 is scheduled for May 6-9 in Orlando, FL. Sign up to be first to learn about the agenda and registration!
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.
Ready to level-up your skills? Choose your own adventure.