residuals.PLreg {PLreg}R Documentation

Residuals Method for PLreg Objects

Description

The function provides three types of residuals for power logit regression models: quantile, deviance and standardized.

Usage

## S3 method for class 'PLreg'
residuals(object, type = c("quantile", "deviance", "standardized"), ...)

Arguments

object

fitted model object of class "PLreg".

type

character specifying the type of residuals to be used.

...

currently not used.

Details

The quantile residuals is based on Dunn and Smyth (1996) idea. The residuals are well-defined for all the distributions in the power logit class and have, approximately, a standard normal distribution in large samples if the model is correctly specified.

The deviance residuals are based on the log-likelihood contributions of each observation in the sample. The distribution of this residual is unknown (both exact and asymptotic), except for the power logit normal model, which is, approximately, standard normal.

The standardized residuals are a standardized form of the ordinary residual. These residuals take into account the diagonal elements of the H matrix, being useful for detecting leverage observations. The distribution of the standardized residuals is unknown.

Value

residuals method for object of class "PLreg" returns a vector with the residuals of the type specified in the type argument.

References

Queiroz, F. F. and Ferrari, S. L. P. (2022). Power logit regression for modeling bounded data. arXiv:2202.01697.

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

See Also

PLreg, plot.PLreg, envelope, influence

Examples

data("PeruVotes")
fitPL <- PLreg(votes ~ HDI | HDI, data = PeruVotes,
              family = "TF", zeta = 5)

res_quantile = residuals(fitPL, type = "quantile")
res_standardized = residuals(fitPL, type = "standardized")

plot(res_standardized, pch = "+", ylim = c(-6, 6))
abline(h = -3, lty = 2)
abline(h = 3, lty = 2)

qqnorm(res_quantile)
qqline(res_quantile)

[Package PLreg version 0.4.1 Index]