View source: R/spOR.R View source: R/SimpleCode.R
spOR | R Documentation |
Targeted estimates and inference for the odds ratio in a partially-linear logistic-link semiparametric model with 'post-treatment“ informative outcome missingness.. This version also allows for the outcome is missing-at-random conditional on A,W. The partially-linear logistic model assumes that 'logit(P(Y=1|A,W)) = b* A f(W) + h(W)' where 'h(W) = logit(P(Y=1|A=0,W))' is unspecified (nonparametric) and 'f(W)' is specified by a parametric model. Thus, only a correct parametric model is assumed for the conditional odds ratio, and all other nuisance functions are unspecified (nonparametric).
spOR( formula = ~1, W, A, Y, data = NULL, Delta = NULL, weights = NULL, W_new = W, data_new = data, glm_formula_A = NULL, sl3_learner_A = NULL, glm_formula_Y0W = NULL, smoothness_order_Y0W = 1, max_degree_Y0W = 2, num_knots_Y0W = c(25, 15, 5), reduce_basis = 0.001, fit_control = list(), sl3_learner_default = Lrnr_hal9001_custom$new(max_degree = 2, smoothness_orders = 1, num_knots = c(25, 15)), parallel = F, ncores = NULL, targeting_method = c("universal", "iterative"), fit_Q0W_separate = F, boundsOR = c(0.001, 1000), ... )
formula |
An R formula object describing the functional form of the conditional log odds ratio as a fnction of 'W'. This corresponds with 'f(W)' in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)'. |
W |
A named matrix of baseline covariates |
A |
A binary vector with values in (0,1) encoding the treatment assignment |
Y |
A binary outcome variable with values in (0,1) |
Delta |
A binary vector that takes the value 1 if 'Y' is osberved/not-missing and 0 otherwise. |
weights |
An optional vector of weights for each observation. Use with caution. This can lead to invalid inferences if included naively. |
W_new |
An optional matrix of new values of the baseline covariates 'W' at which to predict odds ratio. |
glm_formula_A |
(Not recommended). An optional R formula object describing the functional form of P(A=1|W). If provided, |
sl3_learner_A |
An optional |
glm_formula_Y0W |
(Not recommended). An optional R formula object describing the nuisance function 'h(W) := logit(P(Y=1|A=0,W))'in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)' |
smoothness_order_Y0W |
Smoothness order of the nuisance function 'h(W) := logit(P(Y=1|A=0,W))'in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)' to be estimated nonparametrically using the Highly Adaptive Lasso (hal9001), a powerful spline regression algorithm. 0 = discontinuous piece-wise constant function, 1 = continuous piece-wise linear, 2 = smooth piece-wise quadratic |
max_degree_Y0W |
Max degree of interaction (of spline basis functions) of the nuisance function 'h(W) := logit(P(Y=1|A=0,W))'in the partially linear logistic-link model 'logit(P(Y=1|A,W)) = b*Af(W) + h(W)' to be estimated nonparametrically using the Highly Adaptive Lasso (hal9001). 'max_degree=1' corresponds with an additive model, 'max_degree=2' corresponds with a bi-additive (two-way) model. This parameter significantly affects computation time. |
num_knots_Y0W |
A vector specifying the number of knots to use when generating 'HAL' spline basis functions of each interaction degree. For computational benefits, the number of knots should decrease exponentially with degree. |
reduce_basis |
See analagous argument in package hal9001. |
fit_control |
See analagous argument in package hal9001. |
sl3_learner_default |
A default sl3 Learner to be used if neither a glm formula or sl3 learner is provided for one of the nuisance functions. By default, Lrnr_hal9001 is used. |
... |
Other arguments to be passed to hal9001::fit_hal for fitting. |
NOTE: For more robust nonparametrically correct inference with no parametric assumptions, use the function instead. In the function, the user-specified parametric model is instead treated as an approximation rather than the truth.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.