Tehran University of Medical Sciences

Science Communicator Platform

Stay connected! Follow us on X network (Twitter):
Share By
Introduction to Computational Causal Inference Using Reproducible Stata, R, and Python Code: A Tutorial Publisher Pubmed



Smith MJ1 ; Mansournia MA2 ; Maringe C1 ; Zivich PN3, 4 ; Cole SR3 ; Leyrat C1 ; Belot A1 ; Rachet B1 ; Luquefernandez MA1, 5, 6
Authors

Source: Statistics in Medicine Published:2022


Abstract

The main purpose of many medical studies is to estimate the effects of a treatment or exposure on an outcome. However, it is not always possible to randomize the study participants to a particular treatment, therefore observational study designs may be used. There are major challenges with observational studies; one of which is confounding. Controlling for confounding is commonly performed by direct adjustment of measured confounders; although, sometimes this approach is suboptimal due to modeling assumptions and misspecification. Recent advances in the field of causal inference have dealt with confounding by building on classical standardization methods. However, these recent advances have progressed quickly with a relative paucity of computational-oriented applied tutorials contributing to some confusion in the use of these methods among applied researchers. In this tutorial, we show the computational implementation of different causal inference estimators from a historical perspective where new estimators were developed to overcome the limitations of the previous estimators (ie, nonparametric and parametric g-formula, inverse probability weighting, double-robust, and data-adaptive estimators). We illustrate the implementation of different methods using an empirical example from the Connors study based on intensive care medicine, and most importantly, we provide reproducible and commented code in Stata, R, and Python for researchers to adapt in their own observational study. The code can be accessed at https://github.com/migariane/Tutorial_Computational_Causal_Inference_Estimators. © 2021 The Authors. Statistics in Medicine published by John Wiley & Sons Ltd.
Other Related Docs
10. Causal Methods for Observational Research: A Primer, Archives of Iranian Medicine (2018)
12. Using Causal Diagrams for Biomedical Research, Annals of Emergency Medicine (2023)
13. Balancing Scores and Causal Diagrams, International Journal of Epidemiology (2025)