turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

Find a Community

- Home
- /
- Analytics
- /
- Stat Procs
- /
- apply a new data set to a logistic regression mode...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

08-04-2016 06:12 PM

Hello All,

I have a data set named as 'modeldata'. I first use bootstrap to ge a bootstrap sample named 'out'. I fit the logistic model with the bootstrap sample 'out'. Now i want to evaluate the performance of the bootstrap sample model by apply the original data 'modeldat' to it, and check for the c-statistic or c-index. Is there a way to do so?

Thank you!!

I attached my code below, hope that helps.

**PROC** **multtest** DATA=modeldata

nsample= **1** OUTSAMP=OUT SEED=**1**

nocenter noprint BOOTSTRAP;

test mean(pass age height); **run**;

**proc** **logistic** data=out descending out=logisticest;

model pass=age height;

**run**;

Accepted Solutions

Solution

08-10-2016
01:22 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Xiaoningdemao

08-09-2016 08:23 AM

In the first call to PROC LOGISTIC you fit the model. In the second call you need to use the SCORE statement to evaluate the model on a new set of data. The FITSTAT option displays fit statistics for the model evaluated on the new data. The AUC column gives the area under the ROC curve, which is equal to the 'c' statistic in the association table.

Here is an example:

```
ods graphics off;
proc logistic data=sashelp.class descending OUTmodel=LogiModel;
model sex = age weight height;
run;
data newdata;
set sashelp.class;
where 14 <= age <= 16;
run;
proc logistic descending INmodel=logiModel;
score data = newdata fitstat;
run;
```

All Replies

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Xiaoningdemao

08-04-2016 08:00 PM

It's called Scoring a model.

Look at SCORE within PROC LOGISTIC, I believe there's an example in the documentation, or look at PROC PLM.

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

08-08-2016 06:44 PM

Dear Reeza,

Thank you very much!! Following what you suggested, I find this at support. sas: https://support.sas.com/documentation/cdl/en/statug/63033/HTML/default/viewer.htm#statug_logistic_se...

I think by using outmodle and then inmodel, I can use the old model to fit the new data. But, the 'fitstat' option doesn't gave me the c-statistic I need.

Do I have to calculate it manunaly?

What I did before is, store the estimated coefficients of the model estimated by old sampe, assign it as the initial value of the new data, and set convergence criterion to huge number. By doing this will i get what i want? Cause this way i can get the c-statistic. I attached the code below.

Thanks again!!

Best wishes.

ods output Association=C_boot;

proc logistic data=boot descending out=boot_est;

model pass=age gender height;

run;

proc transpose data=C_boot (keep=nValue2) out=C_boot(keep=col4);

run;

ods output Association=C_test;

proc logistic data=newdata descending INEST=boot_est;

model pass=age gender height/GCONV=**100000**;

run;

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Xiaoningdemao

08-08-2016 06:48 PM

I don't know the answer...I've moved the question to the Stats Forum and hopefully one of the stats guru can answer your question.

Perhaps @Rick_SAS?

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Reeza

08-08-2016 07:09 PM

Dear Reeza,

Thanks a lot!!

Best wishes.

Thanks a lot!!

Best wishes.

Solution

08-10-2016
01:22 PM

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Xiaoningdemao

08-09-2016 08:23 AM

In the first call to PROC LOGISTIC you fit the model. In the second call you need to use the SCORE statement to evaluate the model on a new set of data. The FITSTAT option displays fit statistics for the model evaluated on the new data. The AUC column gives the area under the ROC curve, which is equal to the 'c' statistic in the association table.

Here is an example:

```
ods graphics off;
proc logistic data=sashelp.class descending OUTmodel=LogiModel;
model sex = age weight height;
run;
data newdata;
set sashelp.class;
where 14 <= age <= 16;
run;
proc logistic descending INmodel=logiModel;
score data = newdata fitstat;
run;
```

- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

Posted in reply to Rick_SAS

08-10-2016 01:25 PM

Dear Rick,

Perfect!

Thank you very much~

PS: I read a few of your blogs on other topics lately. I found them very helpful~~

Best wishes.

Perfect!

Thank you very much~

PS: I read a few of your blogs on other topics lately. I found them very helpful~~

Best wishes.