betareg(formula, data, subset, na.action, weights, offset,
link = c("logit", "probit", "cloglog", "cauchit", "log", "loglog"),
link.phi = NULL, type = c("ML", "BC", "BR"),
control = betareg.control(...), model = TRUE,
y = TRUE, x = FALSE, ...)betareg.fit(x, y, z = NULL, weights = NULL, offset = NULL,
link = "logit", link.phi = "log", type = "ML", control = betareg.control())
y ~ x
or y ~ x | z; for details see below).model.frame.betareg.fit,
offset may also be a list of two offsets for the mean and precision
equation, respectively."logit", "probit",
"cloglog", "cauchit", "log", "loglog" are supported.
Alternatively"identity",
"log", "sqrt" are supported. The default is "log"
unless formula is of type "ML"), ML with bias correction ("BC"),
and ML with bias reduction ("BR") are supported.betareg.control.TRUE the corresponding components
of the fit (model frame, response, model matrix) are returned.
For betareg.fit, x should be a numeric regressor matrix
and y should be the numerbetareg.control.betareg returns an object of class "betareg", i.e., a list with components as follows.
betareg.fit returns an unclassed list with components up to converged."mean" and "precision"
containing the coefficients from the respective models,optim call for maximizing the log-likelihood(s),optim call,optim call,optim call,n - 2,print, summary, coef etc.,"mean" and "precision"
containing the link objects for the respective models,optim,"mean", "precision" and
"full" containing the terms objects for the respective models,"mean", "precision" and
"full" containing the levels of the categorical regressors,"mean" and "precision"
containing the contrasts corresponding to levels from the
respective models,model = TRUE),y = TRUE),"mean" and "precision"
containing the model matrices from the respective models
(if x = TRUE).betareg.
It is useful in situations where the dependent variable is continuous and restricted to
the unit interval (0, 1), e.g., resulting from rates or proportions. It is modeled to be
beta-distributed with parametrization using mean and precision parameter (called phi).
The mean is linked, as in generalized linear models (GLMs), to the responses through a link
function and a linear predictor. Additionally, the precision parameter phi can be linked
to another (potentially overlapping) set of regressors through a second link function,
resulting in a model with variable dispersion.
Estimation is performed by maximum likelihood (ML) via optim using
analytical gradients and (by default) starting values from an auxiliary linear regression
of the transformed response. Subsequently, the optim result may be enhanced
by an additional Fisher scoring iteration using analytical gradients and expected information.
This slightly improves the optimization by moving the gradients even closer to zero
(for type = "ML" and "BC") or solving the bias-adjusted estimating equations
(for type = "BR"). For the former two estimators, the optional Fisher scoring
can be disabled by setting fsmaxit = 0 in the control arguments. See
Cribari-Neto and Zeileis (2010) and Gr�n et al. (2011) for details. In the beta regression as introduced by Ferrari and Cribari-Neto (2004), the mean of
the response is linked to a linear predictor described by y ~ x1 + x2 using
a link function while the precision parameter phi is assumed to be
constant. Simas et al. (2009) suggest to extend this model by linking phi to an
additional set of regressors (z1 + z2, say): In betareg this can be
specified in a formula of type y ~ x1 + x2 | z1 + z2 where the regressors
in the two parts can be overlapping. In the precision model (for phi), the link
function link.phi is used. The default is a "log" link unless no
precision model is specified. In the latter case (i.e., when the formula is of type
y ~ x1 + x2), the "identity" link is used by default for backward
compatibility.
Simas et al. (2009) also suggest further extensions (non-linear specificiations,
bias correction) which are not yet implemented in betareg. However,
Kosmidis and Firth (2010) discuss general algorithms for bias correction/reduction,
both of which are available in betareg by setting the type argument
accordingly. (Technical note: In case, either bias correction or reduction is requested,
the second derivative of the inverse link function is required for link and
link.phi. If the two links are specified by their names (as done by default
in betareg), then the "link-glm" objects are enhanced automatically
by the required additional dmu.deta function. However, if a "link-glm"
object is supplied directly by the user, it needs to have the dmu.deta
function.)
The main parameters of interest are the coefficients in the linear predictor of the mean
model. The additional parameters in the precision model (phi) can either
be treated as full model parameters (default) or as nuisance parameters. In the latter case
the estimation does not change, only the reported information in output from print,
summary, or coef (among others) will be different. See also betareg.control.
A set of standard extractor functions for fitted model objects is available for
objects of class "betareg", including methods to the generic functions
print, summary, plot, coef,
vcov, logLik, residuals,
predict, terms,
model.frame, model.matrix,
cooks.distance and hatvalues (see influence.measures),
gleverage (new generic), estfun and
bread (from the coeftest (from the predict.betareg, residuals.betareg, plot.betareg,
and summary.betareg for more details on all methods.
The original version of the package was written by Alexandre B. Simas and Andrea V. Rocha (up to version 1.2). Starting from version 2.0-0 the code was rewritten by Achim Zeileis.
Ferrari, S.L.P., and Cribari-Neto, F. (2004). Beta Regression for Modeling Rates and Proportions. Journal of Applied Statistics, 31(7), 799--815.
Gr�n, B., Kosmidis, I., and Zeileis, A. (2011).
Extended Beta Regression in R: Shaken, Stirred, Mixed, and Partitioned.
Working Paper 2011-22. Working Papers in Economics and Statistics,
Research Platform Empirical and Experimental Economics, Universit�t Innsbruck.
Kosmidis, I., and Firth, D. (2010). A Generic Algorithm for Reducing Bias in Parametric Estimation. Electronic Journal of Statistics, 4, 1097--1112.
Simas, A.B., Barreto-Souza, W., and Rocha, A.V. (2010). Improved Estimators for a General Class of Beta Regression Models. Computational Statistics & Data Analysis, 54(2), 348--366.
summary.betareg, predict.betareg, residuals.betareg,
Formula## Section 4 from Ferrari and Cribari-Neto (2004)
data("GasolineYield", package = "betareg")
data("FoodExpenditure", package = "betareg")
## Table 1
gy <- betareg(yield ~ batch + temp, data = GasolineYield)
summary(gy)
## Table 2
fe_lin <- lm(I(food/income) ~ income + persons, data = FoodExpenditure)
library("lmtest")
bptest(fe_lin)
fe_beta <- betareg(I(food/income) ~ income + persons, data = FoodExpenditure)
summary(fe_beta)
## nested model comparisons via Wald and LR tests
fe_beta2 <- betareg(I(food/income) ~ income, data = FoodExpenditure)
lrtest(fe_beta, fe_beta2)
waldtest(fe_beta, fe_beta2)
## Section 3 from online supplements to Simas et al. (2010)
## mean model as in gy above
## precision model with regressor temp
gy2 <- betareg(yield ~ batch + temp | temp, data = GasolineYield)
## MLE column in Table 19
summary(gy2)
## LRT row in Table 18
lrtest(gy, gy2)Run the code above in your browser using DataLab