Closed jvpoulos closed 3 years ago
Hi @jvpoulos, it looks like you're using the development version of the package (0.9.1.9000) but running an example from the current release version on CRAN. The development version has a new parameter intervention_type
that requires being specified to "mtp"
if the shift function is a modified treatment policy (as is the case with example 2.1), issue #94 . Looking at the manual from the development version you should see:
# Example 2.1
# Longitudinal setting, time-varying continuous exposure bounded by 0,
# time-varying covariates, and a binary outcome with no loss-to-follow-up.
# Interested in the effect of a treatment policy where exposure decreases by
# one unit at every time point if an observations observed exposure is greater
# than or equal to 2. The true value under this intervention is about 0.305.
head(sim_t4)
a <- c("A_1", "A_2", "A_3", "A_4")
tv <- list(c("L_1"), c("L_2"), c("L_3"), c("L_4"))
d <- function(data, trt) {
a <- data[[trt]]
(a - 1) * (a - 1 >= 1) + a * (a - 1 < 1)
}
# BONUS: progressr progress bars!
progressr::handlers(global = TRUE)
lmtp_tmle(sim_t4, a, "Y", time_vary = tv, shift = d, folds = 2, intervention_type = "mtp")
Running the vignette (or example 2.1. in the CRAN manual) yields the error when calling
lmtp_tmle
:R session info: