wald_test.adaptive_iptw {drtmle}R Documentation

Wald tests for adaptive_iptw objects


Wald tests for adaptive_iptw objects


## S3 method for class 'adaptive_iptw'
wald_test(object, est = c("iptw_tmle"), null = 0, contrast = NULL, ...)



An object of class "adaptive_iptw"


A vector indicating for which estimators to return a confidence interval. Possible estimators include the TMLE IPTW ("iptw_tmle", recommended), the one-step IPTW ("iptw_os", not recommended), the standard IPTW ("iptw", recommended only for comparison to the other two estimators).


The null hypothesis value(s).


This option specifies what parameter to return confidence intervals for. If contrast=NULL, then test the null hypothesis that the covariate-adjusted marginal means equal the value(s) specified in null. contrast can also be a numeric vector of ones, negative ones, and zeros to define linear combinations of the various means (e.g., to estimate an average treatment effect, see examples). In this case, we test the null hypothesis that the linear combination of means equals the value specified in null. contrast can also be a list with named functions f, h, and fh_grad. The function f takes as input argument eff and specifies which transformation of the effect measure to test. The function h defines the contrast to be estimated and should take as input est, a vector of the same length as object$a_0, and output the desired contrast. The function fh_grad is the gradient of the function h(f()). The function computes a test of the null hypothesis that h(f(object$est)) = null. See examples.


Other options (not currently used).


An object of class "ci.adaptive_iptw" with point estimates and confidence intervals of the specified level.


# load super learner
# fit adaptive_iptw
n <- 200
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))

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.glm"

# get test that each mean = 0.5
test_mean <- wald_test(fit1, null = 0.5)

# get test that the ATE = 0
ci_ATE <- ci(fit1, contrast = c(1, -1), null = 0)

# get test for risk ratio = 1 on log scale
myContrast <- list(
  f = function(eff) {
  f_inv = function(eff) {
  }, # not necessary
  h = function(est) {
    est[1] / est[2]
  fh_grad = function(est) {
    c(1 / est[1], -1 / est[2])
ci_RR <- ci(fit1, contrast = myContrast, null = 1)

[Package drtmle version 1.1.2 Index]