RobustMediate: Causal Mediation Analysis with Diagnostics and Sensitivity Analysis

Provides tools for causal mediation analysis with continuous treatments. Estimates natural direct and indirect effects by g-computation over a user-defined treatment grid, with bootstrap intervals that can resample whole clusters, and supports nonlinear dose-response through spline terms in the model formulas. Includes balance diagnostics based on standardized mean differences and stabilized inverse probability weights. Provides sensitivity analysis for confounding of the mediator-outcome relationship using the error correlation parameter of Imai, Keele, and Yamamoto (2010) <doi:10.1214/10-STS321>, and path-wise and indirect-effect robustness values in the partial R-squared metric of Cinelli and Hazlett (2020) <doi:10.1111/rssb.12348>, for both joint-significance and Sobel tests of the indirect effect. Additional utilities include visualization of dose-response mediation functions and formatted outputs for applied research.

Version: 0.3.0
Depends: R (≥ 4.1.0)
Imports: cli, ggplot2 (≥ 3.4.0), rlang, scales, stats, broom
Suggests: covr, dplyr, knitr, lme4, pkgdown, rmarkdown, splines, testthat (≥ 3.0.0), tidyr
Published: 2026-10-27
DOI: 10.32614/CRAN.package.RobustMediate
Author: Subir Hait ORCID iD [aut, cre]
Maintainer: Subir Hait <haitsubi at msu.edu>
BugReports: https://github.com/subirhait/RobustMediate/issues
License: MIT + file LICENSE
URL: https://github.com/subirhait/RobustMediate
NeedsCompilation: no
Materials: README, NEWS
CRAN checks: RobustMediate results

Documentation:

Reference manual: RobustMediate.html , RobustMediate.pdf
Vignettes: Getting Started with RobustMediate (source, R code)

Downloads:

Package source: RobustMediate_0.3.0.tar.gz
Windows binaries: r-devel: RobustMediate_0.1.1.zip, r-release: RobustMediate_0.1.1.zip, r-oldrel: RobustMediate_0.1.1.zip
macOS binaries: r-release (arm64): RobustMediate_0.1.1.tgz, r-oldrel (arm64): RobustMediate_0.3.0.tgz, r-release (x86_64): RobustMediate_0.3.0.tgz, r-oldrel (x86_64): RobustMediate_0.3.0.tgz
Old sources: RobustMediate archive

Linking:

Please use the canonical form https://CRAN.R-project.org/package=RobustMediate to link to this page.