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.
Description | Markdown | Github R code | Download R code |
---|---|---|---|
Creating the longitudinal dataset used in example analyses. Data creation is done using the package ‘simcausal’ (1). | Data Creation Markdown | Data Creation Code | Download code |
Cross-sectional TMLE analysis, both manually and using the package ‘tmle’ (2). | Cross-sectional Analysis Markdown | Cross-sectional Analysis Code | Download code |
Longitudinal TMLE with a single outcome measurement, both manually and using the package ‘ltmle’ (3). | Single Outcome Longitudinal Markdown | Single Outcome Longitudinal Code | Download code |
Longitudinal TMLE with a repeated outcome measurement, both manually and using the package ‘ltmle’ (3). | Repeated Outcome Longitudinal Markdown | Repeated Outcome Longitudinal Code | Download code |
The longitudinal dataset, ldata.RData, is also included in the repository: https://github.com/philipclare/tmletutorial
- 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.
- Gruber S, van der Laan MJ. tmle: An R Package for Targeted Maximum Likelihood Estimation. Journal of Statistical Software. 2012;51(13):1-35.
- 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.