Code Monkey home page Code Monkey logo

transport's Introduction

transport

Travis-CI Build Status AppVeyor Build Status Coverage Status

Robust targeted maximum likelihood estimators (TMLEs) for transporting intervention effects from one population to another

Description

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:

  • intent-to-treat average treatment effect (ITTATE)
  • average causal effect of the exposure on outcome (EACE)
  • complier average causal effect (CACE)

Installation

Install the development version from github:

# install.packages("devtools")
devtools::install_github("ck37/transport")

Example

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)

References

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.).

transport's People

Contributors

ck37 avatar kararudolph avatar

Stargazers

Ken Taylor avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.