ggcaterpillar: Caterpillar plot

View source: R/ggplots.R

ggcaterpillarR Documentation

Caterpillar plot

Description

Caterpillar plots for random effects models using ggplot.

Usage

ggcaterpillar(re, qq = TRUE, likeDotplot = TRUE)

Arguments

re

random effects from lmer object

qq

if TRUE, returns normal q/q plot; else returns caterpillar dotplot

likeDotplot

if TRUE, uses different scales for random effects, i.e., facet_wrap

Details

Behaves like qqmath and dotplot from the lattice package; also handles models with multiple correlated random effects

Examples


library('lme4')
fit <- lmer(Reaction ~ Days + (Days | Subject), data = sleepstudy)

ggcaterpillar(ranef(fit, condVar = TRUE))

## compare (requires lattice package)
lattice::qqmath(ranef(fit, condVar = TRUE))


raredd/plotr documentation built on Nov. 19, 2023, 4:09 a.m.