Learn R Programming

hamlet (version 0.9.6)

mem.plotran: Plot random effects histograms for a fitted mixed-effects model

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

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)

See Also

mem.getcomp, mem.plotresid

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab