plot.aibias: Plot an aibias object

View source: R/plot.aibias.R

plot.aibiasR Documentation

Plot an aibias object

Description

Visualizes audit results. Supports five plot types: - '"trajectory"': Bias trajectory B_{g,r}(t) over time - '"heatmap"': Group-time disparity surface - '"transition"': Group-specific transition probabilities - '"amplification"': Amplification index A_{g,r}(t) over time - '"decomposition"': Components of the change in the gap at each step (stacked bars) with the observed change (points), from [AIBias::aib_decompose()]. Bootstrap intervals for the observed change are drawn when available and 'show_ci = TRUE'.

Usage

## S3 method for class 'aibias'
plot(
  x,
  type = c("trajectory", "heatmap", "transition", "amplification", "decomposition"),
  show_ci = TRUE,
  color_palette = NULL,
  ...
)

Arguments

x

An 'aibias' object.

type

Character. Plot type. One of '"trajectory"', '"heatmap"', '"transition"', '"amplification"', '"decomposition"'.

show_ci

Logical. Show bootstrap CIs if available. Default TRUE.

color_palette

Character vector of colors for groups. If NULL, uses a sensible default.

...

Ignored.

Value

A 'ggplot2' object.

Examples


data(lending_panel)
obj <- aib_audit(lending_panel,
                 id = "applicant_id", time = "year",
                 group = "race",     decision = "approved",
                 ref_group = "White", verbose = FALSE)
plot(obj, type = "trajectory")
plot(obj, type = "heatmap")



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