Learn R Programming

SPARRAfairness (version 0.0.0.1)

demographic_parity: demographic_parity

Description

Estimates demographic parity for a risk score (essentially cumulative distribution function)

Usage

demographic_parity(
  scores,
  group1,
  group2,
  cutoffs = seq(min(scores, na.rm = TRUE), max(scores, na.rm = TRUE), length = 100)
)

Value

matrix of dimension length(cutoffs)x4, with (i,2g-1)th entry the proportion of scores in group g which are less than or equal to the ith cutoff value and (i,2g)th entry the approximate standard error of the (i,2g-1)th entry

Arguments

scores

vector of risk scores

group1

indices of group 1

group2

indices of group 2

cutoffs

score cutoffs at which to estimate DP (default 100 evenly-spaced)

Examples

Run this code
# See vignette

Run the code above in your browser using DataLab