vis_diff_ai: Visualize Risk (AI v. Human; internal)

View source: R/ability_ai.R

vis_diff_aiR Documentation

Visualize Risk (AI v. Human; internal)

Description

Internal function to visualize the difference in risk between AI and human decision makers.

Usage

vis_diff_ai(
  df,
  label.subgroup1 = "Subgroup 1",
  label.subgroup2 = "Subgroup 2",
  x.order = NULL,
  zero.line = TRUE,
  arrows = TRUE,
  y.min = -Inf,
  p.title = NULL,
  p.lb = -1,
  p.ub = 1,
  y.lab = "PSA versus Human",
  p.label = c("PSA worse", "PSA better")
)

Arguments

df

A data frame generated by compute_stats_aipw and reshaped.

label.subgroup1

A label for subgroup1 (character).

label.subgroup2

A label for subgroup2 (character).

x.order

An order for the x-axis (character vector). Default NULL.

zero.line

A logical indicating whether to include a zero line. Default TRUE.

arrows

A logical indicating whether to include arrows. Default TRUE.

y.min

A lower bound for the y-axis (numeric). Default -Inf.

p.title

A title for the plot (character). Default NULL.

p.lb

A lower bound for the y-axis (numeric). Default -0.2.

p.ub

An upper bound for the y-axis (numeric). Default 0.2.

y.lab

A label for the y-axis (character). Default "PSA versus Human".

p.label

A vector of two labels for the annotations (character). Default c("PSA harms", "PSA helps").

Value

A ggplot object.


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