3
$\begingroup$

I am using PROC LOGISTIC along with Class statements to do binary logit model(default=1,non-default=0) on a bank loan dataset where I have 7 numeric independent variables and 1 categorical independent variable.

Hosmer and Lemeshow test yields a p = 0.6757, and Percent Concordant = 73.3 so the model is fine I think.

To my dismay Gini is coming up as 0.2305, and ks is only 35.1.

I there any way I can do anything about the results or am I missing anything?

%let Keepvar= Age_in_years Level_of_education Years_with_Current_Employer 
   Years_at_Current_Address Household_income_in_thousands Debt_to_income_ratio 
   Credit_card_debt__in_thousands Other_debt_in__in_thousands; 
PROC LOGISTIC DATA = work.bankloan descending outest=estimates;
    class Level_of_education (ref='1') / param=ref;
    MODEL Defaulted = &keepvar/selection=backword rsquare lackfit;
RUN;

%macro rankorder(data=, est=, dependent= );
    proc score data = &data score = &est out = mlscore type = parms;
    var &keepvar;
run;

data mlscore;
    set mlscore;
    prob = exp(&dependent.2) /(1+exp(&dependent.2));
run;

proc rank data = mlscore out = mlrankscore groups =10;
    var prob;
    ranks probrank;
run;

proc sql;
select probrank, avg(prob) as probability, count(*) as total,avg(&dependent) as 
  Act_Avg_Response, sum(&dependent) as sum_of_response from mlrankscore group by 
  probrank order by probrank descending;
quit;
%mend;
%rankorder(data=bankloan, est=estimates, dependent=Defaulted);
$\endgroup$
7
  • 1
    $\begingroup$ Can you show your code? However, the HL test and the GINI test are for different things. HL is a test of goodness of fit of the model, GINI is a test of how much the model improves your prediction of the DV. KS usually stands for Kolmoogorov Smirnov and I am not sure what you are using it for, here. $\endgroup$
    – Peter Flom
    Sep 9, 2012 at 11:47
  • $\begingroup$ I am trying a decile analysis; The maximum difference across that 10 buckets is called the KS value $\endgroup$
    – pmr
    Sep 9, 2012 at 21:18
  • $\begingroup$ %let Keepvar= Age_in_years Level_of_education Years_with_Current_Employer Years_at_Current_Address Household_income_in_thousands Debt_to_income_ratio Credit_card_debt__in_thousands Other_debt_in__in_thousands ; PROC LOGISTIC DATA = work.bankloan descending outest=estimates; class Level_of_education (ref='1') / param=ref ; MODEL Defaulted = &keepvar/selection=backword rsquare lackfit; RUN; $\endgroup$
    – pmr
    Sep 9, 2012 at 21:22
  • $\begingroup$ %macro rankorder(data=, est=, dependent= ); proc score data = &data score = &est out = mlscore type = parms; var &keepvar; run; data mlscore; set mlscore; prob = exp(&dependent.2) /(1+exp(&dependent.2)); run; proc rank data = mlscore out = mlrankscore groups =10; var prob; ranks probrank; run; proc sql; select probrank, avg(prob) as probability, count(*) as total,avg(&dependent) as Act_Avg_Response, sum(&dependent) as sum_of_response from mlrankscore group by probrank order by probrank descending; quit; %mend; %rankorder(data=bankloan, est=estimates, dependent=Defaulted); $\endgroup$
    – pmr
    Sep 9, 2012 at 21:24
  • $\begingroup$ May I get your email then I can send you the whole code...actually after this there is another big macro for calculating Gini, KS etc. $\endgroup$
    – pmr
    Sep 9, 2012 at 21:26

0

Your Answer

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

Browse other questions tagged or ask your own question.