mitun | R Documentation |
This function really does it all. It will generate both a ggplot graph, slopes&intercepts and a summary!
mitun(DV, x.pred, x.mod, sdH = 1, sdM = 0, sdL = -1)
DV |
The dependent variable. |
x.pred |
The predictor variable. |
x.mod |
The moderator variable. |
sdH |
Leave untouched, unless you wish to generate a different SD moderation. |
sdM |
Leave untouched, unless you wish to generate a different SD moderation. |
sdL |
Leave untouched, unless you wish to generate a different SD moderation. |
sdH/M/L |
refer to SD level of the moderator. feel free to explore, but default is best for analsys. |
ggplot
graph.
lm
model summary.
intercepts and slopes
for each level of moderator.
The moderator MUST be numeric. This function works for a simple moderation model.
jtools
or interactions
for more options.
https://cran.r-project.org/web/packages/jtools/jtools.pdf
https://cran.r-project.org/web/packages/interactions/interactions.pdf
mitun(depression,suicide_tendencies,optimism)
# Depression is predicted by suicide tendencies, while optimism levels moderate the relationship between them.
## Not run: mitun(..., sdH=2,sdL=-2)
# In this example, the graph will generate moderation of SD=+2, mean(sdM=0), and SD=-2 in the moderator variable.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.