Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

makeCatEquation

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

Implementation of the 'PROCESS' Macro

v0.2.6
GPL-2
Authors
Keon-Woong Moon [aut, cre], Sokyoung Hong [ctb]
Initial release
2021-1-5

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.