Programming the statistical procedures from SAS

How to obtain c-statistics from multiple 'proc logistic' in a single data sheet

Accepted Solution Solved
Reply
New Contributor
Posts: 2
Accepted Solution

How to obtain c-statistics from multiple 'proc logistic' in a single data sheet

Hi SAS communities,

I have the following challenge:

I have a logistical regression model including a binary outcome and some categorical and continuous covariates.
The logistical regression model achieved a c-statistic (or area under the ROC curve) of 0.94.

I have then used bootstrapping (unrestricted random sampling) to create 50 data sets (later I will do 1000) put together in one data set, sorted by replicate number (1-50).

Then I run the proc logistic on the large data set, using a 'by replicate' statement. 
In the SAS results window I how have 50 separate c-statistics.

Which leads me to the question:
How do I combine the 50 separate c-statistics in the results window, so that I can obtain a single median c-statistics for all the bootstrapped data sets? Preferably also with confidence limits...

I have attached the SAS code in a word file.

Best,
Sebastian Wiberg, MD


Accepted Solutions
Solution
‎04-19-2018 02:37 PM
Super User
Posts: 23,662

Re: How to obtain c-statistics from multiple 'proc logistic' in a single data sheet

How to store your results into a table:

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

Look at the PERSIST option on the ODS OUTPUT statement that will allow you to stack them all into one until it's done.

http://documentation.sas.com/?docsetId=odsug&docsetTarget=p0oxrbinw6fjuwn1x23qam6dntyd.htm&docsetVer...

 


@scwiberg wrote:

Hi SAS communities,

I have the following challenge:

I have a logistical regression model including a binary outcome and some categorical and continuous covariates.
The logistical regression model achieved a c-statistic (or area under the ROC curve) of 0.94.

I have then used bootstrapping (unrestricted random sampling) to create 50 data sets (later I will do 1000) put together in one data set, sorted by replicate number (1-50).

Then I run the proc logistic on the large data set, using a 'by replicate' statement. 
In the SAS results window I how have 50 separate c-statistics.

Which leads me to the question:
How do I combine the 50 separate c-statistics in the results window, so that I can obtain a single median c-statistics for all the bootstrapped data sets? Preferably also with confidence limits...

I have attached the SAS code in a word file.

Best,
Sebastian Wiberg, MD


 

View solution in original post


All Replies
Solution
‎04-19-2018 02:37 PM
Super User
Posts: 23,662

Re: How to obtain c-statistics from multiple 'proc logistic' in a single data sheet

How to store your results into a table:

https://blogs.sas.com/content/iml/2017/01/09/ods-output-any-statistic.html

 

Look at the PERSIST option on the ODS OUTPUT statement that will allow you to stack them all into one until it's done.

http://documentation.sas.com/?docsetId=odsug&docsetTarget=p0oxrbinw6fjuwn1x23qam6dntyd.htm&docsetVer...

 


@scwiberg wrote:

Hi SAS communities,

I have the following challenge:

I have a logistical regression model including a binary outcome and some categorical and continuous covariates.
The logistical regression model achieved a c-statistic (or area under the ROC curve) of 0.94.

I have then used bootstrapping (unrestricted random sampling) to create 50 data sets (later I will do 1000) put together in one data set, sorted by replicate number (1-50).

Then I run the proc logistic on the large data set, using a 'by replicate' statement. 
In the SAS results window I how have 50 separate c-statistics.

Which leads me to the question:
How do I combine the 50 separate c-statistics in the results window, so that I can obtain a single median c-statistics for all the bootstrapped data sets? Preferably also with confidence limits...

I have attached the SAS code in a word file.

Best,
Sebastian Wiberg, MD


 

New Contributor
Posts: 2

Re: How to obtain c-statistics from multiple 'proc logistic' in a single data sheet

Thank you very much! That did the trick...

/Sebastian

☑ This topic is solved.

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

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