caterpillarPlot {mlmtools}R Documentation

Caterpillar Plot

Description

Plots empirical Bayes both point prediction and prediction intervals for each random effect parameter across all groups.

Usage

caterpillarPlot(
  model,
  grouping,
  title = print(grouping),
  tall = TRUE,
  grey = FALSE
)

Arguments

model

A given lmer model.

grouping

The name of the grouping variable of interest, as a character string.

title

The title of the plot.

tall

Logical argument specifying whether the plot should be plotted vertically or horizontally.

grey

Logical argument specifying whether the intervals should be plotted in color or greyscale.

Value

Produces a caterpillar plot.

References

Rabe-Hesketh S, Skrondal A (2012). Multilevel and Longitudinal Modeling Using Stata, Volumes I and II, Third Edition. 3 edition edition. Stata Press. ISBN 978-1-59718-108-2.

Examples

# Read in data
data(instruction)
# Create model
mod <- lme4::lmer(mathgain ~ (1 | classid), data = instruction)
# Produce caterpillar plot
caterpillarPlot(mod, title = "title", grouping = "classid", grey = TRUE)


[Package mlmtools version 1.0.2 Index]