How to use ODS OUTPUT to obtain R-squared (and other statistics) in a SAS data set? Thanks.

Reply
Contributor
Posts: 30

How to use ODS OUTPUT to obtain R-squared (and other statistics) in a SAS data set? Thanks.

Hi,

    I want to use ODS OUTPUT to obtain R-squared (and other statistics) in a SAS data set. How can I do it?

    Thanks.

Jian

Super User
Posts: 19,855

Re: How to use ODS OUTPUT to obtain R-squared (and other statistics) in a SAS data set? Thanks.

Posted in reply to jzhang332002

Find the table name using ODS TRACE or reviewing the documentation.

Then add in a statement before the procedure to store the table

ODS TABLE TABLENAME=myTABLENAME;

Occasional Contributor
Posts: 16

Re: How to use ODS OUTPUT to obtain R-squared (and other statistics) in a SAS data set? Thanks.

Posted in reply to jzhang332002

Two ways can get R square into a data set.

  • For most of Stats model, OUTEST is a very useful option
  • ODS OUTPUT statement

A demo code as follows:

ods output  FitStatistics=FitStat;

proc reg data=sashelp.class outest=aa RSQUARE ;

    model weight=age height;

quit;

Good luck!

Hongqiu

Ask a Question
Discussion stats
  • 2 replies
  • 155 views
  • 0 likes
  • 3 in conversation