Description Usage Arguments Details Value Author(s) References See Also Examples
Extract adjusted residuals from the model
1 | get_residuals(model, type = "adj_deviance", plot = FALSE, ...)
|
model |
a model fitted by |
type |
a quoted string indicating which type of residual to extract. Default is |
plot |
a logical indicating whether the residuals should be plotted. See |
... |
further options for |
The argument type
may be either "deviance"
, "std_deviance"
, "std_scl_deviance"
or "adj_deviance"
. Each of them behaves as described bellow.
deviance: Deviance residuals are estimated by r_{t}=sign(y_{t}-E(y_{t}))*√(d_{t}), where d_{t} is the deviance contribution of the t-th observation. See deviance
for details on deviance component extraction.
std\_deviance: The deviance component is divided by (1-h_{t}), where h_{t} is the t-th element of the diagonal of the pseudo hat matrix of the approximating linear model. So they turn into r_{t}=sign(y_{t}-E(y_{t}))*√(d_{t}/(1-h_{t})).
std\_scl\_deviance: Just like the last one except for the dispersion parameter in its expression, so they have the form r_{t}=sign(y_{t}-E(y_{t}))*√(d_{t}/φ*(1-h_{t})), where φ is the estimated dispersion parameter of the model. See dispersion
for φ estimation.
adj\_deviance: These are the deviance residuals multiplied by the estimated coefficient of skewness of the distribution. Thus, for a Poisson model they take the form r_{t}=sign(y_{t}-E(y_{t}))*√(d_{t})*K_{t}, where K_{t} is given by K_{t}=1/(6√(E(y_{t})).
Pierce and Shafer (1986) propose the use of the adjusted deviance residuals over other type of residuals.
A vector of class residuals
with extracted and adjusted residuals of the model.
Washington Junger wjunger@ims.uerj.br and Antonio Ponce de Leon ponce@ims.uerj.br
McGullagh, P., Nelder, J. A. (1989) Generalized linear models. Chapman and Hall.
Hastie, T., Tibshirani, R. (1990) Generalized additive models. 2 ed. Chapman and Hall.
Pierce, D. A., Schafer, D. W. (1986) Residuals in generalized linear models. Journal of the American Statistical Association, 81(396),977–986.
1 2 3 4 5 6 7 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.