mediation: R Package for Causal Mediation Analysis

Abstract

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.

Download Updated Paper

Download Published Paper

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)

Installation

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.

Documentation

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.