buildModMedSemModel: Builds model for moderated mediation anaysis using SEM

View source: R/buildModMedSemModel.R

buildModMedSemModelR Documentation

Builds model for moderated mediation anaysis using SEM

Description

Builds model for moderated mediation anaysis using SEM

Usage

buildModMedSemModel(
  xvar,
  mvars,
  yvar,
  xmmod = NULL,
  mymod = NULL,
  cmvars = NULL,
  cyvars = NULL
)

Arguments

xvar

independent variable (predictor)

mvars

vector of names of mediators

yvar

dependent variable

xmmod

moderator of a path(s)

mymod

moderator of b path(s)

cmvars

covariates for predicting the mediators

cyvars

covariates for predicting the dependent variable

Value

lavaan model to be used in moderatedMediationSem

Examples

model <-  buildModMedSemModel(xvar="procJustice", mvars= c("cynicism"),
          yvar = "CPB", xmmod = "insecure",mymod = "gender" ,cmvars =c("age"))

rosetta documentation built on March 7, 2023, 7:40 p.m.