## Documentation Center |

` R = residuals(lme)` returns
the raw conditional residuals from a fitted linear mixed-effects model

` R = residuals(lme,Name,Value)` returns
the residuals from the linear mixed-effects model

For example, you can specify Pearson or standardized residuals, or residuals with contributions from only fixed effects.

Conditional residuals include contributions from both fixed and random effects, whereas marginal residuals include contribution from only fixed effects.

Suppose the linear mixed-effects model `lme`has
an *n*-by-*p* fixed-effects design
matrix *X* and an *n*-by-*q* random-effects
design matrix *Z*. Also, suppose the *p*-by-1
estimated fixed-effects vector is
, and the *q*-by-1
estimated best linear unbiased predictor (BLUP) vector of random effects
is
. The fitted conditional response
is

and the fitted marginal response is

`residuals` can return three types of residuals:
raw, Pearson, and standardized. For any type, you can compute the
conditional or the marginal residuals. For example, the conditional
raw residual is

and the marginal raw residual is

For more information on other types of residuals, see the `ResidualType` name-value
pair argument.

Was this topic helpful?