Information value of an independent variable in predicting a binary response
Takes in independent and dependent variable and returns IV value
iv(x, y)
x |
an independent variable |
y |
a binary response variable |
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.
information value of x
Akash Jain
# 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'])Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.