Skip to content

manymome

Mediation, Moderation and Moderated-Mediation After Model Fitting

v0.3.3 · Jan 7, 2026 · GPL (>= 3)

Description

Computes indirect effects, conditional effects, and conditional indirect effects in a structural equation model or path model after model fitting, with no need to define any user parameters or label any paths in the model syntax, using the approach presented in Cheung and Cheung (2024) <doi:10.3758/s13428-023-02224-z>. Can also form bootstrap confidence intervals by doing bootstrapping only once and reusing the bootstrap estimates in all subsequent computations. Supports bootstrap confidence intervals for standardized (partially or completely) indirect effects, conditional effects, and conditional indirect effects as described in Cheung (2009) <doi:10.3758/BRM.41.2.425> and Cheung, Cheung, Lau, Hui, and Vong (2022) <doi:10.1037/hea0001188>. Model fitting can be done by structural equation modeling using lavaan() or regression using lm().

Downloads

663

Last 30 days

5415th

663

Last 90 days

663

Last year

CRAN Check Status

2 ERROR
12 OK
Show all 14 flavors
Flavor Status
r-devel-linux-x86_64-debian-clang OK
r-devel-linux-x86_64-debian-gcc OK
r-devel-linux-x86_64-fedora-clang OK
r-devel-linux-x86_64-fedora-gcc OK
r-devel-macos-arm64 OK
r-devel-windows-x86_64 OK
r-oldrel-macos-arm64 OK
r-oldrel-macos-x86_64 OK
r-oldrel-windows-x86_64 ERROR
r-patched-linux-x86_64 OK
r-release-linux-x86_64 OK
r-release-macos-arm64 OK
r-release-macos-x86_64 OK
r-release-windows-x86_64 ERROR
Check details (15 non-OK)
OK r-devel-linux-x86_64-debian-clang

*


            
OK r-devel-linux-x86_64-debian-gcc

*


            
OK r-devel-linux-x86_64-fedora-clang

*


            
OK r-devel-linux-x86_64-fedora-gcc

*


            
OK r-devel-macos-arm64

*


            
OK r-devel-windows-x86_64

*


            
OK r-oldrel-macos-arm64

*


            
OK r-oldrel-macos-x86_64

*


            
NOTE r-oldrel-windows-x86_64

package dependencies

Packages suggested but not available for checking: 'semPlot', 'semptools'
ERROR r-oldrel-windows-x86_64

tests

  Running 'testthat.R' [233s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(manymome)
  > 
  > test_check("manymome")
  Starting 2 test processes.
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med: 0.230
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.351
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.121
  > test_delta_med_boot.R: Variance of y                             : 6.273
  > test_delta_med_boot.R: Variance of predicted y                   : 2.203
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.759
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med: 0.23021
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.35122
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.12101
  > test_delta_med_boot.R: Variance of y                             : 6.27337
  > test_delta_med_boot.R: Variance of predicted y                   : 2.20333
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.75912
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit, boot_out = boot_out, 
  > test_delta_med_boot.R:     progress = FALSE)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med                                     :          0.230
  > test_delta_med_boot.R: 95.0% Bootstrap percentile confidence interval: [0.088, 0.316]
  > test_delta_med_boot.R: Number of bootstrap samples                   :            100
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.351
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.121
  > test_delta_med_boot.R: Variance of y                             : 6.273
  > test_delta_med_boot.R: Variance of predicted y                   : 2.203
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.759
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit, boot_out = boot_out, 
  > test_delta_med_boot.R:     progress = FALSE)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med                                     :           0.2302
  > test_delta_med_boot.R: 95.0% Bootstrap percentile confidence interval: [0.0882, 0.3159]
  > test_delta_med_boot.R: Number of bootstrap samples                   :              100
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.3512
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.1210
  > test_delta_med_boot.R: Variance of y                             : 6.2734
  > test_delta_med_boot.R: Variance of predicted y                   : 2.2033
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.7591
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit, boot_out = boot_out, 
  > test_delta_med_boot.R:     progress = FALSE)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med                                     :           0.2302
  > test_delta_med_boot.R: 80.0% Bootstrap percentile confidence interval: [0.1438, 0.2933]
  > test_delta_med_boot.R: Number of bootstrap samples                   :              100
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.3512
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.1210
  > test_delta_med_boot.R: Variance of y                             : 6.2734
  > test_delta_med_boot.R: Variance of predicted y                   : 2.2033
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.7591
  > test_skip_ci_min_size_2.R: 
  
  Error:
  ! testthat subprocess exited in file 'test_skip_ci_min_size_2.R'.
  Caused by error:
  ! R session crashed with exit code -1073741819
  Backtrace:
       ▆
    1. └─testthat::test_check("manymome")
    2.   └─testthat::test_dir(...)
    3.     └─testthat:::test_files(...)
    4.       └─testthat:::test_files_parallel(...)
    5.         ├─withr::with_dir(...)
    6.         │ └─base::force(code)
    7.         ├─testthat::with_reporter(...)
    8.         │ └─base::tryCatch(...)
    9.         │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   10.         │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   11.         │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   12.         └─testthat:::parallel_event_loop_chunky(queue, reporters, ".")
   13.           └─queue$poll(Inf)
   14.             └─base::lapply(...)
   15.               └─testthat (local) FUN(X[[i]], ...)
   16.                 └─private$handle_error(msg, i)
   17.                   └─cli::cli_abort(...)
   18.                     └─rlang::abort(...)
  Execution halted
OK r-patched-linux-x86_64

*


            
OK r-release-linux-x86_64

*


            
OK r-release-macos-arm64

*


            
OK r-release-macos-x86_64

*


            
ERROR r-release-windows-x86_64

tests

  Running 'testthat.R' [155s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(manymome)
  > 
  > test_check("manymome")
  Starting 2 test processes.
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med: 0.230
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.351
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.121
  > test_delta_med_boot.R: Variance of y                             : 6.273
  > test_delta_med_boot.R: Variance of predicted y                   : 2.203
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.759
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med: 0.23021
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.35122
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.12101
  > test_delta_med_boot.R: Variance of y                             : 6.27337
  > test_delta_med_boot.R: Variance of predicted y                   : 2.20333
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.75912
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit, boot_out = boot_out, 
  > test_delta_med_boot.R:     progress = FALSE)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med                                     :          0.230
  > test_delta_med_boot.R: 95.0% Bootstrap percentile confidence interval: [0.088, 0.316]
  > test_delta_med_boot.R: Number of bootstrap samples                   :            100
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.351
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.121
  > test_delta_med_boot.R: Variance of y                             : 6.273
  > test_delta_med_boot.R: Variance of predicted y                   : 2.203
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.759
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit, boot_out = boot_out, 
  > test_delta_med_boot.R:     progress = FALSE)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med                                     :           0.2302
  > test_delta_med_boot.R: 95.0% Bootstrap percentile confidence interval: [0.0882, 0.3159]
  > test_delta_med_boot.R: Number of bootstrap samples                   :              100
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.3512
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.1210
  > test_delta_med_boot.R: Variance of y                             : 6.2734
  > test_delta_med_boot.R: Variance of predicted y                   : 2.2033
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.7591
  > test_delta_med_boot.R: Call:
  > test_delta_med_boot.R: delta_med(x = "x", y = "y", m = "m", fit = fit, boot_out = boot_out, 
  > test_delta_med_boot.R:     progress = FALSE)
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Predictor (x)       : x 
  > test_delta_med_boot.R: Mediator(s) (m)     : m 
  > test_delta_med_boot.R: Outcome variable (y): y 
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Delta_med                                     :           0.2302
  > test_delta_med_boot.R: 80.0% Bootstrap percentile confidence interval: [0.1438, 0.2933]
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Number of bootstrap samples                   :              100
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Paths removed:
  > test_delta_med_boot.R:  m~x
  > test_delta_med_boot.R: 
  > test_delta_med_boot.R: Additional information:
  > test_delta_med_boot.R: R-sq: Original                            : 0.3512
  > test_delta_med_boot.R: R-sq: Mediator(s) removed                 : 0.1210
  > test_delta_med_boot.R: Variance of y                             : 6.2734
  > test_delta_med_boot.R: Variance of predicted y                   : 2.2033
  > test_delta_med_boot.R: Variance of predicted: mediator(s) removed: 0.7591
  > test_q_fct_mediation_sem_lm2lav.R: 
  
  Error:
  ! testthat subprocess exited in file
    'test_q_fct_mediation_sem_lm2lav.R'.
  Caused by error:
  ! R session crashed with exit code -1073741819
  Backtrace:
       ▆
    1. └─testthat::test_check("manymome")
    2.   └─testthat::test_dir(...)
    3.     └─testthat:::test_files(...)
    4.       └─testthat:::test_files_parallel(...)
    5.         ├─withr::with_dir(...)
    6.         │ └─base::force(code)
    7.         ├─testthat::with_reporter(...)
    8.         │ └─base::tryCatch(...)
    9.         │   └─base (local) tryCatchList(expr, classes, parentenv, handlers)
   10.         │     └─base (local) tryCatchOne(expr, names, parentenv, handlers[[1L]])
   11.         │       └─base (local) doTryCatch(return(expr), name, parentenv, handler)
   12.         └─testthat:::parallel_event_loop_chunky(queue, reporters, ".")
   13.           └─queue$poll(Inf)
   14.             └─base::lapply(...)
   15.               └─testthat (local) FUN(X[[i]], ...)
   16.                 └─private$handle_error(msg, i)
   17.                   └─cli::cli_abort(...)
   18.                     └─rlang::abort(...)
  Execution halted

Check History

ERROR 12 OK · 0 NOTE · 0 WARNING · 2 ERROR · 0 FAILURE Mar 9, 2026
ERROR r-release-windows-x86_64

tests

  Running 'testthat.R' [155s]
Running the tests in 'tests/testthat.R' failed.
Complete output:
  > library(testthat)
  > library(manymome)
  > 
  > test_check("manymome")
  Starting 2 test processes.
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1: Simulate estimates
  > test_cond_indirect_lavaan.R: Stage 2: Compute implied statistics
  > test_cond_indirect_lavaan.R: Stage 1
ERROR r-oldrel-windows-x86_64

package dependencies

Packages suggested but not available for checking: 'semPlot', 'semptools'

Reverse Dependencies (5)

Dependency Network

Dependencies Reverse dependencies lavaan boot pbapply ggplot2 igraph MASS lmhelprs betaselectr manymome.table modelbpp power4mome stdmod manymome

Version History

new 0.3.3 Mar 9, 2026