Turn on suggestions

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

Showing results for

- Home
- /
- Analytics
- /
- Stat Procs
- /
- how to compare two models

Options

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

🔒 This topic is **solved** and **locked**.
Need further help from the community? Please
sign in and ask a **new** question.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Posted 09-13-2012 09:27 AM
(11699 views)

Hello everyone,

I have one dataset and I want to model the probability of default from a loan. I used the logistic regression for it but with the data in different structures. I do use the same (original) data, but one model I used the row data and for another model I used the categorized data (I built all the categories) and now I want to be able to compare the two models in order to say if the structure of the data has some influence on the results.

I tought I could maybe compare their misclassification rate, but how could I build such a test to make this comparison, since here I have only one value (the misclassification rate) for each model?

Do you have some idea?

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Rick, I guess I am dating myself....

Dan, Rick's example will work for your situation as long as the dependent variable (LoanDefault, say) is the same. Just specify multiple predictor variables in the ROC statement.

ods graphics on;

proc logistic data=_last_ plots=roc(id=prob);

CLASS d e f;

model LoanDefault = a b c d e f / nofit;

roc 'Model1' a b c;

roc 'Model2' d e f;

roccontrast reference('Model1') / estimate e;

run;

ods graphics off;

7 REPLIES 7

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

One measure of quality of a logistic regression is the ROC curve (often summarized by the c-index). This article provides a general method for comparing two ROC curves that were derived from the same underlying data.

DeLong ER, DeLong DM, Clarke-Pearson DL: Comparing the areas under two or more correlated receiver operating characteristic curves: a nonparametric approach. Biometrics 44:837–845, 1988

At one point, there was a SAS macro around to implement the comparison, but I haven't looked for it in a while.

Doc Muhlbaier

Duke

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello Rick,

as I saw in the example that you sent, the ROCCONTRAST compares the ROC Curves from different the 3 different models with the 3 variables. But you see, for me originally the data is the same, but to adjust the model with categorized data I had to do some modifications and I can't see how should I use this option to compare the curves, since not only the data (structural - variables in classes) but also the chosen variables, I would like to compare both final models from row - and categorized data.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Rick, I guess I am dating myself....

Dan, Rick's example will work for your situation as long as the dependent variable (LoanDefault, say) is the same. Just specify multiple predictor variables in the ROC statement.

ods graphics on;

proc logistic data=_last_ plots=roc(id=prob);

CLASS d e f;

model LoanDefault = a b c d e f / nofit;

roc 'Model1' a b c;

roc 'Model2' d e f;

roccontrast reference('Model1') / estimate e;

run;

ods graphics off;

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hello Doc@Duke,

thank you very much for the explanation! I see now, what should I do.

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

- Mark as New
- Bookmark
- Subscribe
- Mute
- RSS Feed
- Permalink
- Report Inappropriate Content

Hey tarek03,

yep, the c-statistic is a very used measure and I tought on this comparison but you see, if I just look for the values of the c-statistic I am not able to compare them. But now, whith the ROCCONTRAST I know what to do.

But I also think that a very interesting test would be the one, which I could compare the misclassification rate from the models, maybe this could be more specific on the discrimination power of the model. But for this case I don't know yet what to do.

**Available on demand!**

Missed SAS Innovate Las Vegas? Watch all the action for free! View the keynotes, general sessions and 22 breakouts on demand.

What is ANOVA?

ANOVA, or Analysis Of Variance, is used to compare the averages or means of two or more populations to better understand how they differ. Watch this tutorial for more.

Find more tutorials on the SAS Users YouTube channel.