makeCatEquation3: Make equation for sem and lm for multiple X or multiple Y

View source: R/makeCatEquation.R

makeCatEquation3R Documentation

Make equation for sem and lm for multiple X or multiple Y

Description

Make equation for sem and lm for multiple X or multiple Y

Usage

makeCatEquation3(
  X = NULL,
  Y = NULL,
  W = NULL,
  labels = list(),
  prefix = "b",
  mode = 0,
  pos = list(),
  bmatrix = NULL,
  vars = list(),
  moderator = list(),
  depy = FALSE,
  depx = FALSE,
  interactionNo = 0
)

Arguments

X

Names of independent variable

Y

Names of dependent variable

W

Names of moderators

labels

optional list

prefix

a character

mode

A numeric

pos

Numeric moderator position

bmatrix

integer specifying causal relations among mediators

vars

A list of triple moderator

moderator

A list

depy

logical

depx

logical

interactionNo

numeric

Examples

cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,0,1,0,0,1,1,1,1)))
cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,0,1,0,1,1,1,1,1)))
cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,0,1,1,0,1,1,1,1)))
cat(makeCatEquation3(X="X",Y=c("M1","M2","M3"),prefix="a",bmatrix=c(1,1,1,1,1,1,1,1,1,1)))
cat(makeCatEquation3(X=c("M1","M2","M3"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,1,1,1,1,1),depy=TRUE))
cat(makeCatEquation3(X="X",Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,1,1,1,1,1),depy=TRUE,depx=TRUE))
cat(makeCatEquation3(X="X",Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,1,0,1,1,1),depy=TRUE,depx=TRUE))
cat(makeCatEquation3(X=c("M1","M2"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,0,1),depy=TRUE))
cat(makeCatEquation3(X=c("M1","M2"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,1,0),depy=TRUE))
cat(makeCatEquation3(X="X",Y=c("M1","M2"),prefix="a",bmatrix=c(1,1,1,0,0,1),depy=FALSE))
cat(makeCatEquation3(X="X",Y=c("M1","M2"),W="W",prefix="a",bmatrix=c(1,1,1,1,1,1),depy=FALSE,
  moderator=list(name="W",matrix=list(c(0,0,1,0,0,0)))))
cat(makeCatEquation3(X=c("M1","M2"),Y="Y",prefix="a",bmatrix=c(1,1,1,1,0,1),depy=TRUE))
cat(makeCatEquation3(X=c("M1","M2"),Y="Y",W="W",pos=list(c(1,2)),prefix="a",
  bmatrix=c(1,1,1,1,0,1),depy=TRUE))
cat(makeCatEquation3(X=c("M1","M2"),Y="Y",W="W",
  moderator=list(name="W",matrix=list(c(0,0,0,0,1,1))),bmatrix=c(1,1,1,1,1,1),depy=TRUE))
vars=list(name=list(c("W","Z")),matrix=list(c(0,0,1,0,0,0)))
cat(makeCatEquation3(X="X",Y=c("M1","M2"),bmatrix=c(1,1,1,1,1,0),vars=vars,depy=FALSE,depx=TRUE))

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