Turn on suggestions

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

Showing results for

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

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 01-31-2018 12:21 AM
(1986 views)

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.

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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;

3 REPLIES 3

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

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.

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

What is Bayesian Analysis?

Learn the difference between classical and Bayesian statistical approaches and see a few PROC examples to perform Bayesian analysis in this video.

Find more tutorials on the SAS Users YouTube channel.

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