Residuals: Residuals from a binomial regression model

Description Usage Arguments Details Value Author(s) References Examples

View source: R/Residuals.R

Description

Function to extract residuals from a binomial regression model

Usage

1
2
3
Residuals(object, type = c("approx.deletion", "exact.deletion",
          "standard.deviance", "standard.pearson", "deviance",
          "pearson", "working", "response", "partial"))

Arguments

object

An object of class glm with a binomial family

type

The type of residuals to be returned. Default is approx.deletion residuals

Details

A considerable terminology inconsistency regarding residuals is found in the litterature, especially concerning the adjectives standardized and studentized. Here, we use the term standardized about residuals divided by √(1-h_i) and avoid the term studentized in favour of deletion to avoid confusion. See Hardin and Hilbe (2007) p. 52 for a short discussion of this topic.

The objective of Residuals is to enhance transparency of residuals of binomial regression models in R and to uniformise the terminology. With the exception of exact.deletion all residuals are extracted with a call to rstudent, rstandard and residuals from the stats package (see the description of the individual residuals below).

Value

A vector of residuals

Author(s)

Merete K Hansen

References

Collett, D. (2003) Modelling binary data. Second edition. Chapman & Hall/CRC.

Fox, J. (2002) An R and S-Plus Companion to Applied Regression. Sage Publ.

Hardin, J.W., Hilbe, J.M. (2007). Generalized Linear Models and Extensions. Second edition. Stata Press.

Williams, D. A. (1987) Generalized linear model diagnostics using the deviance and single case deletions. Applied Statistics 36, 181-191.

Examples

1
2
3
data(serum)
serum.glm <- glm(cbind(y, n-y) ~ log(dose), family = binomial, data = serum)
Residuals(serum.glm, type='standard.deviance')

Example output

         1          2          3          4          5 
 1.2831240 -0.8082727 -0.8980337  1.3897974 -0.1749601 

binomTools documentation built on May 29, 2017, 10:12 p.m.