Disparate Impact Ratio (EEOC four-fifths / 80% rule)
Source:R/fairness_metrics.R, R/frns_metrics.R
morie_fairness_disparate_impact.RdFor each group, the disparate-impact ratio is its favourable- outcome rate divided by the privileged group's rate. A value below 0.8 is the standard legal indicator of adverse impact.
For each group, the disparate-impact ratio is its favourable-outcome rate divided by the privileged group's rate. A value below 0.8 is the standard legal indicator of adverse impact.
Usage
morie_fairness_disparate_impact(
y_pred,
group,
privileged = NULL,
favorable = 1
)
morie_fairness_disparate_impact(
y_pred,
group,
privileged = NULL,
favorable = 1
)Arguments
- y_pred
Vector of decisions/assignments, one per individual.
- group
Vector of protected-attribute values (e.g. race).
- privileged
The reference group. If
NULL(default) the highest-rate group is used and a warning is attached.- favorable
The value of
y_predcounted as the favourable outcome (default1).
Value
A morie_fairness_result; headline value is the
worst (smallest) ratio across groups.
A named list: value (worst ratio), ratios, rates,
privileged, adverse_impact, threshold, warnings,
interpretation.
Examples
pred <- c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0)
race <- c("A","A","A","A","A","B","B","B","B","B")
morie_fairness_disparate_impact(pred, race, privileged = "A")$value
#> [1] 0.6
pred <- c(1, 1, 1, 1, 1, 1, 1, 1, 0, 0)
race <- c(rep("A", 5), rep("B", 5))
res <- morie_fairness_disparate_impact(pred, race, privileged = "A")
res$value # 0.6 (group B rate 0.6 / group A rate 1.0)
#> [1] 0.6
res$adverse_impact # TRUE
#> [1] TRUE