| ridit | R Documentation |
Transforms a data frame of numeric indicators into ridit scores on the
interval (-1, 1) using the empirical cumulative distribution of each
column across the reference population. A score of zero indicates a value
exactly at the median; positive scores indicate above-median values.
ridit(data)
data |
A data frame whose first column is an ID and whose remaining columns are numeric indicators. |
The ridit score for observation i on indicator j is
B_{ij} = F_j(x_{ij} - \varepsilon) - [1 - F_j(x_{ij})]
where F_j is the empirical CDF of column j and \varepsilon
is a small constant that makes the lower CDF strictly left-continuous.
This formulation is robust to ties and requires no parametric assumptions.
Categorical indicators should be expanded into binary dummy columns before
calling ridit(); each dummy then receives its own ridit transformation
and PRIDIT weight, with sign determined by the data rather than by the
analyst.
A data frame of the same shape as data with numeric columns
replaced by their ridit scores. The ID column is preserved as-is.
Bross, I. D. J. (1958). How to use ridit analysis. Biometrics, 14(1), 18–38.
Brockett, P. L., Derrig, R. A., Golden, L. L., Levine, A., & Alpert, M. (2002). Fraud classification using principal component analysis of RIDITs. Journal of Risk and Insurance, 69(3), 341–371.
dat <- data.frame(
id = c("A", "B", "C", "D", "E"),
x1 = c(0.90, 0.85, 0.89, 1.00, 0.89),
x2 = c(0.99, 0.92, 0.90, 1.00, 0.93)
)
ridit(dat)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.