BookmarkSubscribeRSS Feed
☑ This topic is solved. Need further help from the community? Please sign in and ask a new question.
Toni2
Lapis Lazuli | Level 10

hi, i have the below 

 

i want the output "a" table to extract the R2 (rsquare) 

 

Is there any way to do this ?

 

proc logistic data=mydataset;
model bad=INTEREST_RATE/rsquare;
Output out=a;
run;

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
PaigeMiller
Diamond | Level 26
proc logistic data=mydataset;
    ods output rsquare=a;
    model bad=INTEREST_RATE/rsquare;
run;
--
Paige Miller

View solution in original post

9 REPLIES 9
PaigeMiller
Diamond | Level 26
proc logistic data=mydataset;
    ods output rsquare=a;
    model bad=INTEREST_RATE/rsquare;
run;
--
Paige Miller
Toni2
Lapis Lazuli | Level 10
great! thanks you very much!
Toni2
Lapis Lazuli | Level 10
sorry, how can i combine noprint in the above?
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
You can use the ODS tables to obtain a variety of statistics related to the model. Putting this statement at the top of your program will export r-squared to a table:

ods output RSQUARE=rsqvalue;

There are a variety of things you can export with ODS tables and they are summarized here: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_logistic_se...
Toni2
Lapis Lazuli | Level 10
thanks. How can i stop printing the results using ods?
PaigeMiller
Diamond | Level 26

@Toni2 wrote:
thanks. How can i stop printing the results using ods?

Somewhere in your program you have turned on writing to ODS. If you want it off, use 

 

ods html close;

assuming you meant HTML output.

 

 

--
Paige Miller
Toni2
Lapis Lazuli | Level 10
thanks, i mean i use the below code and i want stop printing the results. I just want them in the output "a"

proc logistic data=mydataset;
ods output rsquare=a;
model bad=INTEREST_RATE/rsquare;
run;
svh
Lapis Lazuli | Level 10 svh
Lapis Lazuli | Level 10
Try
ODS OUTPUT CLOSE;
Toni2
Lapis Lazuli | Level 10
thank you

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

How to Concatenate Values

Learn how use the CAT functions in SAS to join values from multiple variables into a single value.

Find more tutorials on the SAS Users YouTube channel.

SAS Training: Just a Click Away

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

Browse our catalog!

Discussion stats
  • 9 replies
  • 2326 views
  • 3 likes
  • 3 in conversation