Compute the difference in risk between human+AI and human decision makers, for a subgroup \(\{A_i = a\}\), using AIPW estimators. This can be used for computing how the decision maker overrides the AI recommendation.
compute_stats_subgroup(
Y,
D,
Z,
A,
a = 1,
nuis_funcs,
true.pscore = NULL,
X = NULL,
l01 = 1
)A tibble the following columns:
Z_focal: The focal treatment indicator. `1` indicates the treatment group.
Z_compare: The comparison treatment indicator. `0` indicates the control group.
X: Pretreatment covariate (if provided).
loss_diff: The difference in loss between human+AI and human decision
loss_diff_se: The standard error of the difference in loss
tn_fn_diff: The difference in true negatives and false negatives between human+AI and human decision
tn_fn_diff_se: The standard error of the difference in true negatives and false negatives
tp_diff: The difference in true positives between human+AI and human decision
tp_diff_se: The standard error of the difference in true positives
tn_diff: The difference in true negatives between human+AI and human decision
tn_diff_se: The standard error of the difference in true negatives
fn_diff: The difference in false negatives between human+AI and human decision
fn_diff_se: The standard error of the difference in false negatives
fp_diff: The difference in false positives between human+AI and human decision
fp_diff_se: The standard error of the difference in false positives
An observed outcome (binary: numeric vector of 0 or 1).
An observed decision (binary: numeric vector of 0 or 1).
A treatment indicator (binary: numeric vector of 0 or 1).
An AI recommendation (binary: numeric vector of 0 or 1).
A specific AI recommendation value to create the subset (numeric: 0 or 1).
output from compute_nuisance_functions. If NULL, the function will compute the nuisance functions using the provided data. Note that V must be provided if nuis_funcs is NULL.
A vector of true propensity scores (numeric), if available. Optional.
Pretreatment covariate used for subgroup analysis (vector). Must be the same length as Y, D, Z, and A if provided. Default is NULL.
Ratio of the loss between false positives and false negatives
compute_stats_subgroup(
Y = NCAdata$Y,
D = ifelse(NCAdata$D == 0, 0, 1),
Z = NCAdata$Z,
A = PSAdata$DMF,
a = 1,
nuis_funcs = nuis_func,
true.pscore = rep(0.5, nrow(NCAdata)),
X = NULL,
l01 = 1
)
Run the code above in your browser using DataLab