cdgd0_ml | R Documentation |
Perform unconditional decomposition via machine learning
cdgd0_ml(Y, D, G, X, data, algorithm, alpha = 0.05, trim = 0, weight = NULL)
Y |
Outcome. The name of a numeric variable (can be binary and take values of 0 and 1). |
D |
Treatment status. The name of a binary numeric variable taking values of 0 and 1. |
G |
Advantaged group membership. The name of a binary numeric variable taking values of 0 and 1. |
X |
Confounders. A vector of variables names. |
data |
A data frame. |
algorithm |
The ML algorithm for modelling. "nnet" for neural network, "ranger" for random forests, "gbm" for generalized boosted models. |
alpha |
1-alpha confidence interval. |
trim |
Threshold for trimming the propensity score. When trim=a, individuals with propensity scores lower than a or higher than 1-a will be dropped. |
weight |
Sampling weights. The name of a numeric variable. If unspecified, equal weights are used. Technically, the weight should be a deterministic function of X and G. |
A list of estimates.
# This example will take a minute to run.
data(exp_data)
set.seed(1)
results <- cdgd0_ml(
Y="outcome",
D="treatment",
G="group_a",
X=c("Q","confounder"),
data=exp_data,
algorithm="gbm")
results[[1]]
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.