modelDiagnostics.merMod {multilevelTools} | R Documentation |
modelDiagnostics method for merMod objects
Description
This function creates a number of diagnostics
for merMod
models.
Usage
## S3 method for class 'merMod'
modelDiagnostics(
object,
ev.perc = 0.001,
robust = FALSE,
distr = "normal",
standardized = TRUE,
...
)
Arguments
object |
A fitted model object, either of class merMod from the lme4 package or merModLmerTest from the lmerTest package. |
ev.perc |
A real number between 0 and 1 indicating the proportion of the theoretical distribution beyond which values are considered extreme values (possible outliers). Defaults to .001. |
robust |
Whether to use robust mean and standard deviation estimates for normal distribution |
distr |
A character string given the assumed distribution.
Passed on to |
standardized |
A logical whether to use standardized residuals.
Defaults to |
... |
Additional arguments, not currently used. |
Value
A logical (is.modelDiagnostics
) or
a modelDiagnostics object (list) for
as.modelDiagnostics
and modelDiagnostics
.
Examples
library(JWileymisc)
sleep[1,1] <- NA
m <- lme4::lmer(extra ~ group + (1 | ID), data = sleep)
md <- modelDiagnostics(m, ev.perc = .1)
md$extremeValues
class(md)
plot(md)
data(aces_daily, package = "JWileymisc")
m <- lme4::lmer(PosAff ~ STRESS + (1 + STRESS | UserID), data = aces_daily)
md <- modelDiagnostics(m, ev.perc = .1)
# gm1 <- lme4::glmer(cbind(incidence, size - incidence) ~ period + (1 | herd),
# data = lme4::cbpp, family = binomial)
# modelDiagnostics(gm1) ## should be an error
rm(m, md, sleep)