Description Usage Arguments Value Examples
The function pool_bin
implements the monotonic binning for the pool data
based on the generalized boosted model (GBM).
1 |
x |
A numeric vector |
num |
A numeric vector with integer values for numerators to calculate bad rates |
den |
A numeric vector with integer values for denominators to calculate bad rates |
log |
A logical constant either TRUE or FALSE. The default is FALSE |
A list of binning outcomes, including a numeric vector with cut points and a dataframe with binning summary
1 2 3 4 5 6 7 8 9 10 | data(hmeq)
df <- rbind(Reduce(rbind,
lapply(split(hmeq, floor(hmeq$CLAGE)),
function(d) data.frame(AGE = unique(floor(d$CLAGE)),
NUM = sum(d$BAD),
DEN = nrow(d)))),
data.frame(AGE = NA,
NUM = sum(hmeq[is.na(hmeq$CLAGE), ]$BAD),
DEN = nrow(hmeq[is.na(hmeq$CLAGE), ])))
pool_bin(df$AGE, df$NUM, df$DEN, log = TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.