6
$\begingroup$

I have a set of variables for building credit scorecards with logistic-regression. I need to bin some variables, for e.g. years of credit history. What is the method to determine how many bins and what is the interval for each bin?

$\endgroup$

2 Answers 2

10
$\begingroup$

Binning will result in a more complex model, i.e., you will need more terms in the model to predict the outcome as well as a model that treats the predictors as continuous. Bins also bring a degree of arbitrariness into the model. Take a look at regression splines as an alternative. Notes about this may be found at http://biostat.mc.vanderbilt.edu/rms. Also make sure that your outcome is truly dichotomous, i.e., that the time until the event is irrelevant and you have no censoring.

$\endgroup$
3
  • $\begingroup$ (+1) A couple brief comments: Though I too would be more inclined to try regression splines first over binning, where possible, I don't see immediately how regression splines help avoid introducing "arbitrariness" into the model any more than binning. One is left to choose both the number and placement of the knots, neither of which is necessarily obvious or trivial, even for a specific application. Also, perhaps there is a more directed link you could provide, as the one currently given seems a bit broad and perhaps difficult to determine what you are pointing the OP to. Cheers. $\endgroup$
    – cardinal
    Commented Apr 22, 2011 at 19:48
  • 2
    $\begingroup$ +1 for the idea of splines. One has a lot of flexibility in their use: in my experience the model tends to be less sensitive to the positions of the knots and numbers of splines than it would be to the choices of bins. It allows for more continuous transitions (by construction). As @cardinal rightly points out, though, the fundamental question is still out there: what guidance is there concerning the numbers of splines and locations of the knots? To what extent might selecting them post hoc affect p-values? $\endgroup$
    – whuber
    Commented Apr 22, 2011 at 19:57
  • 1
    $\begingroup$ In the link above see the course handout. Regarding choice of number of knots, the simplest guiding principle is to choose the number you can afford to fit related to what we know about causes of overfitting (events per predictor rules of thumb, etc.). This is based on the assumption that everything is nonlinear (which is true except for very special cases). $\endgroup$ Commented May 8, 2011 at 14:35
2
$\begingroup$

You could specify your binding algorithm in a function, define utility function and optimize input parameters...

The ideas for utility function can be:

  1. Predictive power (weight of evidence and information value)
  2. Monotonnicly decreasing average default rate from one bin to another (as you increase the age of history...)

You can also constrain your optimization to look only for three to 5 bins for example...

$\endgroup$
1
  • 1
    $\begingroup$ The utility function would have to be arbitrary and information-losing. $\endgroup$ Commented Jul 6, 2011 at 3:17

Your Answer

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