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
- /
- Analytics
- /
- Stat Procs
- /
- Output adjusted Rsquared when using PROC MODEL com...

Topic Options

- Subscribe to 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
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-11-2016 04:32 PM

Hello,

I hope you can help me on this little problem I got. I am currently running regressions with Newey-West corrections of standard errors. Hence, the command looks as follows.

PROC MODEL DATA=File.Regress PLOTS = none;

TITLE 'Regression';

ENDO return;

EXOG price;

INSTRUMENTS _EXOG_;

PARMS b0 b1;

return= b0 +b1*price;

FIT xret_48 / WHITE BREUSCH=(1 price)

GMM KERNEL=(bart,48,0) VARDEF=n;

RUN;

QUIT;

This command generates results, so I guess its correct. Now, as I need to run about 100 of these regressions with different independent variables, I'd like have an output file containing the parameter estimates for b0 and b1 with p values, the adjusted R-squared and the standard error of the model and the results of the heteroskedasticity tests , i.e. of White and Breusch-Pagan.

Desired database outcome variables:

Title B0 B1 P value b1 P value b1 White's Test Pr> ChiSq Breusch-Pagan Test Pr> ChiSq Adj R-Sq Model 1

If I had this, I'd merge the databases later to have an overview of all the different models. So, in order to get to that point, where do I have to add an output request in my command?

Is that even feasible? All I am finding are options for the PROC REG command, but as I am using PROC MODEL, I am slightly confused.

Hope you can assist me on this!

Thank you :-)

Accepted Solutions

Solution

08-12-2016
09:40 AM

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

Posted in reply to Frieda

08-11-2016 04:57 PM

Briefly:

1) Transpose your data from wide to long so that you have three variables: VarName, Price, and Return.

2) Sort by VARNAME.

3) Use ODS to turn off graphics and exclude all tables.

4) Use ODS OUTPUT to specify that the output table you want be saved to a data set.

5) Use the BY VARNAME statement to run all 100 regression with one call to PROC MODEL

If you have questions about any of these steps, write back regarding which step is confusing and someone can help you or provide a link to an example.

All Replies

Solution

08-12-2016
09:40 AM

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

Posted in reply to Frieda

08-11-2016 04:57 PM

Briefly:

1) Transpose your data from wide to long so that you have three variables: VarName, Price, and Return.

2) Sort by VARNAME.

3) Use ODS to turn off graphics and exclude all tables.

4) Use ODS OUTPUT to specify that the output table you want be saved to a data set.

5) Use the BY VARNAME statement to run all 100 regression with one call to PROC MODEL

If you have questions about any of these steps, write back regarding which step is confusing and someone can help you or provide a link to an example.

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

Posted in reply to Rick_SAS

08-12-2016 09:41 AM

Thank you! That worked out pretty good! Especially the little macro to turn off graphics and exclude all tables is a gamechanger :-). It always took quite a time to load all the tabled in the result viewer and I never even looked at them.