npcoxph | R Documentation |
fit_hal
), a flexible and adaptive spline regression estimator, is recommended for medium-small to large sample sizes.npcoxph
Nonparametric robust generalized linear models for causal inference and marginal structural models (for some estimands).
Supports flexible nonparametric conditional average treatment effect (CATE), conditional odds ratio (OR), and conditional relative risk (RR) estimation,
... where a user-specified working parametric model for the estimand is viewed as an approximation of the true estimand and nonparametrically correct inference is given for these approximations.
Specifically, a causal projection of the true estimand onto the working-model is estimated; the parametric model is not assumed correct.
The estimates and inference obtained by 'causalRobustGLM' are robust and nonparametrically correct, which comes at a small cost in confidence interval width relative to 'causalGLM'.
Highly Adaptive Lasso (HAL) (see fit_hal
), a flexible and adaptive spline regression estimator, is recommended for medium-small to large sample sizes.
npcoxph( formula, data, W, A, Ttilde, Delta, num_bins_t = 20, learning_method = c("HAL", "SuperLearner", "glm", "glmnet", "gam", "mars", "ranger", "xgboost"), cross_fit = FALSE, sl3_Learner_A = NULL, sl3_Learner_T = NULL, sl3_Learner_C = NULL, formula_T = as.formula(paste0("~ . + . *", A)), formula_HAL_T = paste0("~ . + h(.,", A, ") + h(.,t)"), HAL_args_T = list(smoothness_orders = 1, max_degree = 2, num_knots = c(10, 5, 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 |
W |
A character vector of covariates contained in |
A |
A character name for the treatment assignment variable contained in |
learning_method |
Machine-learning method to use. This is overrided if argument |
cross_fit |
Whether to cross-fit the initial estimator. This is always set to FALSE if argument |
sl3_Learner_A |
A |
sl3_Learner_T |
A |
formula_T |
Only used if 'learning_method By default, 'formula_T = . + A*.' so that additive learners still model treatment interactions. |
formula_HAL_T |
A HAL formula string to be passed to |
HAL_args_T |
A list of parameters for the semiparametric Highly Adaptive Lasso estimator for E[Y|A,W].
Possible parameters are:
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.005' leads to slower convergence but possibly better performance. Useful to set to a large value in high dimensions. |
... |
Other arguments to pass to main routine (spCATE, spOR, spRR) |
Y |
A character name for the outcome variable contained in |
estimand |
Estimand/parameter to estimate. Choices are:
'CATE': Estimate the best parametric approximation of the conditional average treatment effect with |
weights |
An optional vector of weights to use in procedure. |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.