Learn R Programming

aglm (version 0.4.1)

residuals.AccurateGLM: Get residuals of various types

Description

Get residuals of various types

Usage

# S3 method for AccurateGLM
residuals(
  object,
  x = NULL,
  y = NULL,
  offset = NULL,
  weights = NULL,
  type = c("working", "pearson", "deviance"),
  s = NULL,
  ...
)

Value

A numeric vector representing calculated residuals.

Arguments

object

A model object obtained from aglm() or cv.aglm().

x

A design matrix. If not given, x for fitting is used.

y

A response variable. If not given, y for fitting is used.

offset

An offset values. If not given, offset for fitting is used.

weights

Sample weights. If not given, weights for fitting is used.

type

A string representing type of deviance:

  • "working" get working residual r^W_i = (y_i - _i) ( )_=_i, where \(y_i\) is a response value, \(\mu\) is GLM mean, and \(\eta=g^{-1}(\mu)\) with the link function \(g\).

  • "pearson" get Pearson residuals r^P_i = y_i - _iV(_i), where \(V\) is the variance function.

  • "deviance" get deviance residuals r^D_i = sign(y_i - _i) d_i, where \(d_i\) is the contribution to deviance.

s

A numeric value specifying \(\lambda\) at which residuals are calculated.

...

Other arguments are currently not used and just discarded.

Author

Kenji Kondo