Targeted Maximum Likelihood Estimation to adjust for time-varying confounding – a tutorial paper

R Markdown and Analysis Code

This repository contains data and a number of snippets of R code, used in the TMLE tutorial by Clare, Dobbins, Bruno and Mattick.

DescriptionMarkdownGithub R codeDownload R code
Creating the longitudinal dataset used in example analyses. Data creation is done using the package ‘simcausal’ (1).Data Creation MarkdownData Creation CodeDownload code
Cross-sectional TMLE analysis, both manually and using the package ‘tmle’ (2).Cross-sectional Analysis MarkdownCross-sectional Analysis CodeDownload code
Longitudinal TMLE with a single outcome measurement, both manually and using the package ‘ltmle’ (3).Single Outcome Longitudinal MarkdownSingle Outcome Longitudinal CodeDownload code
Longitudinal TMLE with a repeated outcome measurement, both manually and using the package ‘ltmle’ (3).Repeated Outcome Longitudinal MarkdownRepeated Outcome Longitudinal CodeDownload code

The longitudinal dataset, ldata.RData, is also included in the repository: https://github.com/philipclare/tmletutorial

  1. Sofrygin O, van der Laan Mark J, Neugebauer R. simcausal R Package: Conducting Transparent and Reproducible Simulation Studies of Causal Effect Estimation with Complex Longitudinal Data. Journal of Statistical Software. 2017;81(2):1-47.
  2. Gruber S, van der Laan MJ. tmle: An R Package for Targeted Maximum Likelihood Estimation. Journal of Statistical Software. 2012;51(13):1-35.
  3. Lendle SD, Schwab J, Petersen ML, van der Laan MJ. ltmle: An R Package Implementing Targeted Minimum Loss-Based Estimation for Longitudinal Data. Journal of Statistical Software. 2017;81(1):1-21. Petersen ML, van der Laan MJ. ltmle: An R Package Implementing Targeted Minimum Loss-Based Estimation for Longitudinal Data. Journal of Statistical Software. 2017;81(1):1-21.
Avatar
Dr. Philip J Clare, PhD
Research Fellow

Biostatistician at the National Drug and Alcohol Research Centre, UNSW Sydney.

Related