residuals.AccurateGLM: Get residuals of various types

Description Usage Arguments Value Author(s)

View source: R/residuals-aglm.R

Description

Get residuals of various types

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
## S3 method for class 'AccurateGLM'
residuals(
  object,
  x = NULL,
  y = NULL,
  offset = NULL,
  weights = NULL,
  type = c("working", "pearson", "deviance"),
  s = NULL,
  ...
)

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 \loadmathjax

A string representing type of deviance:

  • "working" get working residual \mjsdeqnr^W_i = (y_i - \mu_i) \left(\frac\partial \eta\partial \mu\right)_\mu=\mu_i, where y_i is a response value, μ is GLM mean, and η=g^{-1}(μ) with the link function g.

  • "pearson" get Pearson residuals \mjsdeqnr^P_i = \fracy_i - \mu_i\sqrtV(\mu_i), where V is the variance function.

  • "deviance" get deviance residuals \mjsdeqnr^D_i = \rm sign(y_i - \mu_i) \sqrtd_i, where d_i is the contribution to deviance.

s

A numeric value specifying λ at which residuals are calculated.

...

Other arguments are currently not used and just discarded.

Value

A numeric vector representing calculated residuals.

Author(s)

Kenji Kondo


aglm documentation built on June 9, 2021, 5:08 p.m.