turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- SAS Programming
- /
- SAS Procedures
- /
- Proc model vs Proc reg? Return, Fama and French da...

Topic Options

- RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-31-2018 12:21 AM - edited 01-31-2018 12:21 AM

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

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to KrisDeng

01-31-2018 09:30 AM

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;

All Replies

Solution

01-31-2018
06:54 PM

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to KrisDeng

01-31-2018 09:30 AM

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;

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

01-31-2018 07:02 PM

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.

- Mark as New
- Bookmark
- Subscribe
- RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to KrisDeng

01-31-2018 08:17 PM

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.