{"id":16178387,"url":"https://github.com/sfcheung/manymome","last_synced_at":"2026-02-22T12:13:42.912Z","repository":{"id":58695489,"uuid":"493078607","full_name":"sfcheung/manymome","owner":"sfcheung","description":"Moderation, mediation, and moderated mediation in structural equation modeling and multiple regression","archived":false,"fork":false,"pushed_at":"2025-02-22T08:46:03.000Z","size":47575,"stargazers_count":1,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-17T01:35:08.980Z","etag":null,"topics":["bootstrapping","confidence-interval","lavaan","manymome","mediation","moderated-mediation","moderation","r","r-package","regression","sem","standardized-effect-size","structural-equation-modeling"],"latest_commit_sha":null,"homepage":"https://sfcheung.github.io/manymome/","language":"R","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sfcheung.png","metadata":{"files":{"readme":"README.md","changelog":"NEWS.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2022-05-17T03:16:51.000Z","updated_at":"2025-02-22T08:39:26.000Z","dependencies_parsed_at":"2024-04-03T13:27:57.868Z","dependency_job_id":"8be4a59e-b5fe-4627-bcba-4ac96b3e3ac4","html_url":"https://github.com/sfcheung/manymome","commit_stats":null,"previous_names":[],"tags_count":12,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfcheung%2Fmanymome","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfcheung%2Fmanymome/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfcheung%2Fmanymome/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sfcheung%2Fmanymome/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sfcheung","download_url":"https://codeload.github.com/sfcheung/manymome/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244336112,"owners_count":20436770,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bootstrapping","confidence-interval","lavaan","manymome","mediation","moderated-mediation","moderation","r","r-package","regression","sem","standardized-effect-size","structural-equation-modeling"],"created_at":"2024-10-10T05:13:39.295Z","updated_at":"2026-02-22T12:13:42.902Z","avatar_url":"https://github.com/sfcheung.png","language":"R","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- badges: start --\u003e\n[![Lifecycle: stable](https://img.shields.io/badge/lifecycle-stable-brightgreen.svg)](https://lifecycle.r-lib.org/articles/stages.html#stable)\n[![Project Status: Active - The project has reached a stable, usable state and is being actively developed.](https://www.repostatus.org/badges/latest/active.svg)](https://www.repostatus.org/#active)\n[![CRAN status](https://www.r-pkg.org/badges/version/manymome?color=blue)](https://CRAN.R-project.org/package=manymome)\n[![CRAN: Release Date](https://www.r-pkg.org/badges/last-release/manymome?color=blue)](https://cran.r-project.org/package=manymome)\n[![CRAN RStudio mirror downloads](https://cranlogs.r-pkg.org/badges/grand-total/manymome?color=blue)](https://r-pkg.org/pkg/manymome)\n[![Code size](https://img.shields.io/github/languages/code-size/sfcheung/manymome.svg)](https://github.com/sfcheung/manymome)\n[![Last Commit at Main](https://img.shields.io/github/last-commit/sfcheung/manymome.svg)](https://github.com/sfcheung/manymome/commits/main)\n[![R-CMD-check](https://github.com/sfcheung/manymome/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/sfcheung/manymome/actions/workflows/R-CMD-check.yaml)\n\u003c!-- badges: end --\u003e\n\n(Version 0.3.3.1, updated on 2026-01-08, [release history](https://sfcheung.github.io/manymome/news/index.html))\n\n# manymome  \u003cimg src=\"man/figures/logo.png\" align=\"right\" height=\"150\" /\u003e\n\nFunctions for estimating indirect effects, conditional indirect\neffects, and conditional effects in a model with\nmoderation, mediation, and/or moderated mediation fitted\nby structural equation modelling (SEM) or estimated\nby multiple regression. The package was introduced in:\n\n- Cheung, S. F., \u0026 Cheung, S.-H. (2024).\n  *manymome*: An R package for computing\n  the indirect effects, conditional\n  effects, and conditional indirect\n  effects, standardized or unstandardized,\n  and their bootstrap confidence intervals,\n  in many (though not all) models.\n  *Behavior Research Methods, 56*(5),\n  4862--4882.\n  https://doi.org/10.3758/s13428-023-02224-z\n\n\n# What Can It Do?\n\n- Compute an unstandardized or *standardized* *indirect* *effect* or\n  *conditional* *indirect* *effect* in a path model.\n\n- Form the *confidence* *interval* for this effect.\n  Nonparametric bootstrapping is fully supported,\n  while Monte Carlo is supported for models\n  fitted by `lavaan::sem()`.\n\n- Multigroup models fitted by `lavaan::sem()`\n  are also supported in 0.1.14.2 and later versions.\n  Details can be found in\n  this [article](https://sfcheung.github.io/manymome/articles/med_mg.html).\n\n# Advantages\n\n- **A Simpler Workflow**\n\n  No need to define any parameters or similar\n  code when\n  fitting a model in `lavaan::sem()`. Just focus on fitting\n  the model first. After a model has\n  been selected, users can compute the effect for nearly any path, from\n  nearly any variable, to nearly any other variables, conditional on\n  nearly any moderators,\n  and at any levels of the moderators.\n  (See `vignette(\"manymome\")` for details.) This is particularly\n  convenient for multigroup models fitted by `lavaan::sem()`,\n  which are supported in 0.1.14.2 and later versions\n  (see [this guide](https://sfcheung.github.io/manymome/articles/med_mg.html),\n  for an illustration).\n\n- **Supports Both SEM-Based and Regression-Based Analysis**\n\n  Supports structural equation models fitted by `lavaan::sem()` or by\n  path models fitted by regression using `lm()`, although the\n  focus of this package is on structural equation models.\n  The interface of the main functions are nearly the same for\n  both approaches.\n\n- **Flexible in the Form of Models**\n\n  No limit on the number of predictors, mediators, and\n  outcome variables, other than those by `lavaan::sem()` and `lm()`.\n  For multigroup models fitted by `lavaan::sem()`,\n  there is no inherent limit on the number of groups,\n  other than the limit due to `lavaan::sem()`, if any\n  (supported in 0.1.14.2 and later versions).\n\n- **Supports Standardized Effects**\n\n  Can estimate standardized indirect effects and standardized\n  conditional indirect effects without the need to standardize\n  the variables. The bootstrap and Monte Carlo\n  confidence intervals for standardized\n  effects correctly take into account the sampling variation\n  of the standardizers (the standard deviations of the predictor\n  and the outcome variable) by recomputing them in each bootstrap\n  sample or replication.\n\n- **Supports Missing Data**\n\n  Supports datasets with missing data\n  through `lavaan::sem()` with full information maximum likelihood (`fiml`).\n\n  In version 0.2.7.3 or later, it also supports missing data handled\n  by multiple imputation if the models are fitted by `lavaan.mi::sem.mi()`\n  or `lavaan.mi::lavaan.mi()` (see `vignette(\"do_mc_lavaan_mi\")`).\n  (Support for `semTools::runMI()` and its wrappers was removed in\n  version 0.2.7.3 because this and related functions were deprecated\n  in `semTools`.)\n\n- **Supports Numeric and Categorical Moderators**\n\n  Supports numeric and\n  categorical moderators. It has a function (`factor2var()`) for the easy\n  creation of dummy variables in `lavaan::sem()`, and can also capitalize on\n  the native support of categorical moderators in `lm()`.\n\n- **Less Time for Bootstrapping**\n\n  Bootstrapping, which can be time consuming, can\n  be conducted just once. The main functions for computing indirect effects\n  and conditional indirect effects can be called as many times as needed without redoing\n  bootstrapping because they can reuse pregenerated bootstrap\n  estimates (see `vignette(\"manymome\")` and `vignette(\"do_boot\")`).\n\n- **Supports Latent Variables Mediation**\n\n  Supports indirect effects among\n  latent variables for models fitted by `lavaan::sem()` (see\n  `vignette(\"med_lav\")`).\n\n- **Support Treating Group As a Moderator**\n\n  For multigroup models fitted by `lavaan::sem()`, it supports\n  comparing the direct or indirect effects along any path\n  between any two groups. That is, it uses the grouping variable\n  as a moderator (illustrated [here](https://sfcheung.github.io/manymome/articles/med_mg.html);\n  supported in 0.1.14.2 and later versions).\n\n# Limitations\n\nDespite the aforementioned advantages, the current version of\n`manymome` has the following limitations:\n\n- Does not (officially) support\n  categorical `x`-variables with more\n  than two categories. Note that most\n  functions will work with dichotomous\n  `x`-variables, and the effect of `x`\n  is simply the difference in predicted\n  `y` between the two levels if coded as\n  0 and 1 (or any coding with a\n  difference of 1, e.g., 1 and 2).\n\n- Does not support multilevel models (although `lavaan` does).\n\n- For bootstrapping, only supports nonparametric bootstrapping,\nand supports only percentile and bias-corrected\nconfidence interval. Does not support other bootstrapping methods such parametric bootstrapping.\n\n- Only supports OLS estimation when `lm()` is used.\n\nWe would add more to this list (suggestions are welcomed by\nadding [GitHub issues](#issues)) so that users (and we) know when\nother tools should be used instead of `manymome`, or whether\nwe can address these limitations in `manymome` in the future.\n\n# How To Use It?\n\nA good starting point is the Get-Started article (`vignette(\"manymome\")`).\n\nThere are also [articles](https://sfcheung.github.io/manymome/articles/index.html) (vignettes) on\nspecial topics, such as how to use `mod_levels()` to set\nthe levels of the moderators. More will be added.\n\n# Homepage\n\nFor more information on this package, please visit its GitHub page:\n\nhttps://sfcheung.github.io/manymome/\n\n# Installation\n\nThe stable version at CRAN can be installed by `install.packages()`:\n\n```r\ninstall.packages(\"manymome\")\n```\n\nThe latest developmental-but-stable version at GitHub can be installed by `remotes::install_github()`:\n\n```r\nremotes::install_github(\"sfcheung/manymome\")\n```\n\n# Background\n\nWe developed the package [`stdmod`](https://sfcheung.github.io/stdmod/)\nin 2021 for moderated regression. We included a function\n(`stdmod::stdmod_lavaan()`)\nfor standardized moderation effect in path models fitted\nby `lavaan::sem()`. However, in practice, path models nearly\nalways included indirect effects and so moderated mediation\nis common in path models. Moreover, `stdmod` is intended for\nmoderated regression, not for structural equation modeling. We\nthought perhaps we could develop a more general tool for\nmodels fitted by structural equation modelling based on\nthe interface we used in `stdmod::stdmod_lavaan()`. In our own\nprojects, we also need to estimate indirect effects in models\nfrequently. Large sample sizes with missing data are also\ncommon to us, for which bootstrapping is slow even with parallel\nprocessing. Therefore, we developed `manymome` to address these\nneeds.\n\n# Issues\n\nIf you have any suggestions and found any bugs or limitations, please feel\nfeel to open a GitHub issue. Thanks.\n\nhttps://github.com/sfcheung/manymome/issues\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfcheung%2Fmanymome","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsfcheung%2Fmanymome","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsfcheung%2Fmanymome/lists"}