residuals-methods {aod} | R Documentation |
Residuals for Maximum-Likelihood and Quasi-Likelihood Models
Description
Residuals of models fitted with functions betabin
and negbin
(formal class “glimML”), or
quasibin
and quasipois
(formal class “glimQL”).
Usage
## S4 method for signature 'glimML'
residuals(object, type = c("pearson", "response"), ...)
## S4 method for signature 'glimQL'
residuals(object, type = c("pearson", "response"), ...)
Arguments
object |
Fitted model of formal class “glimML” or “glimQL”. |
type |
Character string for the type of residual: “pearson” (default) or “response”. |
... |
Further arguments to be passed to the function, such as |
Details
For models fitted with betabin
or quasibin
, Pearson's residuals are computed as:
where and
are respectively the numerator and the denominator of the response,
is the fitted probability and
is the fitted overdispersion parameter. When
, the
residual is set to 0. Response residuals are computed as
.
For models fitted with negbin
or quasipois
, Pearson's residuals are computed as:
where and
are the observed and fitted counts, respectively. Response residuals are
computed as
.
Value
A numeric vector of residuals.
Author(s)
Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot renaud.lancelot@cirad.fr
See Also
Examples
data(orob2)
fm <- betabin(cbind(y, n - y) ~ seed, ~ 1,
link = "logit", data = orob2)
#Pearson's chi-squared goodness-of-fit statistic
sum(residuals(fm, type = "pearson")^2)