ddml: Double/debiased machine learning in Stata

Achim Ahrens, Christian Hansen, Mark Edwin Schaffer, Thomas Wiemann

Research output: Contribution to journalArticlepeer-review

21 Downloads (Pure)


We introduce the package ddml for Double/Debiased Machine Learning (DDML) in Stata. Estimators of causal parameters for five different econometric models are supported, allowing for flexible estimation of causal effects of endogenous variables in settings with unknown functional forms and/or many exogenous variables. ddml is compatible with many existing supervised machine learning programs in Stata. We recommend using DDML in combination with stacking estimation which combines multiple machine learners into a final predictor. We provide Monte Carlo evidence to support our recommendation.
Original languageEnglish
JournalStata Journal
Publication statusAccepted/In press - 12 Oct 2023


  • causal inference
  • machine learning
  • doubly-robust estimation

ASJC Scopus subject areas

  • Economics and Econometrics
  • Software

Cite this