Programming the statistical procedures from SAS

how to compare two models

Reply
Occasional Contributor
Posts: 16

how to compare two models

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

Valued Guide
Posts: 2,108

Re: how to compare two models

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.

SAS Super FREQ
Posts: 3,319

Re: how to compare two models

You don't need the macro anymore. This is now built into PROC LOGISTIC via the ROCCONTRAST statement: http://support.sas.com/documentation/cdl/en/statug/63962/HTML/default/viewer.htm#statug_logistic_sec...

Occasional Contributor
Posts: 16

Re: how to compare two models

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.

Valued Guide
Posts: 2,108

Re: how to compare two models

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;

Occasional Contributor
Posts: 16

Re: how to compare two models

Hello Doc@Duke,

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

N/A
Posts: 1

Re: how to compare two models

The fastest and easiest way is to compare the c-stat values between the 2 models.  c-stat ranges between 0.5 and 1.  The higher the c-stat, the better the performance and accuracy of the model.  And PROC LOGISTIC returns c-stat. c-stat is nothing but the area between the 45 degree line and the curve, which is the ROC.

Occasional Contributor
Posts: 16

Re: how to compare two models

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.

Ask a Question
Discussion stats
  • 7 replies
  • 2713 views
  • 3 likes
  • 4 in conversation