The robustbetareg package allows fitting robust beta regression. Currently, four types of robust estimators are supported. They depend on a tuning constant which may be fixed or selected by a data-driven algorithm also implemented in the package. Diagnostic tools associated with the fitted model, such as the residuals and goodness-of-fit statistics, are implemented. Robust Wald-type tests are available.
You can install the development version of robustbetareg from GitHub with:
# install.packages("devtools")
::install_github("yurimaluf/robustbetareg") devtools
The main function of the
robustbetareg(formula, data, alpha, type = c("LSMLE", "LMDPDE", "SMLE", "MDPDE"),
link = c("logit", "probit", "cloglog", "cauchit", "loglog"), link.phi = NULL,
control = robustbetareg.control(...), model = TRUE, ... )
The robustbetareg() function returns an object of class
“robustbetareg”, similar to “betareg” and
“glm” objects, for which some methods are available. The
summary() method returns a standard output, with coefficient
estimates, standard errors, partial Wald-type tests and p values for the
regression coefficients, the pseudo
library(robustbetareg)
## basic example code
In the following, an example is presented to illustrate the
capacities of
data("Firm", package = "robustbetareg)
The response variable is FIRMCOST and the covariates are the logarithm of total assets (SIZELOG) and a measure of the firm’s industry risk (INDCOST). In the following, we fit the beta regression model using the maximum likelihood estimator and the LSMLE, a robust estimator, with tuning constant selected by the data-driven algorithm.
# MLE fit (fixed alpha equal to zero)
<- robustbetareg(FIRMCOST ~ SIZELOG + INDCOST,
fit_MLE data = Firm, type = "LSMLE", alpha = 0,
link.phi = "log")
summary(fit_MLE)
# LSMLE fit (choosing alpha via the data-driven algorithm)
<- robustbetareg(FIRMCOST ~ SIZELOG + INDCOST,
fit_LSMLE data = Firm, type = "LSMLE",
link.phi = "log")
The goodness of fit is assessed using diagnostic graphs through the plot method.
plot(fit_LSMLE)
Further details and examples on the R package
help("robustbetareg")
Maluf, Y.S., Ferrari, S.L.P., and Queiroz, F.F. (2022). Robust beta
regression through the logit transformation.