Learn R Programming

multilevelTools (version 0.2.0)

residualDiagnostics.lme: residualDiagnostics methods for lme objects

Description

residualDiagnostics methods for lme objects

Usage

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

Value

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

as.residualDiagnostics and

residualDiagnostics.

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.

Examples

Run this code

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)

Run the code above in your browser using DataLab