knitr::opts_chunk$set( collapse = TRUE, comment = "#>", fig.path = "images/README-", fig.width = 4, fig.height = 3 )
Robust targeted maximum likelihood estimators (TMLEs) for transporting intervention effects from one population to another
transport is an R package for transport estimators: applying the estimated treatment effect from one population or site to another.
The package implements TMLE-based estimators for three parameters:
Install the development version from github:
# install.packages("devtools") devtools::install_github("ck37/transport")
This example from Rudolph & van der Laan (2017) does not work yet, but will soon.
n <- 5000 site <- rbinom(n, 1, .5) race <- rbinom(n,1, .4 + (.2 * site)) crime <- rnorm(n, .1 * site , 1) discrimination <- rnorm(n, 1 + (.2 * site ), 1) # Instrument voucher <- rbinom(n, 1, .5) # Exposure move0 <- rbinom(n, 1, plogis(-log(1.6) - log(1.1) * crime - log(1.3) * discrimination)) move1 <- rbinom(n, 1, plogis(-log(1.6) + log(4) - log(1.1) * crime - log(1.3) * discrimination)) move <- ifelse(voucher == 1, move1, move0) # Outcomes inschoola0 <- rbinom(n, 1, plogis(log(1.6) + (log(1.9) * move0) - log(1.3) * discrimination - log(1.2) * race + log(1.2) * race * move0)) inschoola1 <- rbinom(n, 1, plogis(log(1.6) + (log(1.9) * move1) - log(1.3) * discrimination - log(1.2) * race + log(1.2) * race * move1)) inschoola <- ifelse(voucher == 1, inschoola1, inschoola0) dat <- data.frame(w2 = crime , w3 = discrimination, w1 = race , site = site , a = voucher, z = move, y = inschoola) wmat <- dat[, c("w1", "w2", "w3")] amodel <- "a ~ 1" sitemodel <- "site ~ w1 + w2 + w3 " zmodel <- "z ~ a + w2 + w3" outmodel <- "y ~ z + w1 + w3 + z:w1" outmodelnoz <- "y ~ a + w1 + w3 + a:w1" q2model <- "w1 + w2 + w3 " ittate_est <- transport_ittate(a = dat$a, z = dat$z, y = dat$y, site = dat$site, w = wmat, aamodel = amodel, asitemodel = sitemodel, azmodel = zmodel, aoutmodel = outmodel, aq2model = q2model) cace_est <- transport_cace(ca = dat$a, cz = dat$z, cy = dat$y, csite = dat$site, cw = wmat, csitemodel = sitemodel, czmodel = zmodel, coutmodel = outmodel, cq2model = q2model) eace_est <- transport_eace(a = dat$a, z = dat$z, y = dat$y, site = dat$site, w = wmat, nsitemodel = sitemodel, nzmodel = zmodel, noutmodel = outmodel)
Rudolph, K. E., & van der Laan, M. J. (2017). Robust estimation of encouragement design intervention effects transported across sites. Journal of the Royal Statistical Society: Series B (Statistical Methodology), 79(5), 1509-1525.
Rudolph, K. E., Schmidt, N. M., Glymour, M. M., Crowder, R., Galin, J., Ahern, J., & Osypuk, T. L. (2017). Composition or context: using transportability to understand drivers of site differences in a large-scale housing experiment. Epidemiology (Cambridge, Mass.).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.