iv: Information value of an independent variable in predicting a...

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/iv.R

Description

Takes in independent and dependent variable and returns IV value

Usage

1
iv(x, y)

Arguments

x

an independent variable

y

a binary response variable

Details

Information value of a variable is a significant indicator of its relevance in the prediction of a binary response variable. iv computes that value using the formula, IV = summation[(Responders - Non-responders)*ln(Responders / Non-responders) for each bin].

Ten bins are created for continous variables while categories itself are used as bins for categorical independent variables.

Value

information value of x

Author(s)

Akash Jain

See Also

accuracy, auc, ks, splitdata

Examples

1
2
3
4
5
6
# A 'data.frame'
df <- data.frame(x = c('a', 'a', 'a', 'b', 'b', 'b'),
                 y = c(0, 1, 0, 1, 0, 1))

# Information value
IV <- iv(x = df[, 'x'], y = df[, 'y'])

Example output



StatMeasures documentation built on May 2, 2019, 1:44 p.m.