| scr_iv | R Documentation |
Laplace smoothing by default. It is not cosmetic: without it, a
single-class group (a normal situation in a small sentinel population)
yields Inf and contaminates any ordering that depends on the IV.
scr_iv(g, y, laplace = 0.5)
g |
Group vector (any coercible type). Rows where |
y |
0/1 outcome vector. |
laplace |
Smoothing constant added to each count. |
Implemented with tabulate() on integer codes rather than data.table
aggregation: this function is called once per candidate variable, hundreds
of times per run, and the fixed cost dominated the triage.
Total IV, a scalar. Zero when fewer than two groups are populated.
Other metrics:
scr_metrics(),
scr_psi()
set.seed(1)
y <- stats::rbinom(1000, 1, 0.3)
g <- ifelse(stats::runif(1000) < 0.5 + 0.3 * y, "A", "B")
scr_iv(g, y)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.