msmglm | R Documentation |
Marginal structural generalized linear models with robust inference based on nonparametric projections. Nonparametric robust inference for marginal structural models for the CATE, CATT, TSM, and RR.
msmglm( formula, data, V, W = V, A, Y, estimand = c("CATE", "CATT", "TSM", "RR"), learning_method = c("HAL", "SuperLearner", "glm", "glmnet", "gam", "mars", "ranger", "xgboost"), treatment_level = max(data[[A]]), control_level = min(data[[A]]), cross_fit = FALSE, sl3_Learner_A = NULL, sl3_Learner_Y = NULL, formula_Y = as.formula(paste0("~ .^2")), formula_HAL_Y = NULL, HAL_args_Y = list(smoothness_orders = 1, max_degree = 2, num_knots = c(15, 10, 1)), HAL_fit_control = list(parallel = F), delta_epsilon = 0.025, verbose = TRUE, ... )
formula |
A R formula object specifying the parametric form of CATE, OR, or RR (depending on method). |
data |
A data.frame or matrix containing the numeric values corresponding with the nodes |
V |
The marginal covariate (or covariate vector) of interest for the marginal structural model. |
W |
A character vector of covariates/confounders to adjust for contained in |
A |
A character name for the treatment assignment variable contained in |
Y |
A character name for the outcome variable contained in |
estimand |
Estimand/parameter to estimate. Choices are: 'CATE': Provides nonparametrically-robust inference for the user-specified marginal structural model of 'E[CATE(W)|V] := E[E[Y|A=1,W] - E[Y|A=0,W]|V]'. 'CATT': Provides nonparametrically-robust inference for the user-specified marginal structural model of 'E[CATE(W)|V, A=1] := E[E[Y|A=1,W] - E[Y|A=0,W]|V, A=1]'. 'TSM': Provides nonparametrically-robust inference for the user-specified marginal structural model of 'E[E[Y|A=a,W]|V]'. 'RR': Provides nonparametrically-robust inference for the user-specified marginal structural relative risk model of 'E[E[Y|A=1,W]|V] / E[E[Y|A=0,W]|V]'. |
learning_method |
Machine-learning method to use. This is overrided if argument |
treatment_level |
A value/level of |
control_level |
A value/level of |
cross_fit |
Whether to cross-fit the initial estimator. This is always set to FALSE if argument |
sl3_Learner_A |
A |
sl3_Learner_Y |
A |
formula_Y |
Only used if 'learning_method By default, 'formula_Y = . + A*.' so that additive learners still model treatment interactions. |
formula_HAL_Y |
A HAL formula string to be passed to |
HAL_args_Y |
A list of parameters for the semiparametric Highly Adaptive Lasso estimator for E[Y|A,W].
Should contain the parameters:
1. 'smoothness_orders': Smoothness order for HAL estimator of E[Y|A,W] (see |
HAL_fit_control |
See the argument 'fit_control' of (see |
delta_epsilon |
Step size of iterative targeted maximum likelihood estimator. 'delta_epsilon = 1 ' leads to large step sizes and fast convergence. 'delta_epsilon = 0.01' leads to slower convergence but possibly better performance. Useful to set to a large value in high dimensions. |
verbose |
Passed to |
... |
Not used |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.