Learn R Programming

VGAM (version 1.1-14)

residualsvglm: Residuals for a VGLM fit

Description

Residuals for a vector generalized linear model (VGLM) object.

Usage

residualsvglm(object, type = c("working", "pearson", "response",
   "deviance", "ldot", "stdres", "rquantile"), matrix.arg = TRUE)

Arguments

Value

If that residual type is undefined or inappropriate or not yet implemented, then NULL is returned, otherwise a matrix or vector of residuals is returned.

Details

This function returns various kinds of residuals, sometimes depending on the specific type of model having been fitted. Section 3.7 of Yee (2015) gives some details on several types of residuals defined for the VGLM class.

Standardized residuals for GLMs are described in Section 4.5.6 of Agresti (2013) as the ratio of the raw (response) residuals divided by their standard error. They involve the generalized hat matrix evaluated at the final IRLS iteration. When applied to the LM, standardized residuals for GLMs simplify to rstandard. For GLMs they are basically the Pearson residual divided by the square root of 1 minus the leverage.

References

Agresti, A. (2007). An Introduction to Categorical Data Analysis, 2nd ed., New York: John Wiley & Sons. Page 38.

Agresti, A. (2013). Categorical Data Analysis, 3rd ed., New York: John Wiley & Sons.

Agresti, A. (2018). An Introduction to Categorical Data Analysis, 3rd ed., New York: John Wiley & Sons.

Dunn, P. K. and Smyth, G. K. (1996). Randomized quantile residuals. Journal of Computational and Graphical Statistics, 5, 236--244.

See Also

Examples

Run this code
pneumo <- transform(pneumo, let = log(exposure.time))
fit <- vglm(cbind(normal, mild, severe) ~ let, propodds, pneumo)
resid(fit)  # Same as having type = "working" (the default)
resid(fit, type = "response")
resid(fit, type = "pearson")
resid(fit, type = "stdres")  # Test for independence

Run the code above in your browser using DataLab