0
$\begingroup$

I am currently building a logistic regression model for a uni project where I want to model the 'Event' as 'default' i.e. I will be using this model to predict whether a company will not be able to pay back its loan or not.

First, let's use a proxy dataset to allow people to run the code and see some results data baseball; set sashelp.baseball; if logsalary > 6.5 then flag = 1; else flag = 0; run;

Now, I am using the current code to build the model

    ODS OUTPUT
        NOBS = numobs
            (WHERE = (label = "Number of Observations Used")
             KEEP  = label N)
        fitstatistics = fitstats
            (WHERE = (criterion = "-2 Log L")
             KEEP  = criterion InterceptAndCovariates)
        GlobalTests = global_test
            (WHERE = (test = "Wald")
             KEEP  = test ProbChiSq DF)
        parameterestimates = params
            (KEEP = variable estimate WaldChiSq ProbChiSq _ESTTYPE_)
        association = somersd
            (WHERE = (label2 = "Somers' D")
             KEEP  = label2 nvalue2)
        classification = Classification_model
    ;
    PROC LOGISTIC DESCENDING
        DATA=baseball
        PLOTS(ONLY)=NONE;
        MODEL flag (Event = '1') = CR:
        /
        SELECTION=NONE
            CTABLE
            PPROB=(0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)
            LINK=LOGIT;
            OUTPUT OUT =  fitted_model
                          predicted = y_hat
            PREDPROBS  = INDIVIDUAL;
    RUN;
    QUIT;

Now, in my real data, I have ~300 defaults and ~40,000 non-defaults. I have tried 6,000 combinations of 26 factors. However, I get 2 significant models with somers' D of 30%

The biggest issue arises when I combine a number of factors and in the intersect, there is only 1 default to model.

My question is, if I change proc logistic to model Event = '0' i.e. model the event of non-default.

What are the implications of this? What would change when I interpret the results? Am i likely to get better results or do I still lack the ability to differentiate risk?

Code with event = '0' for reference

    ODS OUTPUT
        NOBS = numobs
            (WHERE = (label = "Number of Observations Used")
             KEEP  = label N)
        fitstatistics = fitstats
            (WHERE = (criterion = "-2 Log L")
             KEEP  = criterion InterceptAndCovariates)
        GlobalTests = global_test
            (WHERE = (test = "Wald")
             KEEP  = test ProbChiSq DF)
        parameterestimates = params
            (KEEP = variable estimate WaldChiSq ProbChiSq _ESTTYPE_)
        association = somersd
            (WHERE = (label2 = "Somers' D")
             KEEP  = label2 nvalue2)
        classification = Classification_model
    ;
    PROC LOGISTIC DESCENDING
        DATA=baseball
        PLOTS(ONLY)=NONE;
        MODEL flag (Event = '0') = CR:
        /
        SELECTION=NONE
            CTABLE
            PPROB=(0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9)
            LINK=LOGIT;
            OUTPUT OUT =  fitted_model
                          predicted = y_hat
            PREDPROBS  = INDIVIDUAL;
    RUN;
    QUIT;
$\endgroup$
2
  • $\begingroup$ Why not just try it and see what happens? You might find it instructive. $\endgroup$ Commented Feb 21, 2019 at 16:29
  • $\begingroup$ I'll give it a go! I just hope I don't miss something which means I'll interpret the output incorrectly $\endgroup$
    – user235111
    Commented Feb 21, 2019 at 20:09

1 Answer 1

0
$\begingroup$

Yes, you can choose the class that you prefer as "default" with the only consequence of zeros becoming ones and vice-versa.

However, I don't see the advantage of having 1 non-default rather than 1 default!

$\endgroup$
2
  • $\begingroup$ As I said above, I'll give it a go! I just hope I don't miss something which means I'll interpret the output incorrectly $\endgroup$
    – user235111
    Commented Feb 21, 2019 at 20:09
  • $\begingroup$ Do not worry, there is nothing you can do that would lead to that! Just check that your results make sense $\endgroup$
    – David
    Commented Feb 25, 2019 at 7:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.