SPSS has an optimal binning function that helps categorizing into meaningful intervals continuous predictors when a binary response variable exists. I was looking for an equivalent function in R but I'm not finding any. I'm not sure that using bins derived by CART or CTREE could be equivalent.
You can test the discretization package and the cutPoints function : http://cran.r-project.org/web/packages/discretization/discretization.pdf.
There is now a package call "smbinning" that longs for Optimal Binning for Scoring Modeling since early 2015. It gives you the optimal cut point for a numeric variable, more precisely, optimizing the information value. It is able to handle categorical variable and missing value as well.
smbinning(df, y , x, p = 0.05)
- df <- Data frame
- y <- Binary dependent variable
- x <- numeric independent variable
- p <- Percentage of records per bin