A scorecard for Logistic Regression models
25. August 2007 08:58Scorecards are a common way of displaying the patterns found by a logistic regression model. They display in a clear, intuitive way the regression coefficients and can be used to perform risk evaluation operations (simplified predictions). For one particular state, y1, we start by extracting the coefficients (c0,c1, ...) that describe the logistic regression formula for that state.
We convert to 0 the minimal coefficient in each variable and the rest of coefficients transform in the way that difference between the minimal coefficients and the rest of coefficients remains the same These coefficients are then normalized between, say, 0 and 1000, giving an intuitive perspective on the relative importance of each coefficient. As each coefficient corresponds to a state of an input attribute, the normalized values are also describing the relative importance of each input attribute state. The score card presented here is computing these relative importance scores. Score cards check certain conditions, and for example, and if these conditions are met, points are added to an overall score.
proc logistic data=Panel OutModel= ModelParam namelen=200 descend ; class &groupp / param=glm ; model target=&groupp/selection=stepwise; output out=toz_LOGISTIC_2 p=phat_new xbeta=xb; ods output ParameterEstimates = coeff_est; run; proc sql ; create table score_card as select b.*, sum(max_est1/counter) as sum_max, case when est1=max_est1 then 1 else 0 end as max_cat, round(1000*((est1)/calculated sum_max)) as score from (select a.*, max(est1) as max_est1, count(*) as counter from ( select *,min(Estimate) as min_est, count(*) as counter, case when calculated min_est=Estimate then 0 else Estimate- calculated min_est end as est1 from coeff_est where variable ne 'Intercept' group by variable ) a group by variable )b ; quit;

Email 