powered by
Builds model for moderated mediation anaysis using SEM
buildModMedSemModel( xvar, mvars, yvar, xmmod = NULL, mymod = NULL, cmvars = NULL, cyvars = NULL )
lavaan model to be used in moderatedMediationSem
independent variable (predictor)
vector of names of mediators
dependent variable
moderator of a path(s)
moderator of b path(s)
covariates for predicting the mediators
covariates for predicting the dependent variable
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