random_interaction | R Documentation |
Takes an object produced by lme4::lmer() function, and returns interaction plot(s).
random_interaction(
x,
real = TRUE,
z.levels = c("1SD", "2SD", "1.2SD", "all"),
scatter = FALSE,
labs = NULL,
x.levels = NULL,
silent = T,
...
)
x |
A mer object produced by |
real |
Logical. Whether real groups should be used to predict random effects, or extrapolate using means and standard deviations? |
z.levels |
String, indicating what levels of moderating group-level variable should be computed. Can take (only) the following values:
|
scatter |
Logical. Should scatterplot be created in addition? |
labs |
List of arguments passed to |
x.levels |
desired x-axis coordinates, individual-level term. If NULL (default) are defined automatically. |
... |
Arguments passed to |
It somehow repeats functionality of 'sjPlot::sjp.int', but differs in being able to select real groups close to +/- 1 sd and mean of moderating variable; makes prettier and customizable plots.
Returns one or several ggplots. In case one plot is returned it can be appended with +theme()
, +geom_()
, etc.
random_plot lmer_table
data("Orthodont",package="nlme")
m1 = lmer(distance ~ age*Sex + (age|Subject), data=Orthodont)
random_interaction2(m1)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.