modelDiagnostics.lme: modelDiagnostics method for lme objects

Description Usage Arguments Value Examples

View source: R/diagnostics.R

Description

This function creates a number of diagnostics for lme models.

Usage

1
2
3
4
5
6
7
8
9
## S3 method for class 'lme'
modelDiagnostics(
  object,
  ev.perc = 0.001,
  robust = FALSE,
  distr = "normal",
  standardized = TRUE,
  ...
)

Arguments

object

A fitted model object of class lme.

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 testDistribution. Defaults to “normal”.

standardized

A logical whether to use standardized pearson residuals. Defaults to TRUE generally where possible but may depend on method.

...

Additional arguments, not currently used.

Value

A logical (is.modelDiagnostics) or a modelDiagnostics object (list) for as.modelDiagnostics and modelDiagnostics.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
library(JWileymisc)
sleep[1,1] <- NA
m <- nlme::lme(extra ~ group, data = sleep,
 random = ~ 1 | ID, na.action = "na.omit")

 md <- modelDiagnostics(m, ev.perc = .1)
 md$extremeValues

 plot(md)

data(aces_daily, package = "JWileymisc")
m <- nlme::lme(PosAff ~ STRESS, data = aces_daily,
  random = ~ 1 + STRESS | UserID, na.action = "na.omit")
md <- modelDiagnostics(m, ev.perc = .001)
md$extremeValues
plot(md)


m <- nlme::lme(extra ~ 1, data = sleep, random = ~ 1 | ID/group,
  na.action = "na.omit")

md <- modelDiagnostics(m, ev.perc = .1)
md$extremeValues
plot(md)
rm(m, md, sleep)

multilevelTools documentation built on March 13, 2020, 2:07 a.m.