View source: R/makeCatEquation.R
makeCatEquation | R Documentation |
Make equation for sem and lm for categorical variables
makeCatEquation( X = NULL, Y = NULL, W = NULL, labels = list(), data, prefix = "b", maxylev = 6, grouplabels = list(), mode = 0 )
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 |
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))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.