View source: R/adaptive_iptw.R
adaptive_iptw | R Documentation |
Compute asymptotically linear IPTW estimators with super learning for the propensity score
adaptive_iptw(W, A, Y, DeltaY = as.numeric(!is.na(Y)), DeltaA = as.numeric(!is.na(A)), stratify = FALSE, family = if (all(Y %in% c(0, 1))) { stats::binomial() } else { stats::gaussian() }, a_0 = unique(A[!is.na(A)]), SL_g = NULL, glm_g = NULL, SL_Qr = NULL, glm_Qr = NULL, returnModels = TRUE, verbose = FALSE, maxIter = 2, tolIC = 1/length(Y), tolg = 0.01, cvFolds = 1, gn = NULL, ...)
W |
A |
A |
A |
Y |
A |
DeltaY |
A |
DeltaA |
A |
stratify |
A |
family |
A |
a_0 |
A vector of |
SL_g |
A vector of characters describing the super learner library to be
used for each of the propensity score regressions ( |
glm_g |
A list of characters describing the formulas to be used
for each of the propensity score regressions ( |
SL_Qr |
A vector of characters or a list describing the Super Learner library to be used for the reduced-dimension outcome regression. |
glm_Qr |
A character describing a formula to be used in the call to
|
returnModels |
A logical indicating whether to return model fits for the propensity score and reduced-dimension regressions. |
verbose |
A logical indicating whether to print status updates. |
maxIter |
A numeric that sets the maximum number of iterations the TMLE can perform in its fluctuation step. |
tolIC |
A numeric that defines the stopping criteria based on the empirical mean of the influence function. |
tolg |
A numeric indicating the minimum value for estimates of the propensity score. |
cvFolds |
A numeric equal to the number of folds to be used in
cross-validated fitting of nuisance parameters. If |
gn |
An optional list of propensity score estimates. If specified, the
function will ignore the nuisance parameter estimation specified by
|
... |
Other options (not currently used). |
An object of class "adaptive_iptw"
.
iptw_tmle
A list
of point estimates and
covariance matrix for the IPTW estimator based on a targeted
propensity score.
iptw_tmle_nuisance
A list
of the final TMLE estimates
of the propensity score ($gnStar
) and reduced-dimension
regression ($QrnStar
) evaluated at the observed data values.
iptw_os
A list
of point estimates and covariance matrix
for the one-step correct IPTW estimator.
iptw_os_nuisance
A list
of the initial estimates of the
propensity score and reduced-dimension regression evaluated at the
observed data values.
iptw
A list
of point estimates for the standard IPTW
estimator. No estimate of the covariance matrix is provided because
theory does not support asymptotic Normality of the IPTW estimator if
super learning is used to estimate the propensity score.
gnMod
The fitted object for the propensity score. Returns
NULL
if returnModels = FALSE
.
QrnMod
The fitted object for the reduced-dimension regression
that guards against misspecification of the outcome regression.
Returns NULL
if returnModels = FALSE
.
a_0
The treatment levels that were requested for computation of covariate-adjusted means.
call
The call to adaptive_iptw
.
# load super learner library(SuperLearner) # simulate data set.seed(123456) n <- 100 W <- data.frame(W1 = runif(n), W2 = rnorm(n)) A <- rbinom(n, 1, plogis(W$W1 - W$W2)) Y <- rbinom(n, 1, plogis(W$W1 * W$W2 * A)) # fit iptw with maxIter = 1 to run fast fit1 <- adaptive_iptw( W = W, A = A, Y = Y, a_0 = c(1, 0), SL_g = c("SL.glm", "SL.mean", "SL.step"), SL_Qr = "SL.npreg", maxIter = 1 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.