Estimate Counterfactual Mean Under Stochastically Shifted Treatment

txshift(W, A, Y, C = rep(1, length(Y)), V = NULL, delta = 0,
estimator = c("tmle", "onestep"), fluctuation = c("standard",
"weighted"), eif_tol = 1/length(Y), max_iter = 1000,
ipcw_fit_args = list(fit_type = c("glm", "sl", "fit_spec"), sl_learners
= NULL), g_fit_args = list(fit_type = c("hal", "sl", "fit_spec"),
n_bins = c(10, 25), grid_type = c("equal_range", "equal_mass"),
lambda_seq = exp(seq(-1, -13, length = 300)), use_future = FALSE,
sl_learners_density = NULL), Q_fit_args = list(fit_type = c("glm",
"sl", "fit_spec"), glm_formula = "Y ~ .", sl_learners = NULL),
eif_reg_type = c("hal", "glm"), ipcw_efficiency = TRUE,
ipcw_fit_spec = NULL, gn_fit_spec = NULL, Qn_fit_spec = NULL)

## Arguments

W A matrix, data.frame, or similar corresponding to a set of baseline covariates. A numeric vector corresponding to a treatment variable. The parameter of interest is defined as a location shift of this quantity. A numeric vector of the observed outcomes. A numeric binary vector giving information on whether a given observation was subject to censoring, used to compute an IPC-weighted estimator in cases where two-stage sampling is performed. Default assumes no censoring (i.e., a two-stage design was NOT used). The covariates that are used in determining the sampling procedure that gives rise to censoring. The default is NULL and corresponds to scenarios in which there is no censoring (in which case all values in the preceding argument C must be uniquely 1). To specify this, pass in a character vector identifying variables amongst W, A, Y thought to have played a role in defining the sampling/censoring mechanism (C). This argument also accepts a data.table (or similar) object composed of combinations of the variables W, A, Y; use of this option is NOT recommended and should be selected only with care. A numeric value indicating the shift in the treatment to be used in defining the target parameter. This is defined with respect to the scale of the treatment (A). The type of estimator to be fit, either "tmle" for targeted maximum likelihood or "onestep" for a one-step estimator. The method to be used in the submodel fluctuation step (targeting step) to compute the TML estimator. The choices are "standard" and "weighted" for where to place the auxiliary covariate in the logistic tilting regression. A numeric giving the convergence criterion for the TML estimator. This is the the maximum mean of the efficient influence function (EIF) to be used in declaring convergence. A numeric integer giving the maximum number of steps to be taken in iterating to a solution of the efficient influence function. A list of arguments, all but one of which are passed to est_ipcw. For details, please consult the documentation for est_ipcw. The first element of this (i.e., fit_type) is used to determine how this regression is fit: "glm" for generalized linear model, "sl" for a Super Learner, and "fit_spec" a user-specified input of the form produced by est_ipcw. NOTE THAT this first argument is not passed to est_ipcw. A list of arguments, all but one of which are passed to est_g. For further details, please consult the documentation for est_g. The first element of this (i.e., fit_type) is used to determine how this regression is fit: "hal" for a method using the highly adaptive lasso to fit conditional densities via the haldensify package, "sl" for sl3 learners used to fit Super Learner to densities via Lrnr_haldensify or similar, and "fit_spec" for user-specified input of the form produced by est_g. NOTE THAT this first argument is not passed to est_g. A list of arguments, all but one of which are passed to est_Q. For further details, please consult the documentation for est_Q. The first element of this (i.e., fit_type) is used to determine how this regression is fit: "glm" for a generalized linear model for the outcome regression, "sl" for sl3 learners used to fit a Super Learner for the outcome regression, and "fit_spec" for user-specified input of the form produced by est_Q. NOTE THAT this first argument is not passed to est_g. Whether a flexible nonparametric function ought to be used in the dimension-reduced nuisance regression of the targeting step for the censored data case. By default, the method used is a nonparametric regression based on the Highly Adaptive Lasso (from package hal9001). Set this to "glm" to instead use a simple linear regression model. In this step, the efficient influence function (EIF) is regressed against covariates contributing to the censoring mechanism (i.e., EIF ~ V | C = 1). Whether to invoke an augmentation of the IPCW-TMLE procedure that performs an iterative process to ensure efficiency of the resulting estimate. The default is TRUE; only set to FALSE if possible inefficiency of the IPCW-TMLE is not a concern. User-specified version of the argument above for fitting the censoring mechanism (ipcw_fit_args). Consult the documentation for that argument for details on how to properly use this. In general, this should only be used by advanced users familiar with both the underlying theory and this software implementation of said theory. User-specified version of the argument above for fitting the treatment mechanism (g_fit_args). Consult the documentation for that argument for details on how to properly use this. In general, this should only be used by advanced users familiar with both the underlying theory and this software implementation of said theoretical details. User-specified version of the argument above for fitting the outcome mechanism (Q_fit_args). Consult the documentation for that argument for details on how to properly use this. In general, this should only be used by advanced users familiar with both the underlying theory and this software implementation of said theoretical details.

## Value

S3 object of class txshift containing the results of the procedure to compute a TML estimate of the treatment shift parameter.