Learn R Programming

rosetta (version 0.3.12)

gemm: Analyze moderated mediation model using SEM

Description

Analyze moderated mediation model using SEM

Usage

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

Value

gemm object

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

Examples

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

Run the code above in your browser using DataLab