Targeted maximum likelihood estimation for a binary treatment: A tutorial

Harvard | Vancouver

Luque-Fernandez, MA, Schomaker, M, Rachet, B and Schnitzer, ME. 2018. Targeted maximum likelihood estimation for a binary treatment: A tutorial. [Online]. Github. Available from: -

Export Citation



When estimating the average effect of a binary treatment (or exposure), methods that incorporate propensity scores, the G-formula, or targeted maximum likelihood estimation (TMLE) are preferred over naive regression approaches which are biased under misspecification of a parametric outcome model. Contrastingly, propensity score methods require the correct specification of an exposure model. Double-robust methods only require correct specification of one of these models. TMLE is a semi-parametric double-robust method that improves the chances of correct model specification by allowing for flexible estimation using non-parametric machine-learning methods. It therefore requires weaker assumptions than its competitors. We provide a step-by-step guided implementation of TMLE and illustrate it in a realistic scenario based on cancer epidemiology where assumptions about correct model specification and positivity (i.e., when a study participant had zero probability of receiving the treatment) are nearly violated. This article provides a concise and reproducible educational introduction to TMLE for a binary outcome and exposure. The reader should gain sufficient understanding of TMLE from this introductory tutorial to be able to apply the method in practice. Extensive R-code is provided in easy-to-read boxes throughout the article for replicability. Stata users will find a testing implementation of TMLE and additional material in the appendix and at the following GitHub repository:

Published in a 3rd party system Date: 17 April 2018
Data capture method:
Mode of data capture
Data Creators(s): Luque-Fernandez, MA, Schomaker, M, Rachet, B and Schnitzer, ME
LSHTM Faculty/Department: Faculty of Epidemiology and Population Health > Dept of Non-Communicable Disease Epidemiology
Participating Institutions: London School of Hygiene & Tropical Medicine, London, United Kingdom, The University of Cape Town, Cape Town, South Africa, Université de Montréal, Montréal, Canada


Data not available from this repository.

Dataset may be available externally from:

Related resources

  • Github (Online Data Resource)
LSHTM Open Access publications:



Edit Item Edit Item (admin only)