Dustin Tingley, Teppei Yamamoto, Kentaro Hirose, Luke Keele, and Kosuke Imai. ``mediation: R Package for Causal Mediation Analysis.''



mediation is a publicly available R package that allows both parametric and nonparametric causal mediation analysis. It implements the methods and suggestions in Imai, Keele, and Yamamoto (2010) and Imai, Keele, and Tingley (2010). In addition to the estimation of causal mediation effects, the software allows researchers to conduct sensitivity analysis for certain parametric models. See also the Stata version.

  Current Version

The current version is 3.0 (built on 04/29/11) which runs on R 2.7 and higher. The source code and binaries are available for download from The Comprehensive R Archive Network (CRAN)


Regardless of one's operating system, the software can be installed by typing the following command at R prompt:

> install.packages("mediation")

This will install the latest version from CRAN. Please make sure that your R is up to date too.


The complete documentation with many examples is available. The software also comes with standard R help files.

  Mailing List

If you would like to receive the updates about the software and ask questions about it, please subscribe our mailing list available through R forge. The mailing list archive is available here.

© Kosuke Imai
Last modified: Sat Aug 24 23:26:42 EDT 2013