Programming the statistical procedures from SAS

Output adjusted Rsquared when using PROC MODEL command

Accepted Solution Solved
Reply
Occasional Contributor
Posts: 5
Accepted Solution

Output adjusted Rsquared when using PROC MODEL command

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
SAS Super FREQ
Posts: 3,307

Re: Output adjusted Rsquared when using PROC MODEL command

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.

 

 

View solution in original post


All Replies
Solution
‎08-12-2016 09:40 AM
SAS Super FREQ
Posts: 3,307

Re: Output adjusted Rsquared when using PROC MODEL command

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.

 

 

Occasional Contributor
Posts: 5

Re: Output adjusted Rsquared when using PROC MODEL command

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.
☑ This topic is SOLVED.

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

Discussion stats
  • 2 replies
  • 234 views
  • 0 likes
  • 2 in conversation