Simple Mediation and Moderation Analysis
Overview
This toolbox allows you to do simple mediation and moderation analysis. Models are estimated with the 'lavaan' package by Rosseel (2012) doi:10.18637/jss.v048.i02; standard errors for the mediation estimates are computed with the delta method following Sobel (1982) doi:10.2307/270723 or by bootstrapping. It is also available as a module for 'jamovi' (see https://www.jamovi.org for more information). You can find an in depth tutorial on the 'lavaan' model syntax used for this package on https://lavaan.ugent.be/tutorial/index.html.
New features
- Both analyses can now display a path diagram of the fitted model, with optional path labels, coefficient estimates and significance stars. The moderation diagram optionally draws the moderator's main-effect path.
- The moderation estimates table can now display coefficient labels matching the simple slope parametrisation.
- Model estimates are cached, so changing display options no longer refits the model (particularly noticeable with bootstrap standard errors).
- Added two example datasets to jamovi's data library, one for mediation and one for moderation.
Bug fixes
- Results now correctly refresh when the confidence level or the number of bootstrap samples changes.
Show all changes in 1.2.0Hide the rest of the changes in 1.2.0
- The percent mediation column now uses the same estimates as the other columns (no change in results for these models, where the two coincide).
- Replaced deprecated ggplot2 idioms (
aes_string(),sizefor line widths). - Analyses now give an informative error when an expected model term is missing from the estimates.
From NEWS.md in the release
Install
Health
- OK13 OK2026-08-05
- NOTE12 OK, 1 NOTE2026-08-01
- OK7 OK2026-07-17
Documentation
- Help pages
- 9 (6 internal)includes a package overview page
- Examples that run
- 100%2 run in a plain check
- Exported functions with examples
- 100%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 0%
Downloads
Repository
- PRs merged (all time)
- 100%
- Median days to close, 50 most recently updated closed issues
- 633
- Median days to close, 50 most recently updated closed PRs
- 1
Forks over time
7 development-tooling and community-health practices detected across 4 families in the upstream repository
Checks run against github.com/raviselker/medmod on 2026-10-25.
The R CMD check workflow runs on Linux, macOS and Windows, and on R-devel
This repository shows signs of AI coding tools.
- Claude Codefirst seen 2026-07-08Seen in the repository: CLAUDE.mdNamed in .Rbuildignore: CLAUDE.mdPull request it wrote: opened by a project member
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- unarchivedReturned to CRAN2026-07-16
- 1.2.0Latest
- RR 4.6.0 released · 2026-04-24
- 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
- archivedRemoved from CRAN2022-04-06check issues were not corrected in time
- RR 4.1.0 released · 2021-05-18
- RR 4.0.0 released · 2020-04-24
- RR 3.6.0 released · 2019-04-26
- RR 3.5.0 released · 2018-04-23
- 1.0.02017-09-12
- RR 3.4.0 released · 2017-04-21
Package metadata
- First published
- 2017-09-12
- Total releases
- 2 / 9 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 3.2
- Download size
- 18 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("medmod")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-26, which the citation names so these numbers can be found later. More on citing and the projects behind them.