View source: R/ability_compute_stats.R
compute_stats_aipw | R Documentation |
Compute the difference in risk between human+AI and human decision makers using AIPW estimators.
compute_stats_aipw(Y, D, Z, nuis_funcs, true.pscore = NULL, X = NULL, l01 = 1)
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). |
nuis_funcs |
output from |
true.pscore |
A vector of true propensity scores (numeric), if available. Optional. |
X |
Pretreatment covariate used for subgroup analysis (vector). Must be the same length as Y, D, Z, and A if provided. Default is NULL. |
l01 |
Ratio of the loss between false positives and false negatives |
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
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
compute_stats_aipw(
Y = NCAdata$Y,
D = ifelse(NCAdata$D == 0, 0, 1),
Z = NCAdata$Z,
nuis_funcs = nuis_func,
true.pscore = rep(0.5, nrow(NCAdata)),
X = NULL,
l01 = 1
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.