random_plot | R Documentation |
Takes object produced by lme4::lmer() function, extracts random effects and interactions, and returns ggplot2-based plots to examine.
random_plot(lmer.fit, optional.names = NA, facets = FALSE, print = T)
lmer.fit |
A mer object |
optional.names |
A named vector of random effects, where names indicate terms and values are used as axis x labels in correspomding plot. The length should be equal to a number of random effects. Usually it includes "(Intercepts)" and names of variables whose effects are made random. |
facets |
Logical. Should the random effects be plotted in facets or as a series of single plots? |
print |
If the plots should be actually printed, valid only if facets = F |
scatter |
Logical. Should the scatterplots of the cross-level interactions be plotted? If TRUE, 'facets' argument corresponds to scatterplots. This option is under development... |
Returns one or several ggplots. In case one plot is returned it can be appended with 'theme', 'geom_', etc.
random_plot(lmr, optional.names=c(`(Intercepts)`="Intercepts", gndr="Female", s.Age = "Effects of age"), facets=TRUE)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.