| residuals.betareg {betareg} | R Documentation |
Extract various types of residuals from beta regression models: raw response residuals (observed - fitted), Pearson residuals (raw residuals scaled by square root of variance function), deviance residuals (scaled log-likelihood contributions), and different kinds of weighted residuals suggested by Espinheira et al. (2008).
## S3 method for class 'betareg':
residuals(object,
type = c("deviance", "pearson", "response", "weighted", "sweighted", "sweighted2"),
...)
object |
fitted model object of class "betareg". |
type |
character indicating type of residuals. |
... |
currently not used. |
The definitions of all residuals are provided in Espinheira et al. (2008):
Equation 2 for "pearson", last equation on page 409 for "deviance",
Equation 6 for "weighted", Equation 7 for "sweighted", and
Equation 8 for "sweighted2".
Espinheira et al. (2008) recommend to use "sweighted2".
Espinheira, P.L., Ferrari, S.L.P., and Cribari-Neto, F. (2008). On Beta Regression Residuals. Journal of Applied Statistics, 35(4), 407–419.
Ferrari, S.L.P., and Cribari-Neto, F. (2004). Beta Regression for Modeling Rates and Proportions. Journal of Applied Statistics, 31(7), 799–815.
data("GasolineYield", package = "betareg")
gy <- betareg(yield ~ gravity + pressure + temp10 + temp, data = GasolineYield)
gy_res <- cbind(
residuals(gy, type = "pearson"),
residuals(gy, type = "deviance"),
residuals(gy, type = "response"),
residuals(gy, type = "weighted"),
residuals(gy, type = "sweighted"),
residuals(gy, type = "sweighted2")
)
colnames(gy_res) <- c("pearson", "deviance", "response",
"weighted", "sweighted", "sweighted2")
pairs(gy_res)