Learn R Programming

spaMM (version 3.13.0)

beta_resp: Beta-response family object

Description

Returns a family object for beta-response models. The model described by such a family is characterized by a linear predictor, a link function, and the beta density for the residual variation.

The precision parameter prec of this family is such that the variance of the response given its mean \(\mu\) is \(\mu(1-\mu)/(1+\)prec). prec is thus the precision parameter \(\phi\) of Ferrari & Cribari-Neto (2004) and of the betareg package (Cribari-Neto & Zeileis 2010).

Prior weights are meaningful for this family and handled as a factor of the precision parameter (as for GLM families) hence here not as a divisor of the variance (in contrast to GLM families): the variance of the response become \(\mu(1-\mu)/(1+\)prec*<prior weigths>).

Usage

beta_resp(prec = stop("beta_resp's 'prec' must be specified"), link = "logit")

Value

A list, formally of class c("LLF", "family"). See LL-family for details about the structure and usage of such objects.

Arguments

prec

Parameter controlling the variance of the beta distribution.

link

logit, probit, cloglog or cauchit link, specified by any of the available ways for GLM links (name, character string, one-element character vector, or object of class link-glm as returned by make.link).

References

Cribari-Neto, F., & Zeileis, A. (2010). Beta Regression in R. Journal of Statistical Software, 34(2), 1-24. tools:::Rd_expr_doi("10.18637/jss.v034.i02")

Ferrari SLP, Cribari-Neto F (2004). “Beta Regression for Modelling Rates and Proportions.” Journal of Applied Statistics, 31(7), 799-815.

See Also

Further examples in LL-family.

Examples

Run this code
  set.seed(123)
  beta_dat <- data.frame(y=runif(100),grp=sample(2,100,replace = TRUE))
  
  fitme(y ~1+(1|grp), family=beta_resp(), data= beta_dat)
  ## same logL, halved 'prec' when prior weights=2 are used: 
  # fitme(y ~1+(1|grp), family=beta_resp(), data= beta_dat, prior.weights=rep(2,100))

Run the code above in your browser using DataLab