Title: | Transporting Intervention Effects from One Population to Another |
---|---|
Description: | Doubly-robust, non-parametric estimators for the transported average treatment effect from Rudolph, Williams, Stuart, and Diaz (2023) <doi:10.48550/arXiv.2304.00117> and the intent-to-treatment average treatment effect from Rudolph and van der Laan (2017) <doi:10.1111/rssb.12213>. Estimators are fit using cross-fitting and nuisance parameters are estimated using the Super Learner algorithm. |
Authors: | Nicholas Williams [aut, cre, cph]
|
Maintainer: | Nicholas Williams <[email protected]> |
License: | GPL (>= 3) |
Version: | 0.1.0 |
Built: | 2025-02-20 20:25:58 UTC |
Source: | CRAN |
Implements two one-step estimators for the transported average treatment effect for a binary or continuous outcome. Nuisance parameters are estimated using the Super Learner algorithm.
transport_ate( data, trt, outcome, covar, pop, obs = NULL, id = NULL, weights = NULL, estimator = c("standard", "collaborative"), learners_trt = "glm", learners_pop = "glm", learners_outcome = "glm", learners_heterogeneity = "glm", folds = 1, control = transport_control() )
transport_ate( data, trt, outcome, covar, pop, obs = NULL, id = NULL, weights = NULL, estimator = c("standard", "collaborative"), learners_trt = "glm", learners_pop = "glm", learners_outcome = "glm", learners_heterogeneity = "glm", folds = 1, control = transport_control() )
data |
[ |
trt |
[ |
outcome |
[ |
covar |
[ |
pop |
[ |
obs |
[ |
id |
[ |
weights |
[ |
estimator |
[ |
learners_trt |
[ |
learners_pop |
[ |
learners_outcome |
[ |
learners_heterogeneity |
[ |
folds |
[ |
control |
[ |
The "collaborative" estimator uses covariate dimension reduction and does not require users to have knowledge about which covariates are effect modifiers and which differ in distribution between the populations. The "standard" estimator assumes all covariates are effect modifiers and differ in distribution between the populations.
An object of class transported_ate
containing the parameter estimate.
gendata <- function(n, A = NULL) { W <- rbinom(n, 1, 0.5) V <- rbinom(n, 1, 0.66) Z <- rbinom(n, 1, 0.33) if (is.null(A)) A <- rbinom(n, 1, 0.5) S <- rbinom(n, 1, 0.4 + 0.5*W - 0.3*Z) Yi <- rnorm(n, A + W + A*V + 2.5*A*Z, sqrt((0.1 + 0.8*W)^2)) Y <- ifelse(S == 1, Yi, NA_real_) data.frame(W = W, V = V, Z = Z, S = S, A = A, Y = Y, Yi = Yi) } set.seed(123) n <- 250 tmp <- gendata(n) transport_ate(data = tmp, trt = "A", outcome = "Y", covar = c("W", "V", "Z"), pop = "S", estimator = "standard", folds = 1) transport_ate(data = tmp, trt = "A", outcome = "Y", covar = c("W", "V", "Z"), pop = "S", estimator = "collaborative", folds = 1)
gendata <- function(n, A = NULL) { W <- rbinom(n, 1, 0.5) V <- rbinom(n, 1, 0.66) Z <- rbinom(n, 1, 0.33) if (is.null(A)) A <- rbinom(n, 1, 0.5) S <- rbinom(n, 1, 0.4 + 0.5*W - 0.3*Z) Yi <- rnorm(n, A + W + A*V + 2.5*A*Z, sqrt((0.1 + 0.8*W)^2)) Y <- ifelse(S == 1, Yi, NA_real_) data.frame(W = W, V = V, Z = Z, S = S, A = A, Y = Y, Yi = Yi) } set.seed(123) n <- 250 tmp <- gendata(n) transport_ate(data = tmp, trt = "A", outcome = "Y", covar = c("W", "V", "Z"), pop = "S", estimator = "standard", folds = 1) transport_ate(data = tmp, trt = "A", outcome = "Y", covar = c("W", "V", "Z"), pop = "S", estimator = "collaborative", folds = 1)
Defines default parameters for estimators in the 'transport' package.
transport_control( .learners_folds = NULL, .bound = 1e+05, .return_full_fits = FALSE, .discrete = FALSE, .info = FALSE )
transport_control( .learners_folds = NULL, .bound = 1e+05, .return_full_fits = FALSE, .discrete = FALSE, .info = FALSE )
.learners_folds |
[ |
.bound |
[ |
.return_full_fits |
[ |
.discrete |
[ |
.info |
[ |
A list with parameter values.
transport_control(.learners_folds = 10)
transport_control(.learners_folds = 10)
Implements a TMLE for the transported intent-to-treat average treatment effect. Nuisance parameters are estimated using the Super Learner algorithm.
transport_ittate( data, instrument, trt, outcome, covar, pop, obs = NULL, id = NULL, weights = NULL, learners_instrument = "glm", learners_trt = "glm", learners_pop = "glm", learners_outcome = "glm", folds = 1, control = transport_control() )
transport_ittate( data, instrument, trt, outcome, covar, pop, obs = NULL, id = NULL, weights = NULL, learners_instrument = "glm", learners_trt = "glm", learners_pop = "glm", learners_outcome = "glm", folds = 1, control = transport_control() )
data |
[ |
instrument |
[ |
trt |
[ |
outcome |
[ |
covar |
[ |
pop |
[ |
obs |
[ |
id |
[ |
weights |
[ |
learners_instrument |
[ |
learners_trt |
[ |
learners_pop |
[ |
learners_outcome |
[ |
folds |
[ |
control |
[ |
An object of class transported_ittate
containing the parameter estimate.
gendata <- function(n, A = NULL, S = NULL) { if (is.null(S)) S <- rbinom(n, 1, 0.5) W1 <- rbinom(n, 1, 0.4 + (0.2 * S)) W2 <- rnorm(n, 0.1 * S, 1) W3 <- rnorm(n, 1 + (0.2 * S), 1) if (is.null(A)) A <- rbinom(n, 1, 0.5) Z <- rbinom(n, 1, plogis(-log(1.6) + log(4)*A - log(1.1)*W2 - log(1.3)*W3)) Yi <- rbinom(n, 1, plogis(log(1.6) + log(1.9)*Z - log(1.3)*W3 - log(1.2)*W1 + log(1.2)*W1*Z)) Y <- ifelse(S == 1, Yi, NA_real_) data.frame(W1 = W1, W2 = W2, W3 = W3, S = S, A = A, Z = Z, Y = Y, Yi = Yi) } set.seed(123) n <- 1000 tmp <- gendata(n) if (requireNamespace("ranger", quietly = TRUE)) { transport_ittate(data = tmp, trt = "Z", instrument = "A", outcome = "Y", covar = c("W1", "W2", "W3"), pop = "S", folds = 1) }
gendata <- function(n, A = NULL, S = NULL) { if (is.null(S)) S <- rbinom(n, 1, 0.5) W1 <- rbinom(n, 1, 0.4 + (0.2 * S)) W2 <- rnorm(n, 0.1 * S, 1) W3 <- rnorm(n, 1 + (0.2 * S), 1) if (is.null(A)) A <- rbinom(n, 1, 0.5) Z <- rbinom(n, 1, plogis(-log(1.6) + log(4)*A - log(1.1)*W2 - log(1.3)*W3)) Yi <- rbinom(n, 1, plogis(log(1.6) + log(1.9)*Z - log(1.3)*W3 - log(1.2)*W1 + log(1.2)*W1*Z)) Y <- ifelse(S == 1, Yi, NA_real_) data.frame(W1 = W1, W2 = W2, W3 = W3, S = S, A = A, Z = Z, Y = Y, Yi = Yi) } set.seed(123) n <- 1000 tmp <- gendata(n) if (requireNamespace("ranger", quietly = TRUE)) { transport_ittate(data = tmp, trt = "Z", instrument = "A", outcome = "Y", covar = c("W1", "W2", "W3"), pop = "S", folds = 1) }