Reports per-group n / mean / median / sd, a one-way ANOVA for
whether group membership relates to the score, and each group's
mean-score gap from a reference group. A significant gap is not
itself proof of bias; pair this with morie_predpol_calibration_audit().
Usage
morie_predpol_score_disparity(score, group, reference = NULL)
Arguments
- score
Continuous risk score, one per individual.
- group
Protected attribute, one per individual.
- reference
Reference group for the gaps; defaults to the
lowest-scoring group.
Value
A named list: value (mean-score spread), spread,
group_means, gaps, anova_f, anova_pvalue, significant,
reference, warnings, interpretation.
Examples
res <- morie_predpol_score_disparity(
score = c(9, 10, 11, 19, 20, 21),
group = c("A", "A", "A", "B", "B", "B")
)
res$value # 10 (group means 10 and 20)
#> [1] 10
res$significant # TRUE
#> [1] TRUE