table_agreement {aihuman}R Documentation

Table of Agreement

Description

Estimate the impact of AI recommendations on the agreement between human decisions and AI recommendations using a difference-in-means estimator of an indicator 1\{D_i = A_i\}. Generate a table based on the overall agreement and subgroup-specific agreement.

Usage

table_agreement(
  Y,
  D,
  Z,
  A,
  subgroup1,
  subgroup2,
  label.subgroup1 = "Subgroup 1",
  label.subgroup2 = "Subgroup 2"
)

Arguments

Y

An observed outcome (binary: numeric vector of 0 or 1).

D

An observed decision (binary: numeric vector of 0 or 1).

Z

A treatment indicator (binary: numeric vector of 0 or 1).

A

An AI recommendation (binary: numeric vector of 0 or 1).

subgroup1

A pretreatment covariate used for subgroup analysis (vector).

subgroup2

A pretreatment covariate used for subgroup analysis (vector).

label.subgroup1

A label for subgroup1 (character). Default "Subgroup 1".

label.subgroup2

A label for subgroup2 (character). Default "Subgroup 2".

Value

A tibble with the following columns:

Examples

table_agreement(
  Y = NCAdata$Y,
  D = ifelse(NCAdata$D == 0, 0, 1),
  Z = NCAdata$Z,
  A = PSAdata$DMF,
  subgroup1 = ifelse(NCAdata$White == 1, "White", "Non-white"),
  subgroup2 = ifelse(NCAdata$Sex == 1, "Male", "Female"),
  label.subgroup1 = "Race",
  label.subgroup2 = "Gender"
)


[Package aihuman version 1.0.1 Index]