Skip to content


Switch branches/tags

Name already in use

A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?

Latest commit


Git stats


Failed to load latest commit information.
Latest commit message
Commit time


R-CMD-check Coverage Status Project Status: Active – The project has reached a stable, usable state and is being actively developed. License: GPL v3 DOI

Targeted Learning of the Causal Effects of Stochastic Interventions

Authors: Nima Hejazi, Jeremy Coyle, and Mark van der Laan

What’s tmle3shift?

tmle3shift is an adapter/extension R package in the tlverse ecosystem that exposes support for the estimation of a target parameter defined as the mean counterfactual outcome under a posited shift of the natural value of a continuous-valued intervention, using the formalism of stochastic treatment regimes. As an adapter package, tmle3shift builds upon the core tlverse grammar introduced by tmle3, a general framework that supports the implementation of a range of TMLE parameters through a unified interface. For a detailed description of the target parameter, TML estimator, and algorithm implemented in tmle3shift, the interested reader is invited to consult Dı́az and van der Laan (2012) and Dı́az and van der Laan (2018). For a general discussion of the framework of targeted minimum loss-based estimation and the role this methodology plays in statistical and causal inference, the canonical references are van der Laan and Rose (2011) and van der Laan and Rose (2018).

Building on the original work surrounding the TML estimator for the aforementioned target parameter, tmle3shift additionally implements a set of techniques for variable importance analysis, allowing for a sequence of mean counterfactual outcomes, estimated under a sequence of posited shifts, to be summarized via a working marginal structural model (MSM). The goal of this work is to build upon the tlverse framework and the estimation methodology implemented for a single mean counterfactual outcome in order to introduce an end-to-end methodology for variable importance analyses.


You can install the development version of tmle3shift from GitHub via remotes with



If you encounter any bugs or have any specific feature requests, please file an issue.


Contributions are very welcome. Interested contributors should consult our contribution guidelines prior to submitting a pull request.


After using the tmle3shift R package, please cite the following:

      author = {Hejazi, Nima S and Coyle, Jeremy R and {van der Laan}, Mark
      title = {{tmle3shift}: {Targeted Learning} of the Causal Effects of
        Stochastic Interventions},
      year = {2021},
      howpublished = {\url{}},
      note = {{R} package version 0.2.0},
      url = {},
      doi = {10.5281/zenodo.4603372}


  • R/txshift - An R package providing an independent implementation of the TML estimation procedure and statistical methodology as is made available here, without reliance on the tlverse grammar provided by tmle3.


The development of this software was supported in part through a grant from the National Institutes of Health: T32 LM012417-02.


The contents of this repository are distributed under the GPL-3 license. See file LICENSE for details.


Dı́az, Iván, and Mark J van der Laan. 2012. “Population Intervention Causal Effects Based on Stochastic Interventions.” Biometrics 68 (2): 541–49.

———. 2018. “Stochastic Treatment Regimes.” In Targeted Learning in Data Science: Causal Inference for Complex Longitudinal Studies, 167–80. Springer Science & Business Media.

van der Laan, Mark J, and Sherri Rose. 2011. Targeted Learning: Causal Inference for Observational and Experimental Data. Springer Science & Business Media.

———. 2018. Targeted Learning in Data Science: Causal Inference for Complex Longitudinal Studies. Springer Science & Business Media.