IDEAS home Printed from
   My bibliography  Save this article

mediation: R Package for Causal Mediation Analysis


  • Tingley, Dustin
  • Yamamoto, Teppei
  • Hirose, Kentaro
  • Keele, Luke
  • Imai, Kosuke


In this paper, we describe the R package mediation for conducting causal mediation analysis in applied empirical research. In many scientific disciplines, the goal of researchers is not only estimating causal effects of a treatment but also understanding the process in which the treatment causally affects the outcome. Causal mediation analysis is frequently used to assess potential causal mechanisms. The mediation package implements a comprehensive suite of statistical tools for conducting such an analysis. The package is organized into two distinct approaches. Using the model-based approach, researchers can estimate causal mediation effects and conduct sensitivity analysis under the standard research design. Furthermore, the design-based approach provides several analysis tools that are applicable under different experimental designs. This approach requires weaker assumptions than the model-based approach. We also implement a statistical method for dealing with multiple (causally dependent) mediators, which are often encountered in practice. Finally, the package also offers a methodology for assessing causal mediation in the presence of treatment noncompliance, a common problem in randomized trials.

Suggested Citation

  • Tingley, Dustin & Yamamoto, Teppei & Hirose, Kentaro & Keele, Luke & Imai, Kosuke, 2014. "mediation: R Package for Causal Mediation Analysis," Journal of Statistical Software, Foundation for Open Access Statistics, vol. 59(i05).
  • Handle: RePEc:jss:jstsof:v:059:i05

    Download full text from publisher

    File URL:
    Download Restriction: no

    File URL:
    Download Restriction: no

    File URL:
    Download Restriction: no

    References listed on IDEAS

    1. Imai, Kosuke & Yamamoto, Teppei, 2013. "Identification and Sensitivity Analysis for Multiple Causal Mechanisms: Revisiting Evidence from Framing Experiments," Political Analysis, Cambridge University Press, vol. 21(02), pages 141-171, March.
    Full references (including those not matched with items on IDEAS)


    Citations are extracted by the CitEc Project, subscribe to its RSS feed for this item.

    Cited by:

    1. repec:eee:ijrema:v:35:y:2018:i:4:p:673-685 is not listed on IDEAS
    2. repec:eee:enepol:v:129:y:2019:i:c:p:738-748 is not listed on IDEAS
    3. repec:eee:intell:v:64:y:2017:i:c:p:1-8 is not listed on IDEAS
    4. Burhan Can Karahasan & Firat Bilgel, 2018. "State-Business Relations and Financial Accessibility: Explaining Firm Performance in the MENA Region," Working Papers 1279, Economic Research Forum, revised 26 Dec 2018.
    5. repec:eee:wdevel:v:98:y:2017:i:c:p:120-132 is not listed on IDEAS
    6. repec:jdm:journl:v:14:y:2019:i:3:p:349-363 is not listed on IDEAS
    7. repec:eee:jeborg:v:150:y:2018:i:c:p:62-85 is not listed on IDEAS
    8. repec:kap:jbuset:v:157:y:2019:i:1:d:10.1007_s10551-017-3643-y is not listed on IDEAS
    9. Martin Huber, 2016. "Disentangling policy effects into causal channels," IZA World of Labor, Institute of Labor Economics (IZA), pages 259-259, May.
    10. Ward, Jeffrey T. & Hartley, Richard D. & Tillyer, Rob, 2016. "Unpacking gender and racial/ethnic biases in the federal sentencing of drug offenders: A causal mediation approach," Journal of Criminal Justice, Elsevier, vol. 46(C), pages 196-206.
    11. repec:eee:jbrese:v:92:y:2018:i:c:p:219-230 is not listed on IDEAS
    12. Hsu Yu-Chin & Huber Martin & Lai Tsung-Chih, 2019. "Nonparametric estimation of natural direct and indirect effects based on inverse probability weighting," Journal of Econometric Methods, De Gruyter, vol. 8(1), pages 1-20, January.
    13. Christopher Ojeda, 2015. "Depression and Political Participation," Social Science Quarterly, Southwestern Social Science Association, vol. 96(5), pages 1226-1243, November.
    14. repec:bpj:ijbist:v:13:y:2017:i:2:p:18:n:6 is not listed on IDEAS
    15. repec:eee:ijrema:v:34:y:2017:i:4:p:780-798 is not listed on IDEAS
    16. Sijeong Lim & Brian Burgoon, 2017. "Globalization and Support for Unemployment Spending in Asia," Working Papers hal-01670983, HAL.
    17. Brown, Martin & Henchoz, Caroline & Spycher, Thomas, 2017. "Culture and Financial Literacy," Working Papers on Finance 1703, University of St. Gallen, School of Finance.
    18. repec:eee:joinma:v:38:y:2017:i:c:p:64-81 is not listed on IDEAS
    19. repec:bla:biomet:v:73:y:2017:i:2:p:401-409 is not listed on IDEAS
    20. repec:spr:decisn:v:44:y:2017:i:4:d:10.1007_s40622-017-0166-4 is not listed on IDEAS
    21. repec:eee:socmed:v:202:y:2018:i:c:p:43-53 is not listed on IDEAS
    22. repec:eee:cysrev:v:82:y:2017:i:c:p:310-320 is not listed on IDEAS

    More about this item


    Access and download statistics


    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:jss:jstsof:v:059:i05. See general information about how to correct material in RePEc.

    For technical questions regarding this item, or to correct its authors, title, abstract, bibliographic or download information, contact: (Christopher F. Baum). General contact details of provider: .

    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 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.

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

    IDEAS is a RePEc service hosted by the Research Division of the Federal Reserve Bank of St. Louis . RePEc uses bibliographic data supplied by the respective publishers.