lmediaplots: Function to create diagnostic plots for each grouping element...

Description Usage Arguments Value Examples

Description

Function to create diagnostic plots for the group elements of the random effect part of a nested model.

Usage

1
lmediaplots(lme.obj, plottype = "within")

Arguments

lme.obj

A "lme" object created using package "nlme". Must have a nesting / within component.

plottype

Type of the diagnostic plot to create. Either "within" for box/scatter - plots of within-group residuals, or "resvfit" for a plot of the standardized residuals versus fitted values per group, or "qq" for diagnostic plots for assessing the normality of residuals and random effects in the linear mixed-effects fit per group. Default is "within".

Value

List of plots. One plot for each grouping factor in the model.

Examples

1
2
3
4
5
6
7
# based on example from Pinheiro, Bates (2000) Mixed-Effect Models in S and S-PLUS. Springer.
library(nlme)
fm1Machine <- lme(score ~ Machine, data = Machines, random = ~ 1 | Worker/Machine)
lmediaplots(fm1Machine)
lmediaplots(fm1Machine, plottype = "resvfit")
lmediaplots(fm1Machine, plottype = "qq")
lmediaplots(fm1Machine, plottype = "qq")[1]

MarkusLoew/lmediaplots documentation built on May 7, 2019, 3:35 p.m.