mediation (for R)

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). The package won the 2015 PolMeth Statistical Software Award. In addition to the estimation of causal mediation effects, the software also allows researchers to conduct sensitivity analysis for certain parametric models.

mediation (for Stata)

Stata program for calculating mediation effects. Written with Raymond Hicks, Princeton. To install type "ssc install mediation" into command window. Requires version 10 or higher.