CalFairness: Calculate the principal fairness

View source: R/plot_fairness.R

CalFairnessR Documentation

Calculate the principal fairness

Description

See Section 3.6 for more details.

Usage

CalFairness(apce, attr = c(2, 3))

Arguments

apce

The list generated from CalAPCE or CalAPCEparallel.

attr

The index of subgroups (within the output of CalAPCE/CalAPCEparallel) that corresponds to the protected attributes.

Value

A data.frame of the delta.

Examples


data(synth)
subgroup_synth <- list(
  1:nrow(synth), which(synth$Sex == 0), which(synth$Sex == 1),
  which(synth$Sex == 1 & synth$White == 0), which(synth$Sex == 1 & synth$White == 1)
)
sample_mcmc <- AiEvalmcmc(data = synth, n.mcmc = 10)
sample_apce <- CalAPCE(
  data = synth, mcmc.re = sample_mcmc, subgroup = subgroup_synth,
  burnin = 0
)
CalFairness(sample_apce)



aihuman documentation built on April 12, 2025, 1:47 a.m.