tunevt | R Documentation |
tunevt
fits a Virtual Twins model to estimate factors and subgroups
associated with differential treatment effects while controlling the Type I
error rate of falsely detecting at least one heterogeneous effect when the
treatment effect is uniform across the study population.
tunevt(
data,
Y = "Y",
Trt = "Trt",
step1 = "randomforest",
step2 = "rtree",
alpha0,
p_reps,
threshold = NA,
keepz = FALSE,
parallel = FALSE,
...
)
data |
a data frame containing a response, binary treatment indicators, and covariates. |
Y |
a string specifying the name of the column of |
Trt |
a string specifying the name of the column of |
step1 |
character strings specifying the Step 1 model. Supports
either " |
step2 |
a character string specifying the Step 2 model. Supports
" |
alpha0 |
the nominal Type I error rate. |
p_reps |
the number of permutations to run. |
threshold |
for " |
keepz |
logical. Should the estimated CATE from Step 1 be returned? |
parallel |
Should the loop over replications be parallelized? If
|
... |
additional arguments to the Step 1 model call. |
Virtual Twins is a two-step approach to detecting differential treatment
effects. Subjects' conditional average treatment effects (CATEs) are first
estimated in Step 1 using a flexible model. Then, a simple and interpretable
model is fit in Step 2 to model either (1) the expected value of these
estimated CATEs if step2
is equal to "lasso
", "rtree
",
or "ctree
" or (2) the probability that the CATE is greater than a
specified threshold
if step2
is equal to "classtree
".
The Step 2 model is dependent on some tuning parameter. This parameter is
selected to control the Type I error rate by permuting the data under the
null hypothesis of a constant treatment effect and identifying the minimal
null penalty parameter (MNPP), which is the smallest penalty parameter that
yields a Step 2 model with no covariate effects. The 1-alpha0
quantile
of the distribution of is then used to fit the Step 2 model on the original
data.
An object of class "tunevt"
.
An object of class "tunevt"
is a list containing at least the
following components:
call |
the matched call |
vtmod |
the model estimated by the given |
mnpp |
the MNPP for the estimated CATEs from Step 1. |
theta_null |
a vector of the MNPPs from each permutation under the null hypothesis. |
pvalue |
the probability of observing a MNPP as or more extreme as the observed MNPP under the null hypothesis of no effect heterogeneity. |
z |
if |
foster_subgroup_2011tehtuner
\insertRefwolf_permutation_2022tehtuner
\insertRefdeng_practical_2023tehtuner
data(tehtuner_example)
# Low p_reps for example use only
tunevt(
tehtuner_example, step1 = "lasso", step2 = "rtree",
alpha0 = 0.2, p_reps = 5
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.