woe.tbl {PDtoolkit}R Documentation

Weights of evidence (WoE) table

Description

woe.tbl calculates WoE and information value for given target variable and risk factor along with accompanied metrics needed for their calculation. WoE table reports:

Usage

woe.tbl(tbl, x, y, y.check = TRUE)

Arguments

tbl

Data frame which contains target variable (y) and analyzed risk factor (x).

x

Selected risk factor.

y

Selected target variable.

y.check

Logical, if target variable (y) should be checked for 0/1 values. Default value is TRUE. Change of this parameter to FALSE can be handy for calculation of WoE based on model predictions. Concretely, it is used only in calculation of marginal information value (MIV) in stepMIV.

Value

The command woe.tbl returns the data frame with WoE and information value calculations along with accompanied metrics.

See Also

bivariate for automatic bivariate analysis.

Examples

suppressMessages(library(PDtoolkit))
data(gcd)
#categorize numeric risk factors
gcd$age.bin <- woe.bin(x = gcd$age, y = gcd$qual, y.type = "bina")[[2]]
#generate woe table
woe.tbl(tbl = gcd, x = "age.bin", y = "qual")

[Package PDtoolkit version 1.2.0 Index]