aib_amplify: Contrast the recovery and retention gaps (amplification...

View source: R/aib_amplify.R

aib_amplifyR Documentation

Contrast the recovery and retention gaps (amplification index)

Description

Computes A_{g,r}(t) = B_{g,r}(t|1) - B_{g,r}(t|0), where B_{g,r}(t|d) is the focal-minus-reference gap in the decision rate at t among units whose decision at t-1 was d. Under the default sign convention this is the recovery gap minus the retention gap. The index measures how far the conditional gap depends on the prior decision. It does not by itself say whether the overall gap grew or shrank, or why: use [AIBias::aib_decompose()] for that.

Usage

aib_amplify(
  object,
  ref_group = NULL,
  sign = c("mechanism", "legacy"),
  verbose = TRUE,
  lag = NULL
)

Arguments

object

An 'aibias' object from [AIBias::aib_build()]. Recommended to run [AIBias::aib_transition()] first.

ref_group

Character. Reference group.

sign

Character; "mechanism" (default) or "legacy". Under "mechanism" the reported index is (p_{11,r} - p_{11,g}) - (p_{01,r} - p_{01,g}): negative values mean the focal group's recovery shortfall exceeds its retention shortfall, positive values the reverse. Under "legacy" the sign is flipped, B_{g,r}(t|1) - B_{g,r}(t|0).

verbose

Logical.

lag

Character or NULL. Pairing rule, as in [AIBias::aib_transition()]. If NULL, uses the rule stored by 'aib_transition()' when present, otherwise '"scheduled"'.

Details

A zero index means the recovery and retention gaps are equal. It does not mean prior decisions are irrelevant: when both conditional gaps are negative and equal, the overall gap can still widen from one occasion to the next because the focal group enters each occasion with fewer favorable decisions. See the zero-index example in 'vignette("introduction", package = "AIBias")'. The index is descriptive; reading it as a causal effect of prior decisions needs assumptions the audit data cannot check.

Value

The 'aibias' object with '$amplification' populated. Contains: - 'lagged_disparity': B_{g,r}(t|d) for d equal to 0 or 1 - 'index': A_{g,r}(t) by group and occasion - 'cumulative': sum, mean and maximum of |A_{g,r}(t)| over occasions - 'matrix_norm': L_1 distance between pooled transition matrices - 'narratives', 'ref_group', 'sign', 'lag'

Examples

data(lending_panel)
obj <- aib_build(lending_panel, "applicant_id", "year", "race", "approved")
obj <- aib_transition(obj, ref_group = "White")
obj <- aib_amplify(obj, ref_group = "White")
obj$amplification$index


AIBias documentation built on Dec. 1, 2026, 1:06 a.m.