residualDiagnostics.lme: residualDiagnostics methods for lme objects

View source: R/diagnostics.R

residualDiagnostics.lmeR Documentation

residualDiagnostics methods for lme objects

Description

residualDiagnostics methods for lme objects

Usage

## S3 method for class 'lme'
residualDiagnostics(
  object,
  ev.perc = 0.001,
  robust = FALSE,
  distr = "normal",
  standardized = TRUE,
  cut = 8L,
  quantiles = TRUE,
  ...
)

Arguments

object

An object with class lme.

ev.perc

The extreme value percentile to use. Defaults to .001.

robust

A logical value, whether to use robust estimates or not. Defaults to FALSE.

distr

A character string specifying the assumed distribution. Currently “normal”, but future options may be supported in the future.

standardized

A logical value whether to use standardized pearson residual values or not. Defaults to TRUE.

cut

An integer, how many unique predicted values there have to be at least for predicted values to be treated continuously, otherwise they are treated as discrete values. Defaults to 8.

quantiles

A logical whether to calculate quantiles for the residuals. Defaults to TRUE. If FALSE, then do not calculate them. These are based on simple quantiles for each predicted value if the predicted values are few enough to be treated discretely. See cut argument. Otherwise they are based on quantile regression. First trying smoothing splines, and falling back to linear quantil regression if the splines fail. You may also want to turn these off if they are not working well, or are not of value in your diagnostics.

...

Additional arguments. Not currently used.

Value

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

Examples


library(JWileymisc)
sleep[1,1] <- NA
m <- nlme::lme(extra ~ group, data = sleep, random = ~ 1 | ID,
  na.action = na.omit)

 residualDiagnostics(m)$Residuals

m <- nlme::lme(hp ~ mpg, data = mtcars, random = ~ 1 | cyl,
  na.action = na.omit)
residualDiagnostics(m)$Residuals

rm(m, sleep)

multilevelTools documentation built on April 13, 2025, 9:08 a.m.