Causal Mediation Analysis
Overview
We implement parametric and non parametric mediation analysis. This package performs the methods and suggestions in Imai, Keele and Yamamoto (2010) DOI:10.1214/10-STS321, Imai, Keele and Tingley (2010) DOI:10.1037/a0020761, Imai, Tingley and Yamamoto (2013) DOI:10.1111/j.1467-985X.2012.01032.x, and Imai and Yamamoto (2013) DOI:10.1093/pan/mps040. In addition to the estimation of causal mediation effects, the software also allows researchers to conduct sensitivity analysis for certain parametric models.
Install
Health
NOTECRAN incoming feasibilityr-devel-linux-x86_64-debian-clang, r-devel-linux-x86_64-debian-gcc
Maintainer: ‘Teppei Yamamoto <tyamam@waseda.jp>’
Found the following (possibly) invalid file URI:
URI: dtingley@gov.harvard.edu
From: inst/doc/mediation-old.pdf- NOTE11 OK, 2 NOTE2026-07-23
- ERROR11 OK, 1 NOTE, 1 ERROR2026-07-07
- NOTE11 OK, 2 NOTE2026-06-09
- ERROR11 OK, 1 NOTE, 1 ERROR2026-06-07
- NOTE12 OK, 2 NOTE2026-03-10
Documentation
- Help pages
- 33includes a package overview page
- Examples that run
- 63%12 run in a plain check · 6 never run · 1 hold no code
- Exported functions with examples
- 100%
- Documented parameters
- 99%
- Return-value docs
- 100%
- Help pages citing references
- 76%
Also includes 1 demo script (run with demo())
- mediation PDF
- mediation-old PDF
Downloads
Dependencies
Installing mediation adds 63 packages (35 with compiled code, 67 MB of source tarballs). Heaviest: stringi 11 MB, ggplot2 6.0 MB, data.table 5.7 MB.
Show all 18 packagesHide all 18 packages
Code & Tests
Datasets
People & History
Previously maintained by Dustin Tingley (3.0 to 4.1) and Luke Keele (1.0 to 2.1).
Pick two releases to compare their code metrics.
- RR 4.6.0 released · 2026-04-24
- 4.5.1Latest
- RR 4.5.0 released · 2025-04-11
- RR 4.4.0 released · 2024-04-24
- RR 4.3.0 released · 2023-04-21
- RR 4.2.0 released · 2022-04-22
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- 4.5.02019-10-09 · diff ↗ ·
removed 17 exports
summary.mediate, plot.mediate, summary.mediate.order, plot.mediate.order, summary.mediate.mer, plot.mediate.mer, summary.medsens, plot.medsens, summary.mediations, plot.mediations, summary.mediations.order, plot.mediations.order, summary.multimed, plot.multimed, summary.mediate.design, summary.ivmediate, plot.ivmediateadded 1 export
mediate_tsls - RR 3.6.0 released · 2019-04-26
- 4.4.72019-03-17 · diff ↗
- RR 3.5.0 released · 2018-04-23
- 4.4.62017-07-12 · diff ↗
- RR 3.4.0 released · 2017-04-21
- RR 3.3.0 released · 2016-05-03
- 4.4.52015-07-18 · diff ↗
Show 33 earlier eventsHide 33 earlier events
- RR 3.2.0 released · 2015-04-16
- 4.4.42015-03-03 · diff ↗
- 4.4.32014-11-23 · diff ↗
- 4.4.22014-08-27 · diff ↗
- 4.4.12014-08-13 · diff ↗
- RR 3.1.0 released · 2014-04-10
- 4.42013-12-09 · diff ↗
- 4.3.12013-10-17 · diff ↗
- 4.3
- 4.2.42013-09-26 · diff ↗
- 4.2.3
- 4.2.22013-04-18 · diff ↗
- RR 3.0.0 released · 2013-04-03
- 4.2.1
- 4.22012-12-18 · diff ↗
- 4.1.22012-08-24 · diff ↗
- 4.12012-06-03 · diff ↗
- 4.0.12012-04-20 · diff ↗
- RR 2.15.0 released · 2012-03-30
- 4.02012-03-20 · diff ↗ ·
added 8 exports
multimed, summary.multimed, plot.multimed, mediate.sed, mediate.pd, mediate.ped, mediate.ced, summary.mediate.design - RR 2.14.0 released · 2011-10-31
- 3.1.22011-09-20 · diff ↗
- 3.1.12011-09-19 · diff ↗
- 3.12011-08-21 · diff ↗
- 3.02011-05-03 · diff ↗ ·
added 8 exports
plot.mediate, summary.mediate.order, plot.mediate.order, mediations, summary.mediations, plot.mediations, summary.mediations.order, plot.mediations.order - RR 2.13.0 released · 2011-04-13
- RR 2.12.0 released · 2010-10-15
- RR 2.11.0 released · 2010-04-22
- RR 2.10.0 released · 2009-10-26
- 2.12009-09-18 · diff ↗
- 2.02009-07-18 · diff ↗
- 1.02009-06-14
- RR 2.9.0 released · 2009-04-17
Package metadata
- First published
- 2009-06-14
- Total releases
- 28 / 17 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 2.15.1
- Bundled data
- 67 KB / 6 files
- Download size
- 1.2 MB
Cite
Cite this package
Run in R for the authors' entry:
citation("mediation")The package provides a citation file, so citation() returns the authors' own entry.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-23, which the citation names so these numbers can be found later. More on citing and the projects behind them.