GithubHelp home page GithubHelp logo

kathoffman / lmtp-tutorial Goto Github PK

View Code? Open in Web Editor NEW
20.0 1.0 0.0 2.06 MB

Corresponding code guide to the tutorial paper "Introducing longitudinal modified treatment policies: a unified framework for studying complex exposures" (Hoffman et al., 2023)

R 100.00%
causal-inference doubly-robust lmtp machine-learning statistical-analysis superlearner time-varying

lmtp-tutorial's Introduction

Longitudinal Modified Treatment Policies (LMTPs): A unified framework for studying complex exposures

Corresponding code guide for Hoffman et al. (2023)

This repository demonstrates the use of the open-source R package lmtp to estimate the effects of delaying intubation on mortality in a cohort of hospitalized COVID-19 patients during Spring 2020, as described in Hoffman et al. (2023).

What are LMTPs?

Longitudinal Modified Treatment Policies (LMTPs) are a recently developed methodology for causal inference (Diaz et al. (2021)). LMTPs generalize many commonly used parameters for causal inference including average treatment effects, and facilitate the mathematical formalization, identification, and estimation of many novel parameters. LMTPs apply to a wide variety of exposures, including binary, multivariate, and continuous, as well as exposures that result in practical violations of the positivity assumption. LMTPs can accommodate time-varying treatments and confounders, competing risks, loss-to-follow-up, as well as survival, binary, or continuous outcomes.

About the application

Hoffman et al. provides numerous examples of types of research questions which can be answered within the proposed framework, and then goes into more depth with one of these examples---specifically, estimating the effect of delaying intubation on critically ill COVID-19 patients' mortality. The study design is retrospective and uses electronic health records of 3,059 patients hospitalized with COVID-19 at New York Presbyterian hospital between March 1 and May 15, 2020. The exposure is categorical and time-varying, and the outcome is also time-to-event with informative right-censoring. Adjustment set includes dozens of baseline and time-varying confounders. The estimator is a sequentially doubly robust (SDR) estimator which utilizes regressions for the exposure and outcome. These exposure and outcome regressions utilized a superlearner ensemble of flexible machine learning regressions.

Repository contents

Main scripts:

  • R/run_lmtp.R - main analysis script. sets up exposure, confounders, outcome, and runs lmtp_sdr() for an intervention and null intervention for all time points in the study.
  • R/clean_results.R - summarizes LMTP results as tibbles and creates graphs of output.

Supporting scripts:

  • R/vis.R contains data visualization functions to plot incidence and incidence differences over time
  • R/utils.R contains helper functions to clean results and summarize analyses (e.g. create marginal / simultaneous confidence intervals across all time points of incidence curve)
  • R/assess_density_ratios.R provides code to plot the density ratios across time to assess for potential positivity violations

Additional resources

  • lmtp Github and package documentation
  • Williams and Diaz (2023) tutorial paper on the lmtp package
  • KHstats' introductory blog post on Modified Treatment Policies
  • Diaz et al. (2021)'s original Journal of the American Statistical Association statistical methodology paper on LMTPs
  • Diaz et al. (2022)'s statistical methodology paper adapting LMTPs for competing risks data

Acknowledgements

Several functions in vis.R and utils.R were adapted from code written by Dr. Nima Hejazi.

lmtp-tutorial's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 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.