# 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

1 2 3 4 5 |

### 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:

*
(y - n * p.fit) / (n * p.fit * (1 - p.fit) * (1 + (n - 1) * φ))^{0.5}*

where *y* and *n* are respectively the numerator and the denominator of the response, *p.fit*
is the fitted probability and *φ* is the fitted overdispersion parameter. When *n = 0*, the
residual is set to 0. Response residuals are computed as *y/n - p.fit*.

For models fitted with `negbin`

or `quasipois`

, Pearson's residuals are computed as:

*
(y - y.fit) / (y.fit + φ * y.fit^2)^{0.5}*

where *y* and *y.fit* are the observed and fitted counts, respectively. Response residuals are
computed as *y - y.fit*.

### Value

A numeric vector of residuals.

### Author(s)

Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot renaud.lancelot@cirad.fr

### See Also

`residuals.glm`

### Examples

1 2 3 4 5 6 |