Learn R Programming

rosetta (version 0.3.12)

buildModMedSemModel: 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
)

Value

lavaan model to be used in moderatedMediationSem

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

Examples

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

Run the code above in your browser using DataLab