Help using Base SAS procedures

Proc model vs Proc reg? Return, Fama and French databse

Accepted Solution Solved
Reply
Contributor
Posts: 22
Accepted Solution

Proc model vs Proc reg? Return, Fama and French databse

[ Edited ]

Hi,

 

I have a data of date, companies and monthly return. I downloaded the 5 factors from Fama and French website. I want to regress the following model:

 

r = alpha + beta*Mkt + s*SMB + h*HML + r*RMW + c*CMA + e

 

I want to get the estimated intercept (alpha), residuals (e) and the factors' parameters for EACH company.

 

I used prog reg and could get some results, but I do not know how to check so I tried to use proc model as well but failed. The system said there is some problems with the "test" variables depending on time so the results will not make sense (or something like that).

 

I would really appreciate it if you could tell me which method is correct, or any possible mistakes that I made, or at least how are they different.

 

Enclosed is the codes I wrote for 2 methods.

 

Any other suggestions would also be much appreciated.

 

proc reg data=I outest=I_result tableout;
by Fund;
C5: model R = Mkt HML SMB RMW CMA /acov;
ods output parameterestimates=I_result2;
run;

proc model data=I outparms=I_para;
endo R;
exog Mkt HML SMB RMW CMA;
instruments _exog_;
parms alpha beta s h r c;
R = alpha +  beta*Mkt+ s*SMB + h*HML + r*RMW + c*CMA;
fit R / GMM Kernel=(BART,1,0) vardef=n; 
test HML, SMB, RMW, CMA; *<-- errors are mostly here I guess, the other parts I follow the webpage of proc model quite closely;
run;
quit;

Thank you very much in advance!

 

Have a nice day.


Accepted Solutions
Solution
‎01-31-2018 06:54 PM
SAS Super FREQ
Posts: 4,246

Re: Proc model vs Proc reg? Return, Fama and French databse

In the CALL to PROC MODEL you are not using the BY statement, so that is probably why your results are different.

Here is some example code that displays the parameter estimates for some small data:

proc sort data=sashelp.class out=class; by sex; run;
ods graphics off;

proc reg data=class outest=I_result tableout;
by sex;
C5: model height = weight age /acov;
ods select ParameterEstimates;
run;

proc model data=class outparms=I_para;
by sex;
endo height;
exog weight age;
instruments _exog_;
parms alpha beta s;
Height = alpha +  beta*weight+ s*age;
fit Height / GMM Kernel=(BART,1,0) vardef=n; 
ods select ParameterEstimates;
run;
quit;

That said, the models you are running are not identical, so it is possible that the estimates might differ in the fourth or fifth decimal place.

 

Regarding the TEST statement, you need to specify the parameter names, not the variable names:

TEST alpha, beta, s, h, r, c;

View solution in original post


All Replies
Solution
‎01-31-2018 06:54 PM
SAS Super FREQ
Posts: 4,246

Re: Proc model vs Proc reg? Return, Fama and French databse

In the CALL to PROC MODEL you are not using the BY statement, so that is probably why your results are different.

Here is some example code that displays the parameter estimates for some small data:

proc sort data=sashelp.class out=class; by sex; run;
ods graphics off;

proc reg data=class outest=I_result tableout;
by sex;
C5: model height = weight age /acov;
ods select ParameterEstimates;
run;

proc model data=class outparms=I_para;
by sex;
endo height;
exog weight age;
instruments _exog_;
parms alpha beta s;
Height = alpha +  beta*weight+ s*age;
fit Height / GMM Kernel=(BART,1,0) vardef=n; 
ods select ParameterEstimates;
run;
quit;

That said, the models you are running are not identical, so it is possible that the estimates might differ in the fourth or fifth decimal place.

 

Regarding the TEST statement, you need to specify the parameter names, not the variable names:

TEST alpha, beta, s, h, r, c;

Contributor
Posts: 22

Re: Proc model vs Proc reg? Return, Fama and French databse

Thank you very much for your reply. I have adapted some of the codes. It certainly helps but I'm faced with the same errors in "variable depending on time" and something like " At 2SLS Iteration 1 convergence assumed" due to the BY group. Probably I am not informed and experienced enough, I will continue to look into this. Other than that, I'd appreciate it any further suggestions.
SAS Super FREQ
Posts: 4,246

Re: Proc model vs Proc reg? Return, Fama and French databse

The message  

At 2SLS Iteration 1 convergence assumed because OBJECTIVE=5.752357E-27 is almost zero (<1E-12)

is not an error, it is a note. It is saying that the "Two-Stage Least Square (2SLS)" method does not need to iterate because the initial approximation already satisfies the convergence criterion.

 

Regarding which analysis is correct, it depends on your data and assumptions. PROC REG is appropriate when each observation is statistically independent. Time series procedures are more appropriate when the observations are serially correlated. That is the value at time t+1 is correlated)with the value at time t.

☑ This topic is solved.

Need further help from the community? Please ask a new question.

Discussion stats
  • 3 replies
  • 244 views
  • 0 likes
  • 2 in conversation