Learn R Programming

betareg (version 2.0-0)

betareg: Beta Regression for Rates and Proportions

Description

Fit beta regression models for rates and proportions via maximum likelihood using a parametrization with mean (depending through a link function on the covariates) and dispersion parameter (called phi).

Usage

betareg(formula, data, subset, na.action, weights, offset,
  link = c("logit", "probit", "cloglog"),
  control = betareg.control(...),
  model = TRUE, y = TRUE, x = FALSE, ...)

betareg.fit(x, y, weights = NULL, offset = NULL, link = "logit", control = betareg.control())

Arguments

formula
symbolic description of the model (of type y ~ x).
data, subset, na.action
arguments controlling formula processing via model.frame.
weights
optional numeric vector of weights.
offset
optional numeric vector with an a priori known component to be included in the linear predictor.
link
character specification of link function.
control
a list of control arguments specified via betareg.control.
model, y, x
logicals. If 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 numer
...
arguments passed to betareg.control.

Value

  • 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.
  • coefficientsvector with estimated regression coefficients and dispersion (or precision) parameter phi,
  • residualsa vector of raw residuals (observed - fitted),
  • fitted.valuesa vector of fitted means,
  • optimoutput from the optim call for maximizing the log-likelihood(s),
  • methodthe method argument passed to the optim call,
  • controlthe control arguments passed to the optim call,
  • startthe starting values for the parameters passed to the optim call,
  • weightsthe weights used (if any),
  • offsetthe offset vector used (if any),
  • nnumber of observations,
  • df.nullresidual degrees of freedom for the null model (= n - 2),
  • df.residualresidual degrees of freedom for fitted model,
  • philogical indicating whether phi will be treated as a full model parameter or a nuisance parameter in subsequent calls to print, summary, coef etc.,
  • logliklog-likelihood of the fitted model,
  • vcovcovariance matrix of all parameters in the model (including phi),
  • pseudo.R.squaredpseudo R-squared value (squared correlation of linear predictor and link-transformed response),
  • linklink object used,
  • convergedlogical indicating successful convergence of optim,
  • callthe original function call,
  • formulathe original formula,
  • termsthe terms object used,
  • levelslevels of the categorical regressors,
  • contrastscontrasts corresponding to levels,
  • modelthe full model frame (if model = TRUE),
  • ythe response proportion vector (if y = TRUE),
  • xthe model matrix (if x = TRUE).

Details

Beta regression as suggested by Ferrari and Cribari-Neto (2004) is implemented in 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/dispersion parameter (called phi). The mean is linked, as in generalized linear models (GLMs), to the responses through a link function and a linear predictor. 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.

The main parameters of interest are the coefficients in the linear predictor and the additional precision/dispersion parameter phi which can either be treated as a full model parameter (default) or as a nuisance parameter. 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 sandwich package), and coeftest (from the lmtest package). See predict.betareg, residuals.betareg, plot.betareg, and summary.betareg for more details on all methods.

References

Ferrari, S.L.P., and Cribari-Neto, F. (2004). Beta Regression for Modeling Rates and Proportions. Journal of Applied Statistics, 31(7), 799--815.

See Also

summary.betareg, predict.betareg, residuals.betareg

Examples

Run this code
## 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)

Run the code above in your browser using DataLab