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

residuals.gam

Generalized Additive Model residuals


Description

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

Usage

## S3 method for class 'gam'
residuals(object, type = "deviance",...)

Arguments

object

a gam fitted model object.

type

the type of residuals wanted. Usually one of "deviance", "pearson","scaled.pearson", "working", or "response".

...

other arguments.

Details

Response residuals are the raw residuals (data minus fitted values). Scaled Pearson residuals are raw residuals divided by the standard deviation of the data according to the model mean variance relationship and estimated scale parameter. Pearson residuals are the same, but multiplied by the square root of the scale parameter (so they are independent of the scale parameter): ((y-m)/V(m)^0.5, where y is data m is model fitted value and V is model mean-variance relationship.). Both are provided since not all texts agree on the definition of Pearson residuals. Deviance residuals simply return the deviance residuals defined by the model family. Working residuals are the residuals returned from model fitting at convergence.

Families can supply their own residual function, which is used in place of the standard function if present, (e.g. cox.ph).

Value

A vector of residuals.

Author(s)

See Also


mgcv

Mixed GAM Computation Vehicle with Automatic Smoothness Estimation

v1.8-35
GPL (>= 2)
Authors
Simon Wood <simon.wood@r-project.org>
Initial release

We don't support your browser anymore

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