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

ODS OUTPUT goes immediately before the PROC statement, or inside the PROC, before RUN;

--
Paige Miller
srikanthyadav44
Quartz | Level 8

dear Mr. Paigemiller

as you have replied, i run the code in two different ways. Still i am not getting the required output

regression output is generated, but R-squared values are not  produced separately. 

i used the code as follows

ods output modelfit=modelfit;
proc reg data=stocks;
model Y1- Y5= X1 X2;
RUN;
QUIT;

OR
proc reg data=stocks;
model Y1- Y5= X1 X2;
ods output modelfit=modelfit;
RUN;
QUIT;


I am getting the following error in log


OPTIONS NONOTES NOSTIMER NOSOURCE NOSYNTAXCHECK;
NOTE: ODS statements in the SAS Studio environment may disable some output features.
73
74 proc reg data=stocks;
75 model Y1- Y5= X1 X2;
76 ods output modelfit=modelfit;
77 RUN;

78 QUIT;

WARNING: Output 'modelfit' was not created. Make sure that the output object name, label, or path is spelled correctly. Also,
verify that the appropriate procedure options are used to produce the requested output object. For example, verify that
the NOPRINT option is not used.
NOTE: PROCEDURE REG used (Total process time):
real time 17.00 seconds
cpu time 3.96 seconds

kindly help me out

thanks in advance

 

PaigeMiller
Diamond | Level 26

This appears to be my mistake.

 

It should say

 

ods output FitStatistics=FitStatistics;
--
Paige Miller
srikanthyadav44
Quartz | Level 8
Dear Mr. Paigemiller

i run the code successfully.

thanks a lot for your help.
ballardw
Super User

@srikanthyadav44 wrote:

dear all, 

i have to run the regression where in the independent varaibles will be same, but dependent variables will change each time. 

I have nearly 200 dependent variables. 

i have to run the regression repeatedly for 200 times for each dependent variable.

Finally, I have to save the R-squared and adjusted R-squared value of each regression in a separate file along with the name of the dependent variable.

 

 


Since there are quite a few procedures in SAS that perform regression perhaps you can share the code you would run for one of the dependent variables.

Some procedures require slightly different methods of placing output into data sets, so your request for the r-squared may rely on the procedure. And possibly which r-squared for some sorts of regressions.

 

And what is to be done with the 200 output data sets?? You may want to rethink why you think you need so many data sets. This sounds like your next steps my involve lots of "loopy" code that may not be needed.

hackathon24-white-horiz.png

The 2025 SAS Hackathon has begun!

It's finally time to hack! Remember to visit the SAS Hacker's Hub regularly for news and updates.

Latest Updates

Mastering the WHERE Clause in PROC SQL

SAS' Charu Shankar shares her PROC SQL expertise by showing you how to master the WHERE clause using real winter weather data.

Find more tutorials on the SAS Users YouTube channel.

Discussion stats
  • 19 replies
  • 2844 views
  • 4 likes
  • 4 in conversation