Analyze moderated mediation model using SEM

gemm(
  data = NULL,
  xvar,
  mvars,
  yvar,
  xmmod = NULL,
  mymod = NULL,
  cmvars = NULL,
  cyvars = NULL,
  estMethod = "bootstrap",
  nboot = 1000
)

Arguments

data

data frame

xvar

predictor variable, must be either numerical or dichotomous

mvars

vector of names of mediator variables

yvar

dependent variable, must be numerical

xmmod

moderator of effect predictor on mediators, must be either numerical or dichotomous

mymod

moderator of effect mediators on dependent variable, must be either numerical or dichotomous

cmvars

covariates for mediators

cyvars

covariates for dependent variable

estMethod

estimation of standard errors method, bootstrap is default

nboot

number of bootstrap samples

Value

gemm object

Examples

if (FALSE) {
data("cpbExample")
       res <- gemm(dat = cpbExample, xvar="procJustice", mvars= c("cynicism","trust"),
       yvar = "CPB", nboot=500)
print(res)
}