modmedEquation: Make moderated mediation equation

View source: R/modmedEquation.R

modmedEquationR Documentation

Make moderated mediation equation

Description

Make moderated mediation equation

Usage

modmedEquation(
  X = "",
  M = NULL,
  Y = "",
  moderator = list(),
  labels = NULL,
  range = FALSE,
  covar = list()
)

Arguments

X

A character vectors indicating independent variables

M

A character vectors indicating mediators

Y

A character vectors indicating dependent variables

moderator

moderator

labels

labels

range

Whether or not add range equation

covar

Optional list of covariates

Examples

X="X";Y="Y"
moderator=list(name=c("Z"),site=list(c("a","c")))
cat(modmedEquation(X=X,Y=Y,moderator=moderator,range=TRUE))
X="X";M="M";Y="Y"
cat(modmedEquation(X=X,M=M,Y=Y,range=TRUE))
X="X";M="M";Y="Y"
moderator=list(name=c("Z"),site=list(c("a","c")))
cat(modmedEquation(X=X,M=M,Y=Y,moderator=moderator,range=TRUE))
X="X";M="M";Y="Y";labels=NULL;range=FALSE
moderator=list(name=c("X"),site=list(c("b")))
cat(modmedEquation(X=X,M=M,Y=Y,moderator=moderator,range=FALSE))
X="X";Y="Y"
moderator=list(name=c("Z"),site=list(c("c")))
cat(modmedEquation(X=X,Y=Y,moderator=moderator,range=FALSE))
covar=list(name=c("C1","C2","C3"),label=c("ese","sex","tenure"),site=list(c("M","Y"),"Y","Y"))
cat(modmedEquation(X=X,M="M",Y=Y,moderator=moderator,range=FALSE,covar=covar))

processR documentation built on Jan. 23, 2023, 5:44 p.m.