/* Multiple Regression */
data fflib.temp2;
set fflib.famafrenchvariables;
by date;
array y[36] AAREIT_SP_Equity -- SUN_SP_Equity;
do varNum = 1 to dim(y);
varName = vname(y[varNum]);
Reit_rp = y[varNum];
output;
end;
drop AAREIT_SP_Equity -- SUN_SP_Equity;
run;
proc sort data=fflib.temp2; by varName; run;
ods output ParameterEstimates = fflib.ffparam5yrs
(keep= varName Variable Estimate) ;
proc autoreg data=fflib.temp2;
by varName;
model Reit_rp = Mkt_rp smb hml/ dwprob;
test Mkt_rp = 1;
output out=fflib.famafrenchoutput p=p r=r ucl=u lcl=l alphacli=.10;
run;
I am having problems doing a multiple regression for fama and french. The above are my codes and these codes only regress mkt_rp. How should i amend this to regress mkt_rp, smb and hml.
thank you
Hello,
Do you mean that you do not get parameter estimates for the explanatory variables smb and hml?
In the picture of your dataset, the two variables (smb and hml) are constant. That's maybe / probably why.
It would be better to include the LOG. That is more telling than just the code.
Cheers,
Koen
It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.
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.