View source: R/02_BIVARIATE_ANALYSIS.R
woe.tbl | R Documentation |
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:
bin: Risk factor group (bin).
no: Number of observations per bin.
ng: Number of good cases (where target is equal to 0) per bin.
nb: Number of bad cases (where target is equal to 1) per bin.
pct.o: Percentage of observations per bin.
pct.g: Percentage of good cases (where target is equal to 0) per bin.
pct.b: Percentage of bad cases (where target is equal to 1) per bin.
dr: Default rate per bin.
so: Number of all observations.
sg: Number of all good cases.
sb: Number of all bad cases.
dist.g: Distribution of good cases per bin.
dist.b: Distribution of bad cases per bin.
woe: WoE value.
iv.b: Information value per bin.
iv.s: Information value of risk factor (sum of individual bins' information values).
woe.tbl(tbl, x, y, y.check = TRUE)
tbl |
Data frame which contains target variable ( |
x |
Selected risk factor. |
y |
Selected target variable. |
y.check |
Logical, if target variable ( |
The command woe.tbl
returns the data frame with WoE and information value calculations along with accompanied metrics.
bivariate
for automatic bivariate analysis.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.