Plot random effects histograms for a fitted mixed-effects model

Share:

Description

This plot creates histogram plots for the columns extracted from random effects from a model fit. This is useful for model diagnostics, such as observing deviations from normality in the random effects.

Usage

1
mem.plotran(fit, breaks = 100)

Arguments

fit

A fitted mixed-effects model generated either through the lme4 or the nlme package.

breaks

Number of breaks in the histograms (passed to the 'hist'-function)

Author(s)

Teemu Daniel Laajala <teelaa@utu.fi>

See Also

mem.getcomp, mem.plotresid

Examples

1
2
3
4
5
6
7
8
9
data(vcaplong)

exdat <- vcaplong[vcaplong[,"Group"] %in% c("Vehicle", "ARN"),]

library(lme4)
f1 <- lmer(log2PSA ~ 1 + DrugWeek + DrugWeek:ARN + (1 + DrugWeek|ID), data = exdat)

ranef(f1) # Histograms are plotted for these columns
mem.plotran(f1)

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.