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;