IDEAS home Printed from https://ideas.repec.org/p/arx/papers/2602.23877.html

Difference-in-differences for mediation analysis using double machine learning

Author

Listed:
  • Martin Huber
  • Sarina Joy Oberhansli

Abstract

We propose a difference-in-differences (DiD) framework with mediation for possibly multivalued discrete or continuous treatments and mediators, aimed at identifying the direct effect of the treatment on the outcome (net of effects operating through the mediator), the indirect effect via the mediator, and the joint effects of treatment and mediator, consistent with the framework of dynamic treatment effects. Identification relies on a conditional parallel trends assumption imposed on the mean potential outcome across treatment and mediator states, or (depending on the causal parameter) additionally on the mean potential outcomes and potential mediator distributions across treatment states. We propose ATET estimators for repeated cross sections and panel data within the double/debiased machine learning framework, which allows for data-driven control of covariates, and we establish their asymptotic normality under standard regularity conditions. We investigate the finite-sample performance of the proposed methods in a simulation study and illustrate our approach in an empirical application to the US National Longitudinal Survey of Youth, estimating the direct effect of health care coverage on general health as well as the indirect effect operating through routine checkups.

Suggested Citation

  • Martin Huber & Sarina Joy Oberhansli, 2026. "Difference-in-differences for mediation analysis using double machine learning," Papers 2602.23877, arXiv.org.
  • Handle: RePEc:arx:papers:2602.23877
    as

    Download full text from publisher

    File URL: http://arxiv.org/pdf/2602.23877
    File Function: Latest version
    Download Restriction: no
    ---><---

    References listed on IDEAS

    as
    1. Seung‐Hyun Hong, 2013. "Measuring The Effect Of Napster On Recorded Music Sales: Difference‐In‐Differences Estimates Under Compositional Changes," Journal of Applied Econometrics, John Wiley & Sons, Ltd., vol. 28(2), pages 297-324, March.
    2. Goodman-Bacon, Andrew, 2021. "Difference-in-differences with variation in treatment timing," Journal of Econometrics, Elsevier, vol. 225(2), pages 254-277.
    3. Clément de Chaisemartin & Xavier D'Haultfœuille, 2020. "Two-Way Fixed Effects Estimators with Heterogeneous Treatment Effects," American Economic Review, American Economic Association, vol. 110(9), pages 2964-2996, September.
    4. Constantine E. Frangakis & Donald B. Rubin, 2002. "Principal Stratification in Causal Inference," Biometrics, The International Biometric Society, vol. 58(1), pages 21-29, March.
    5. Tran Linh & Yiannoutsos Constantin & Wools-Kaloustian Kara & Siika Abraham & van der Laan Mark & Petersen Maya, 2019. "Double Robust Efficient Estimators of Longitudinal Treatment Effects: Comparative Performance in Simulations and a Case Study," The International Journal of Biostatistics, De Gruyter, vol. 15(2), pages 1-27, November.
    6. Sant’Anna, Pedro H.C. & Zhao, Jun, 2020. "Doubly robust difference-in-differences estimators," Journal of Econometrics, Elsevier, vol. 219(1), pages 101-122.
    7. Kosuke Imai & David A. van Dyk, 2004. "Causal Inference With General Treatment Regimes: Generalizing the Propensity Score," Journal of the American Statistical Association, American Statistical Association, vol. 99, pages 854-866, January.
    8. Lechner, Michael, 2011. "The Estimation of Causal Effects by Difference-in-Difference Methods," Foundations and Trends(R) in Econometrics, now publishers, vol. 4(3), pages 165-224, November.
    9. Alexandre Belloni & Victor Chernozhukov & Christian Hansen, 2014. "Inference on Treatment Effects after Selection among High-Dimensional Controlsâ€," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 81(2), pages 608-650.
    10. Kirill Borusyak & Xavier Jaravel & Jann Spiess, 2024. "Revisiting Event-Study Designs: Robust and Efficient Estimation," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 91(6), pages 3253-3285.
    11. Alberto Abadie, 2005. "Semiparametric Difference-in-Differences Estimators," The Review of Economic Studies, Review of Economic Studies Ltd, vol. 72(1), pages 1-19.
    12. Brantly Callaway & Tong Li, 2019. "Quantile treatment effects in difference in differences models with panel data," Quantitative Economics, Econometric Society, vol. 10(4), pages 1579-1618, November.
    13. Neng-Chieh Chang, 2020. "Double/debiased machine learning for difference-in-differences models," The Econometrics Journal, Royal Economic Society, vol. 23(2), pages 177-191.
    14. Greg Lewis & Vasilis Syrgkanis, 2020. "Double/Debiased Machine Learning for Dynamic Treatment Effects via g-Estimation," Papers 2002.07285, arXiv.org, revised Jun 2021.
    15. Ashenfelter, Orley C, 1978. "Estimating the Effect of Training Programs on Earnings," The Review of Economics and Statistics, MIT Press, vol. 60(1), pages 47-57, February.
    16. Hugo Bodory & Martin Huber & Lukáš Lafférs, 2022. "Evaluating (weighted) dynamic treatment effects by double machine learning [Identification of causal effects using instrumental variables]," The Econometrics Journal, Royal Economic Society, vol. 25(3), pages 628-648.
    17. Brantly Callaway & Andrew Goodman-Bacon & Pedro H. C. Sant'Anna, 2021. "Difference-in-Differences with a Continuous Treatment," Papers 2107.02637, arXiv.org, revised Dec 2025.
    18. Guido W. Imbens, 2004. "Nonparametric Estimation of Average Treatment Effects Under Exogeneity: A Review," The Review of Economics and Statistics, MIT Press, vol. 86(1), pages 4-29, February.
    19. Fan, Jianqing & Yao, Qiwei & Tong, Howell, 1996. "Estimation of conditional densities and sensitivity measures in nonlinear dynamical systems," LSE Research Online Documents on Economics 6704, London School of Economics and Political Science, LSE Library.
    20. Michael Zimmert, 2018. "Efficient Difference-in-Differences Estimation with High-Dimensional Common Trend Confounding," Papers 1809.01643, arXiv.org, revised Aug 2020.
    21. Eva Deuchert & Martin Huber & Mark Schelker, 2019. "Direct and Indirect Effects Based on Difference-in-Differences With an Application to Political Preferences Following the Vietnam Draft Lottery," Journal of Business & Economic Statistics, Taylor & Francis Journals, vol. 37(4), pages 710-720, October.
    22. Victor Chernozhukov & Denis Chetverikov & Mert Demirer & Esther Duflo & Christian Hansen & Whitney Newey & James Robins, 2018. "Double/debiased machine learning for treatment and structural parameters," Econometrics Journal, Royal Economic Society, vol. 21(1), pages 1-68, February.
    23. Helmut Farbmacher & Martin Huber & Lukáš Lafférs & Henrika Langen & Martin Spindler, 2022. "Causal mediation analysis with double machine learning [Mediation analysis via potential outcomes models]," The Econometrics Journal, Royal Economic Society, vol. 25(2), pages 277-300.
    24. Tran Linh & Yiannoutsos Constantin & Wools-Kaloustian Kara & Siika Abraham & van der Laan Mark & Petersen Maya, 2019. "Double Robust Efficient Estimators of Longitudinal Treatment Effects: Comparative Performance in Simulations and a Case Study," The International Journal of Biostatistics, De Gruyter, vol. 15(2), pages 1-27, November.
    25. Sun, Liyang & Abraham, Sarah, 2021. "Estimating dynamic treatment effects in event studies with heterogeneous treatment effects," Journal of Econometrics, Elsevier, vol. 225(2), pages 175-199.
    26. Callaway, Brantly & Sant’Anna, Pedro H.C., 2021. "Difference-in-Differences with multiple time periods," Journal of Econometrics, Elsevier, vol. 225(2), pages 200-230.
    27. Callaway, Brantly & Li, Tong & Oka, Tatsushi, 2018. "Quantile treatment effects in difference in differences models under dependence restrictions and with only two time periods," Journal of Econometrics, Elsevier, vol. 206(2), pages 395-413.
    28. Lucas Z. Zhang, 2024. "Continuous difference-in-differences with double/debiased machine learning," Papers 2408.10509, arXiv.org, revised Dec 2025.
    Full references (including those not matched with items on IDEAS)

    Most related items

    These are the items that most often cite the same works as this one and are cited by the same works as this one.
    1. Gregory Faletto, 2023. "Fused Extended Two-Way Fixed Effects for Difference-in-Differences With Staggered Adoptions," Papers 2312.05985, arXiv.org, revised Apr 2025.
    2. Roth, Jonathan & Sant’Anna, Pedro H.C. & Bilinski, Alyssa & Poe, John, 2023. "What’s trending in difference-in-differences? A synthesis of the recent econometrics literature," Journal of Econometrics, Elsevier, vol. 235(2), pages 2218-2244.
    3. Arne Henningsen & Guy Low & David Wuepper & Tobias Dalhaus & Hugo Storm & Dagim Belay & Stefan Hirsch, 2024. "Estimating Causal Effects with Observational Data: Guidelines for Agricultural and Applied Economists," IFRO Working Paper 2024/03, University of Copenhagen, Department of Food and Resource Economics.
    4. Michel F. C. Haddad & Martin Huber & Jos'e Eduardo Medina-Reyes & Lucas Z. Zhang, 2024. "Difference-in-Differences with Time-varying Continuous Treatments using Double/Debiased Machine Learning," Papers 2410.21105, arXiv.org, revised Jan 2026.
    5. Dmitry Arkhangelsky & Guido Imbens, 2023. "Causal Models for Longitudinal and Panel Data: A Survey," Papers 2311.15458, arXiv.org, revised Jun 2024.
    6. Dalia Ghanem & Pedro H. C. Sant'Anna & Kaspar Wüthrich, 2022. "Selection and Parallel Trends," CESifo Working Paper Series 9910, CESifo.
    7. Dor Leventer, 2025. "Conditional Triple Difference-in-Differences," Papers 2502.16126, arXiv.org, revised Jun 2025.
    8. Yuhao Deng & Le Kang, 2026. "Doubly Robust Estimation of Treatment Effects in Staggered Difference-in-Differences with Time-Varying Covariates," Papers 2603.04080, arXiv.org.
    9. Martin Huber & Eva-Maria Oe{ss}, 2024. "A joint test of unconfoundedness and common trends," Papers 2404.16961, arXiv.org, revised Jun 2024.
    10. Mark Kattenberg & Bas Scheer & Jurre Thiel, 2023. "Causal forests with fixed effects for treatment effect heterogeneity in difference-in-differences," CPB Discussion Paper 452, CPB Netherlands Bureau for Economic Policy Analysis.
    11. Melnik, Walter & Smyth, Andrew, 2024. "R&D tax credits and innovation," Journal of Public Economics, Elsevier, vol. 236(C).
    12. Philipp Barteska & Jay Euijung Lee, 2025. "Personnel is policy (implementation): Bureaucrats and the Korean export miracle," CEP Discussion Papers dp2099, Centre for Economic Performance, LSE.
    13. Andreas Stoller, 2026. "Impact of Tobacco Advertising Restrictions in Switzerland: A Quasi-Experimental Study on the Effect of Billboard Bans on Smoking," Papers 2601.08352, arXiv.org.
    14. Lucas Z. Zhang, 2024. "Continuous difference-in-differences with double/debiased machine learning," Papers 2408.10509, arXiv.org, revised Dec 2025.
    15. Kyunghoon Ban & D'esir'e K'edagni, 2022. "Robust Difference-in-differences Models," Papers 2211.06710, arXiv.org, revised Aug 2023.
    16. Christoph Breunig & Ruixuan Liu & Zhengfei Yu, 2024. "Semiparametric Bayesian Difference-in-Differences," Papers 2412.04605, arXiv.org, revised Jun 2025.
    17. Ridwan Ah Sheikh & Sunil Kanwar, 2024. "Revisiting the Impact of TRIPS on IPR-intensive Export Flows: Evidence from Staggered Difference-in-Differences," Working papers 351, Centre for Development Economics, Delhi School of Economics.
    18. Lorenzo Testa & Edward H. Kennedy & Matthew Reimherr, 2025. "Efficient Difference-in-Differences Estimation when Outcomes are Missing at Random," Papers 2509.25009, arXiv.org, revised Jan 2026.
    19. Cocco, Valentin & Chakir, Raja & Mouysset, Lauriane, 2025. "Guilty or scapegoat? Land consolidation and hedgerow decline," Journal of Environmental Economics and Management, Elsevier, vol. 133(C).
    20. Callaway, Brantly & Li, Tong, 2023. "Policy evaluation during a pandemic," Journal of Econometrics, Elsevier, vol. 236(1).

    More about this item

    NEP fields

    This paper has been announced in the following NEP Reports:

    Statistics

    Access and download statistics

    Corrections

    All material on this site has been provided by the respective publishers and authors. You can help correct errors and omissions. When requesting a correction, please mention this item's handle: RePEc:arx:papers:2602.23877. See general information about how to correct material in RePEc.

    If you have authored this item and are not yet registered with RePEc, we encourage you to do it here. This allows to link your profile to this item. It also allows you to accept potential citations to this item that we are uncertain about.

    If CitEc recognized a bibliographic reference but did not link an item in RePEc to it, you can help with this form .

    If you know of missing items citing this one, you can help us creating those links by adding the relevant references in the same way as above, for each refering item. If you are a registered author of this item, you may also want to check the "citations" tab in your RePEc Author Service profile, as there may be some citations waiting for confirmation.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: arXiv administrators (email available below). General contact details of provider: http://arxiv.org/ .

    Please note that corrections may take a couple of weeks to filter through the various RePEc services.

    IDEAS is a RePEc service. RePEc uses bibliographic data supplied by the respective publishers.