View source: R/ability_compute_nuisance_functions.R
compute_nuisance_functions_ai | R Documentation |
Fit (1) the decision model m^{D}(z, a, X_i) := \Pr(D = 1 \mid Z = z, A = a, X = X_i)
and
(2) the outcome model m^{Y}(z, a, X_i) := \Pr(Y = 1 \mid D = 0, Z = z, A = a, X = X_i)
for each treatment group z \in \{0,1\}
and AI recommendation a \in \{0,1\}
,
and (3) the propensity score model e(1, X_i) := \Pr(Z = 1 \mid X = X_i)
.
compute_nuisance_functions_ai(
Y,
D,
Z,
A,
V,
d_form = D ~ .,
y_form = Y ~ .,
ps_form = Z ~ .,
distribution = "bernoulli",
n.trees = 1000,
shrinkage = 0.01,
interaction.depth = 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). |
A |
An AI recommendation (binary: numeric vector of 0 or 1). |
V |
A |
d_form |
A formula for decision model where the dependent variable is |
y_form |
A formula for outcome model where the dependent variable is |
ps_form |
A formula for propensity score model. |
distribution |
A distribution argument used in |
n.trees |
Integer specifying the total number of trees to fit used in |
shrinkage |
A shrinkage parameter used in |
interaction.depth |
Integer specifying the maximum depth of each tree used in |
... |
Additional arguments to be passed to |
A list with the following components:
z_models
A data.frame
with the following columns:
idx
Index of observation.
d_pred
Predicted probability of decision.
y_pred
Predicted probability of outcome.
Z
Treatment group.
A
AI recommendation.
pscore
A vector of predicted propensity scores.
compute_nuisance_functions_ai(
Y = NCAdata$Y,
D = ifelse(NCAdata$D == 0, 0, 1),
Z = NCAdata$Z,
A = PSAdata$DMF,
V = NCAdata[, c("Sex", "White", "Age")],
shrinkage = 0.01,
n.trees = 1000
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.