plotresid | R Documentation |
Plots residuals of a model against fitted values and for some models a QQ-plot of these residuals. Optionally, a Shapiro-Wilk test can be performed on residuals. The function deals with lm
(including glm
, lmList
, lmList
, glm.nb
, mlm
and manova
), lmer
, glmer
, glmmPQL
, glmmadmb
, lme
, gls
, nls
, nlsList
, survreg
, least.rect
, betareg
or glmmTMB
models.
plotresid(model, shapiro = FALSE)
model |
an object of class |
shapiro |
logical. If |
Response residuals are used for linear models, non linear models and generalized linear models based on an identity link (except with "quasi"
distributions where response residuals are used only if variance="constant"
). Pearson or studentized residuals are used whenever there is a link function which is not identity (and with "quasi"
distributions when variance
is not "constant"
), except for betareg
models where standardized weighted residuals 2 are used (see residuals.betareg
).
QQ-plots and Shapiro-Wilk tests are available whenever the model is based on a Gaussian distribution (and with "quasi"
distributions when variance="constant"
).
With a mlm
or manova
model, only a multivariate QQ-plot is drawn. The test performed when shapiro=TRUE
is a Shapiro-Wilk test for multivariate normality.
Maxime HERVE <maxime.herve@univ-rennes1.fr>
lm
, lmList
, lmList
, glm
, glm.nb
, manova
, lmer
, glmer
, lmer
, glmer.nb
, lme
, glmmPQL
, glmmadmb
, glmmTMB
, gls
, nls
, nlsList
, survreg
, least.rect
, betareg
, qresiduals
, qqPlot
, shapiro.test
, mqqnorm
, mshapiro.test
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.