Package: modsem 1.0.21

modsem: Latent Interaction (and Moderation) Analysis in Structural Equation Models (SEM)

Estimation of interaction (i.e., moderation) effects between latent variables in structural equation models (SEM). The supported methods are: The constrained approach (Algina & Moulder, 2001). The unconstrained approach (Marsh et al., 2004). The residual centering approach (Little et al., 2006). The double centering approach (Lin et al., 2010). The latent moderated structural equations (LMS) approach (Klein & Moosbrugger, 2000). The quasi-maximum likelihood (QML) approach (Klein & Muthén, 2007) The constrained- unconstrained, residual- and double centering- approaches are estimated via 'lavaan' (Rosseel, 2012), whilst the LMS- and QML- approaches are estimated via 'modsem' it self. Alternatively model can be estimated via 'Mplus' (Muthén & Muthén, 1998-2017). References: Algina, J., & Moulder, B. C. (2001). <doi:10.1207/S15328007SEM0801_3>. "A note on estimating the Jöreskog-Yang model for latent variable interaction using 'LISREL' 8.3." Klein, A., & Moosbrugger, H. (2000). <doi:10.1007/BF02296338>. "Maximum likelihood estimation of latent interaction effects with the LMS method." Klein, A. G., & Muthén, B. O. (2007). <doi:10.1080/00273170701710205>. "Quasi-maximum likelihood estimation of structural equation models with multiple interaction and quadratic effects." Lin, G. C., Wen, Z., Marsh, H. W., & Lin, H. S. (2010). <doi:10.1080/10705511.2010.488999>. "Structural equation models of latent interactions: Clarification of orthogonalizing and double-mean-centering strategies." Little, T. D., Bovaird, J. A., & Widaman, K. F. (2006). <doi:10.1207/s15328007sem1304_1>. "On the merits of orthogonalizing powered and product terms: Implications for modeling interactions among latent variables." Marsh, H. W., Wen, Z., & Hau, K. T. (2004). <doi:10.1037/1082-989X.9.3.275>. "Structural equation models of latent interactions: evaluation of alternative estimation strategies and indicator construction." Muthén, L.K. and Muthén, B.O. (1998-2017). "'Mplus' User’s Guide. Eighth Edition." <https://www.statmodel.com/>. Rosseel Y (2012). <doi:10.18637/jss.v048.i02>. "'lavaan': An R Package for Structural Equation Modeling."

Authors:Kjell Solem Slupphaug [aut, cre], Mehmet Mehmetoglu [ctb], Matthias Mittner [ctb]

modsem_1.0.21.tar.gz
modsem_1.0.21.zip(r-4.7)modsem_1.0.21.zip(r-4.6)modsem_1.0.21.zip(r-4.5)
modsem_1.0.21.tgz(r-4.6-x86_64)modsem_1.0.21.tgz(r-4.6-arm64)modsem_1.0.21.tgz(r-4.5-x86_64)modsem_1.0.21.tgz(r-4.5-arm64)
modsem_1.0.21.tar.gz(r-4.7-arm64)modsem_1.0.21.tar.gz(r-4.7-x86_64)modsem_1.0.21.tar.gz(r-4.6-arm64)modsem_1.0.21.tar.gz(r-4.6-x86_64)
modsem_1.0.21.tgz(r-4.6-emscripten)
manual.pdf |manual.html
card.svg |card.png
modsem/json (API)

# Install 'modsem' in R:
install.packages('modsem', repos = c('https://kss2k.r-universe.dev', 'https://cloud.r-project.org'))

Bug tracker:https://github.com/kss2k/modsem/issues

Pkgdown/docs site:https://modsem.org

Uses libs:
  • openblas– Optimized BLAS
  • c++– GNU Standard C++ Library v3
  • openmp– GCC OpenMP (GOMP) support library
Datasets:

On CRAN:

Conda:

interaction-effectinteraction-effectslatent-moderated-structural-equationslavaan-syntaxlmsmoderationqmlquasi-maximum-likelihoodrlangrlanguagesemstructural-equation-modelingstructural-equation-modelsopenblascppopenmp

10.08 score 9 stars 1 packages 159 scripts 1.3k downloads 36 exports 81 dependencies

Last updated from:6a1ed1bae3. Checks:13 OK. Indexed: yes.

TargetResultTimeFilesSyslog
linux-devel-arm64OK320
linux-devel-x86_64OK264
source / vignettesOK405
linux-release-arm64OK249
linux-release-x86_64OK260
macos-release-arm64OK188
macos-release-x86_64OK596
macos-oldrel-arm64OK181
macos-oldrel-x86_64OK330
windows-develOK345
windows-releaseOK284
windows-oldrelOK276
wasm-releaseOK199

Exports:bootstrap_modsemcentered_estimatescolorize_outputcompare_fitdefault_settings_dadefault_settings_piestimate_h0extract_lavaanfit_modsem_daget_pi_dataget_pi_syntaxis_interaction_modelmodsemmodsem_coefmodsem_damodsem_inspectmodsem_mimputemodsem_mplusmodsem_nobsmodsem_pimodsem_predictmodsem_vcovmodsemifyparameter_estimatesplot_interactionplot_jnplot_surfacerelcorr_single_itemset_modsem_colorssimple_slopesstandardize_modelstandardized_estimatessummarize_partabletrace_pathtwostepvar_interactions

Dependencies:Ameliaaskpassbase64encBHbslibcachemclicpp11crosstalkcurldata.tableDerivdigestdplyrevaluatefarverfastGHQuadfastmapfontawesomeforeignfsgenericsggplot2gluegtablehighrhtmltoolshtmlwidgetshttrisobandjquerylibjsonliteknitrlabelinglaterlatticelavaanlazyevallifecyclemagrittrMASSmemoisemimemnormtmvnfastmvtnormnlmenumDerivopensslotelpbivnormpillarpkgconfigplotlypromisespurrrquadprogR6rappdirsRColorBrewerRcppRcppArmadilloRhpcBLASctlrlangrmarkdownS7sassscalesstringistringrsystibbletidyrtidyselecttinytexutf8vctrsviridisLitewithrxfunyaml

composite constructs

Rendered fromcomposites.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-05-15
Started: 2026-05-14

customizing interaction terms

Rendered fromcustomizing.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2024-05-31

customizing the output from plot_interaction()

Rendered fromcustomize_plot_interactions.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-11-07
Started: 2025-11-07

estimation alternatives using the LMS approach

Rendered fromestimation_lms.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2025-06-06

fit measures for LMS and QML

Rendered fromfit_measures_da.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2025-04-25

higher order interactions

Rendered fromhigher_order_interactions.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-09-11
Started: 2024-11-03

interaction effects between endogenous variables

Rendered frominteraction_two_etas.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2024-06-04

interactions with ordered data

Rendered frommc-lms-ord.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-05-20
Started: 2026-05-20

LMS and QML approaches

Rendered fromlms_qml.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-11-07
Started: 2024-05-31

methods

Rendered frommethods.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2024-05-31

missing data in the LMS and QML approaches

Rendered frommissing_lms_qml.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-08-12
Started: 2025-08-10

modsem

Rendered frommodsem.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2024-05-31

non-centered interaction terms (LMS and QML)

Rendered frommeanstructure_lms_qml.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2025-06-21

observed variables in the LMS- and QML approach

Rendered fromobserved_lms_qml.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2026-01-18
Started: 2024-06-22

plotting interaction effects

Rendered fromplot_interactions.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-09-12
Started: 2024-06-01

quadratic effects

Rendered fromquadratic.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-08-10
Started: 2024-05-31

reliability-corrected single items

Rendered fromrelcorr_items.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2025-06-16

simple slopes analysis

Rendered fromsimple_slopes.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2025-01-07

using lavaan functions

Rendered fromlavaan.Rmdusingknitr::rmarkdownon Jun 12 2026.

Last update: 2025-07-25
Started: 2024-05-31

Readme and manuals

Help Manual

Help pageTopics
Bootstrap a modsem Modelbootstrap_modsem bootstrap_modsem.function bootstrap_modsem.modsem_da bootstrap_modsem.modsem_pi
Get Centered Interaction Term Estimatescentered_estimates centered_estimates.lavaan centered_estimates.modsem_da
Capture, colorise, and emit console textcolorize_output
compare model fit for 'modsem' modelscompare_fit
default arguments fro LMS and QML approachdefault_settings_da
default arguments for product indicator approachesdefault_settings_pi
Estimate baseline model for 'modsem' modelsestimate_h0 estimate_h0.modsem_da estimate_h0.modsem_pi
extract lavaan object from modsem object estimated using product indicatorsextract_lavaan
Fit measures for QML and LMS modelsfit_modsem_da
Get data with product indicators for different approachesget_pi_data
Get 'lavaan' syntax for product indicator approachesget_pi_syntax
Check if model object has interaction termsis_interaction_model
Jordan subset of PISA 2006 datajordan
Estimate interaction effects in structural equation models (SEMs)modsem
Wrapper for coefmodsem_coef
Interaction between latent variables using LMS and QML approachesmodsem_da
Inspect model informationmodsem_inspect modsem_inspect.lavaan modsem_inspect.modsem_da modsem_inspect.modsem_pi
Estimate a 'modsem' model using multiple imputationmodsem_mimpute
Estimation latent interactions through 'Mplus'modsem_mplus
Wrapper for nobsmodsem_nobs
Interaction between latent variables using product indicatorsmodsem_pi
Predict From 'modsem' Modelsmodsem_predict modsem_predict.modsem_da modsem_predict.modsem_pi
Wrapper for vcovmodsem_vcov
Generate parameter table for 'lavaan' syntaxmodsemify
oneIntoneInt
Extract parameterEstimates from an estimated modelparameter_estimates parameter_estimates.lavaan parameter_estimates.modsem_da parameter_estimates.modsem_mplus parameter_estimates.modsem_pi
Plot Interaction Effects in a SEM Modelplot_interaction
Plot Interaction Effect Using the Johnson-Neyman Techniqueplot_jn
Plot Surface for Interaction Effectsplot_surface
Reliability‑Corrected Single‑Item SEMrelcorr_single_item
Define or disable the color theme used by 'modsem'set_modsem_colors
Get the simple slopes of a SEM modelsimple_slopes
Standardize a fitted 'modsem_da' modelstandardize_model
Get Standardized Estimatesstandardized_estimates standardized_estimates.lavaan standardized_estimates.modsem_da standardized_estimates.modsem_mplus standardized_estimates.modsem_pi
Summarize a parameter table from a 'modsem' model.summarize_partable
summary for modsem objectssummary.modsem_da summary.modsem_mplus summary.modsem_pi
TPBTPB
TPB_1SOTPB_1SO
TPB_2SOTPB_2SO
TPB_UKTPB_UK
Estimate formulas for (co-)variance paths using Wright's path tracing rulestrace_path
Estimate interaction effects in structural equation models (SEMs) using a twostep proceduretwostep
Extract or modify parTable from an estimated model with estimated variances of interaction termsvar_interactions