naCombine: Combine NA bins

Description Usage Arguments Value Examples

View source: R/logiBin.R

Description

This function combines the NA bin with either the bin having the closest bad rate or the average bad rate if the count of observations in NA bin is low

Usage

1
naCombine(binObj, xVars, cutoffPropn = 0.01)

Arguments

binObj

- An object returned by getBins or other functions (except createBins) in this package

xVars

- A vector of names of variables for which NA bins have to be combined

cutoffPropn

- The minimum proportion of observations that must be present in the NA bin for it to be combined with the bin with closest bad rate. If the proportion s below this, the NA bin will be combined with bin having average bad rate

Value

Returns a list containing 3 objects. Similar to the getBins function

Examples

1
2
b1 <- getBins(loanData, "bad_flag", c('age', 'score', 'LTV'))
b1 <- naCombine(b1, c('LTV'))

logiBin documentation built on May 2, 2019, 2:01 p.m.