Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

residuals.merMod

residuals of merMod objects


Description

residuals of merMod objects

Usage

## S3 method for class 'merMod'
 residuals(object,
    type = if (isGLMM(object)) "deviance" else "response",
    scaled = FALSE, ...)

  ## S3 method for class 'lmResp'
 residuals(object,
    type = c("working", "response", "deviance", "pearson", "partial"),
    ...)

  ## S3 method for class 'glmResp'
 residuals(object,
    type = c("deviance", "pearson", "working", "response", "partial"),
    ...)

Arguments

object

a fitted [g]lmer (merMod) object

type

type of residuals

scaled

scale residuals by residual standard deviation (=scale parameter)?

...

additional arguments (ignored: for method compatibility)

Details

  • The default residual type varies between lmerMod and glmerMod objects: they try to mimic residuals.lm and residuals.glm respectively. In particular, the default type is "response", i.e. (observed-fitted) for lmerMod objects vs. "deviance" for glmerMod objects. type="partial" is not yet implemented for either type.

  • Note that the meaning of "pearson" residuals differs between residuals.lm and residuals.lme. The former returns values scaled by the square root of user-specified weights (if any), but not by the residual standard deviation, while the latter returns values scaled by the estimated standard deviation (which will include the effects of any variance structure specified in the weights argument). To replicate lme behaviour, use type="pearson", scaled=TRUE.


lme4

Linear Mixed-Effects Models using 'Eigen' and S4

v1.1-26
GPL (>= 2)
Authors
Douglas Bates [aut] (<https://orcid.org/0000-0001-8316-9503>), Martin Maechler [aut] (<https://orcid.org/0000-0002-8685-9910>), Ben Bolker [aut, cre] (<https://orcid.org/0000-0002-2127-0443>), Steven Walker [aut] (<https://orcid.org/0000-0002-4394-9078>), Rune Haubo Bojesen Christensen [ctb] (<https://orcid.org/0000-0002-4494-3399>), Henrik Singmann [ctb] (<https://orcid.org/0000-0002-4842-3657>), Bin Dai [ctb], Fabian Scheipl [ctb] (<https://orcid.org/0000-0001-8172-3603>), Gabor Grothendieck [ctb], Peter Green [ctb] (<https://orcid.org/0000-0002-0238-9852>), John Fox [ctb], Alexander Bauer [ctb], Pavel N. Krivitsky [ctb, cph] (<https://orcid.org/0000-0002-9101-3362>, shared copyright on simulate.formula)
Initial release

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.