Learn R Programming

RVAideMemoire (version 0.9-35)

plotresid: Simple analysis of model residuals

Description

Plot residuals of a model against fitted values and a QQ-plot of these residuals. Optionally, a Shapiro-Wilk test can be performed on residuals. The function deals with lm (including glm, glm.nb and manova), lmer, glmer, glmmadmb, lme, nls, nlsList, survreg and least.rect models.

Usage

plotresid(model, shapiro = FALSE)

Arguments

model
an object of class "lm", "merMod", "glmmadmb", "lme", "nls", "nlsList", "survreg" or "least.rect".
shapiro
logical. If TRUE a Shapiro-Wilk test is performed on residuals.

Details

Externally studentized resisuals are used for lm, glm (except with a poisson, quasipoisson, binomial or quasibinomial family). Standardized residuals are used for nlme, nls and nlsList models. Quantile residuals (function qresiduals) are used for glm.nb, glm (with a poisson, quasipoisson, binomial or quasibinomial family), glmer (with a poisson or binomial family) and glmer.nb models. In all other cases raw residuals are used. With a manova model, only a multivariate QQ-plot is drawn. The test performed when shapiro=TRUE is a Shapiro-Wilk test for multivariate normality.

See Also

lm, glm, glm.nb, manova, lmer, glmer, lmer, glmer.nb, lme, nls, nlsList, survreg, least.rect, qresiduals, qqPlot, shapiro.test, mqqnorm, mshapiro.test