Skip to contents

Returns residuals from an ame_als or lame_als fit.

Usage

# S3 method for class 'ame_als'
residuals(object, type = c("response", "working"), plug_in = NULL, ...)

Arguments

object

an ame_als object.

type

"response" (default) or "working".

plug_in

logical; for an empirical-Bayes fit, take the response residuals from the plug-in fitted values (TRUE) or from the predictive means (FALSE); the default is the one of fitted.ame_als: TRUE for a Poisson fit, FALSE for a binary fit.

...

ignored.

Value

A matrix (cross-sectional) or list of matrices (longitudinal).

Details

type = "response" (default) returns observed Y minus the response-scale fitted values, so residuals() reconciles with fitted(): for a binary empirical-Bayes fit the predictive probabilities, or with plug_in = TRUE the plug-in ones, and for a Poisson fit the plug-in mean counts, or with plug_in = FALSE the predictive means that integrate the predictor. type = "working" returns the Gaussian working-scale residuals the estimator actually minimised (identical to "response" for the normal family).