residuals.gam {mgcv}R Documentation

Generalized Additive Model residuals

Description

Returns residuals for a fitted gam model object. Pearson, deviance, working and response residuals are available.

Usage

residuals.gam(object, type = c("deviance", "pearson", "working", "response"),...)

Arguments

object a gam fitted model object.
type the type of residuals wanted.
... other arguments.

Details

Response residuals are the raw residuals (data minus fitted values). Pearson residuals are raw residuals divided by the standard deviation of the data according to the model mean variance relationship ((y-m)/V(m)^0.5, where y is data m is model fitted value and V is model mean-variance relationship.). Deviance residuals simply return the deviance residuals defined by the model family. Working residuals are the residuals returned from model fitting at convergence.

There is a special function for gam objects because of a bug in the calculation of Pearson residuals in some versions of residual.glm().

Value

An array of residuals.

Author(s)

Simon N. Wood snw@st-and.ac.uk

See Also

gam mgcv


[Package Contents]