makeCatEquation: Make equation for sem and lm for categorical variables

View source: R/makeCatEquation.R

makeCatEquationR Documentation

Make equation for sem and lm for categorical variables

Description

Make equation for sem and lm for categorical variables

Usage

makeCatEquation(
  X = NULL,
  Y = NULL,
  W = NULL,
  labels = list(),
  data,
  prefix = "b",
  maxylev = 6,
  grouplabels = list(),
  mode = 0
)

Arguments

X

Name of independent variable

Y

Name of dependent variable

W

Name of moderators

labels

optional list

data

a data.frame

prefix

a character

maxylev

maximal unique length of categorical variable

grouplabels

A list

mode

A numeric

Examples

makeCatEquation(X="wt",Y="mpg",data=mtcars)
makeCatEquation(X="wt",Y="mpg",W="cyl",data=mtcars)
makeCatEquation(X="wt",Y="mpg",W=c("cyl","hp"),data=mtcars)
grouplabels=list(carb="f")
makeCatEquation(X="carb",Y="mpg",W=c("cyl","hp"),data=mtcars,maxylev=6)
makeCatEquation(X="carb",Y="mpg",W=c("cyl","hp"),data=mtcars)
cat(makeCatEquation(X="wt",Y="carb",W=c("am","hp"),data=mtcars,maxylev=6,grouplabels=grouplabels))

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