tripleEquation: Make equation with triple interaction

View source: R/tripleInteraction.R

tripleEquationR Documentation

Make equation with triple interaction

Description

Make equation with triple interaction

Usage

tripleEquation(
  X = NULL,
  M = NULL,
  Y = NULL,
  labels = list(),
  vars = NULL,
  suffix = 0,
  moderator = list(),
  covar = NULL,
  range = TRUE,
  mode = 0,
  data = NULL,
  rangemode = 1,
  probs = c(0.16, 0.5, 0.84),
  effectsize = FALSE
)

Arguments

X

Name of independent variable

M

Name of mediator

Y

Name of dependent variable

labels

A list of variables

vars

A list of variables names and sites

suffix

A number

moderator

A list of moderators

covar

A list of covariates

range

A logical

mode

A number

data

A data.frame

rangemode

range mode

probs

numeric vector of probabilities with values in [0,1]

effectsize

logical If true, calculate effectsize

Examples

X="negemot";M="ideology";Y="govact";suffix=0
cat(tripleEquation(X=X,M=M,Y=Y))
vars=list(name=list(c("sex","age")),site=list(c("a","c")))
vars=list(name=list(c("W","Z"),c("V","Q")),site=list(c("a","b","c"),c("a","b","c")))
X="negemot";Y="govact";suffix=0
moderator=list(name=c("W"),site=list(c("b","c")))
cat(tripleEquation(X=X,Y=Y,moderator=moderator))
covar=list(name=c("C1","C2","C3"),site=list(c("M","Y"),c("Mi","Y"),"Y"))
labels=list(X="negemot",M="ideology",Y="govact")
cat(tripleEquation(labels=labels,moderator=moderator,covar=covar))
cat(tripleEquation(X=X,M=M,Y=Y,moderator=moderator,covar=covar,mode=1))
cat(tripleEquation(X=X,M=M,Y=Y,vars=vars))
cat(tripleEquation(X=X,M=M,Y=Y,vars=vars,moderator=moderator,covar=covar))
cat(tripleEquation(X=X,M=M,Y=Y,vars=vars,mode=1))
cat(tripleEquation(X=X,M=M,Y=Y,vars=vars,covar=covar,mode=1))
X="negemot";Y="govact";suffix=0
vars=list(name=list(c("sex","age")),site=list(c("c")))
cat(tripleEquation(X=X,Y=Y,vars=vars))

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