Learn R Programming

broom (version 0.4.3)

betareg_tidiers: Tidy betareg objects from the betareg package

Description

Tidy beta regression objects into summarized coefficients, add their fitted values and residuals, or find their model parameters.

Usage

# S3 method for betareg
tidy(x, conf.int = FALSE, conf.level = 0.95, ...)

# S3 method for betareg augment(x, data = stats::model.frame(x), newdata, type.predict, type.residuals, ...)

# S3 method for betareg glance(x, ...)

Arguments

x

A "betareg" object

conf.int

whether to include a confidence interval

conf.level

confidence level of the interval, used only if conf.int=TRUE

...

Extra arguments, not used

data

Original data frame the regression was fit on

newdata

New data frame to use for prediction

type.predict

Type of predictions to calculate

type.residuals

Type of residuals to calculate

Value

All tidying methods return a data.frame without rownames, whose structure depends on the method chosen.

tidy returns a data.frame with one row for each term used to predict the mean, along with at least one term used to predict phi (the inverse of the variance). It starts with the column component containing either "mean" or "precision" to describe which is being modeled, then has the same columns as tidied linear models or glm's (see lm_tidiers).

augment returns the original data, along with new columns describing each observation:

.fitted

Fitted values of model

.resid

Residuals

.cooksd

Cooks distance, cooks.distance

glance returns a one-row data.frame with the columns

pseudo.r.squared

the deviance of the null model

logLik

the data's log-likelihood under the model

AIC

the Akaike Information Criterion

BIC

the Bayesian Information Criterion

df.residual

residual degrees of freedom

df.null

degrees of freedom under the null

Examples

Run this code
# NOT RUN {
if (require("betareg", quietly = TRUE)) {
  data("GasolineYield", package = "betareg")

  mod <- betareg(yield ~ batch + temp, data = GasolineYield)
  
  mod
  tidy(mod)
  tidy(mod, conf.int = TRUE)
  tidy(mod, conf.int = TRUE, conf.level = .99)
  
  head(augment(mod))
  
  glance(mod)
}

# }

Run the code above in your browser using DataLab