BookmarkSubscribeRSS Feed
🔒 This topic is solved and locked. Need further help from the community? Please sign in and ask a new question.
Frieda
Calcite | Level 5

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 🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Rick_SAS
SAS Super FREQ

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

2 REPLIES 2
Rick_SAS
SAS Super FREQ

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.

 

 

Frieda
Calcite | Level 5
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.

sas-innovate-2024.png

Join us for SAS Innovate April 16-19 at the Aria in Las Vegas. Bring the team and save big with our group pricing for a limited time only.

Pre-conference courses and tutorials are filling up fast and are always a sellout. Register today to reserve your seat.

 

Register now!

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.

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