Get residuals of various types
# S3 method for AccurateGLM
residuals(
object,
x = NULL,
y = NULL,
offset = NULL,
weights = NULL,
type = c("working", "pearson", "deviance"),
s = NULL,
...
)
A numeric vector representing calculated residuals.
A model object obtained from aglm()
or cv.aglm()
.
A design matrix.
If not given, x
for fitting is used.
A response variable.
If not given, y
for fitting is used.
An offset values.
If not given, offset
for fitting is used.
Sample weights.
If not given, weights
for fitting is used.
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.
A numeric value specifying \(\lambda\) at which residuals are calculated.
Other arguments are currently not used and just discarded.
Kenji Kondo