plot.modelDiagnostics.merMod {multilevelTools} | R Documentation |
Plot Diagnostics for an lmer model
Description
This function creates a number of diagnostic plots from lmer models.
Usage
## S3 method for class 'modelDiagnostics.merMod'
plot(x, y, plot = TRUE, ask = TRUE, ncol = 1, nrow = 1, ...)
Arguments
x |
A fitted model object from |
y |
Included to match the generic. Not used. |
plot |
A logical value whether or not to plot the results or simply return the graaphical objects. |
ask |
A logical whether to ask before changing plots. Only applies to interactive environments. |
ncol |
The number of columns to use for plots. Defaults to 1. |
nrow |
The number of rows to use for plots. Defaults to 1. |
... |
Included to match the generic. Not used. |
Value
a list including plots of the residuals, residuals versus fitted values, and one list for plots of all random effects
Examples
library(JWileymisc)
sleep[1,1] <- NA
m <- lme4::lmer(extra ~ group + (1 | ID), data = sleep)
md <- modelDiagnostics(m, ev.perc = .1)
md$extremeValues
data(aces_daily, package = "JWileymisc")
m <- lme4::lmer(PosAff ~ STRESS + (1 + STRESS | UserID), data = aces_daily)
md <- modelDiagnostics(m, ev.perc = .001)
md$extremeValues
plot(md$modelDiagnostics[[2]][[2]])
plot(md, ncol = 2, nrow = 2)
plot(md, ncol = 2, nrow = 3)
rm(m, md, sleep)
[Package multilevelTools version 0.1.1 Index]