residuals.bayesbr {bayesbr}R Documentation

Residuals for bayesbr Objects

Description

A function that receives model information and calculates the residuals according to the required residual.

Usage

## S3 method for class 'bayesbr'
residuals(object, type = c("", "quantile", "sweighted", "pearson","ordinary"),...)

Arguments

object

an object of the class bayesbr, containing the list returned from the bayesbr function.

type

A character containing the residual type returned by the model among the possibilities. The type of residue can be quantile, sweighted, pearson or ordinary. The default is quantile.

...

further arguments passed to or from other methods.

Details

The definitions of the waste generated by the package are available in Espinheira (2008): "pearson" in Equation 2, "sweighted" in Equation 7; and in Pereira (2019): "quantile" in Equation 5;

The type of residue "response" is calculated from the difference between the estimated theta and the variable response of the model.

Value

A vector containing the model residual according to the type of residual calculated

References

doi: 10.1080/0266476042000214501 Ferrari, S., & Cribari-Neto, F. (2004). Beta regression for modelling rates and proportions. Journal of applied statistics, 31(7), 799-815.

doi: 10.1080/00949650701829380 Simas, A. B., & Cordeiro, G. M. (2009). Adjusted Pearson residuals in exponential family nonlinear models. Journal of Statistical Computation and Simulation, 79(4), 411-425.

doi: 10.1080/02664760701834931 Espinheira, P. L., Ferrari, S. L., & Cribari-Neto, F. (2008). On beta regression residuals. Journal of Applied Statistics, 35(4), 407-419.

doi: 10.1080/00949655.2012.736993 Anholeto, T., Sandoval, M. C., & Botter, D. A. (2014). Adjusted Pearson residuals in beta regression models. Journal of Statistical Computation and Simulation, 84(5), 999-1014.

doi: 10.1080/03610918.2017.1381740 Pereira, G. H. (2019). On quantile residuals in beta regression. Communications in Statistics-Simulation and Computation, 48(1), 302-316.

See Also

bayesbr,summary.bayesbr,predict.bayesbr

Examples

data("CarTask", package = "bayesbr")

bbr = bayesbr(probability~task + NFCCscale,data=CarTask,
             iter = 100, mean_betas = c(1, 0.5,1.2))

residuals(bbr, type = "quantile")
residuals(bbr, type = "ordinary")
residuals(bbr, type = "sweighted")
residuals(bbr, type = "pearson")

[Package bayesbr version 0.0.1.0 Index]