draw.med | R Documentation |
This function returns the code to create a simple mediation triangle,
as well as the basic diagram using the diagram
library.
draw.med(model1, model2, model3, y, x, m, df)
model1 |
The saved regression model of |
model2 |
The saved regression model of |
model3 |
The saved regression model of |
y |
The dependent variable from your mediation. |
x |
The x variable from your mediation. |
m |
The mediator from your mediation. |
df |
The dataframe containing the y, x, m columns. |
draw.med(saved$model1, saved$model2, saved$model3)
Note in this example saved is the name of the model saved from mediation1.
You can include any form of model names that you have saved from \code{lm()}.
You can also type \code{draw.med} in your console to get this code and edit
the diagram parameters to your liking.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.