Description Usage Arguments Details Examples
This function creates the formulas for lm()
to run the
regression models necessary for data screening and mediation
or moderation models.
1 | createformula(y, x, m, m2 = NULL, mod = NULL, cvs = NULL, type)
|
y |
The dependent variable column name from your dataframe. |
x |
The independent variable column name from your dataframe. This column will be treated as X in mediation or moderation models, please see diagrams online for examples. |
m |
The first mediator or moderator for your model. |
m2 |
The second mediator or moderator for your model. |
mod |
A moderator for a moderated mediation model. |
cvs |
The covariates you would like to include in the model. Use a 'c()' concatenated vector to use multiple covariates. |
The output currently includes a list of equations used for simple mediation, which will updated as moderation is added to the package.
1 2 | createformula(y = "cyl", x = "mpg", m = "disp",
cvs = c("drat", "gear"), type = "moderation1")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.