Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

zoabetaR

Zero- and One-Inflated Beta Distribution Family Function


Description

Estimation of the shape parameters of the two-parameter beta distribution plus the probabilities of a 0 and/or a 1.

Usage

zoabetaR(lshape1 = "loglink", lshape2 = "loglink", lpobs0 = "logitlink",
   lpobs1 = "logitlink", ishape1 = NULL, ishape2 = NULL, trim = 0.05,
   type.fitted = c("mean", "pobs0", "pobs1", "beta.mean"),
   parallel.shape = FALSE, parallel.pobs = FALSE, zero = NULL)

Arguments

lshape1, lshape2, lpobs0, lpobs1

Details at CommonVGAMffArguments. See Links for more choices.

ishape1, ishape2

Details at CommonVGAMffArguments.

trim, zero

Same as betaR.

parallel.shape, parallel.pobs

See CommonVGAMffArguments for more information.

type.fitted

The choice "beta.mean" mean to return the mean of the beta distribution; the 0s and 1s are ignored. See CommonVGAMffArguments for more information.

Details

The standard 2-parameter beta distribution has a support on (0,1), however, many datasets have 0 and/or 1 values too. This family function handles 0s and 1s (at least one of them must be present) in the data set by modelling the probability of a 0 by a logistic regression (default link is the logit), and similarly for the probability of a 1. The remaining proportion, 1-pobs0-pobs1, of the data comes from a standard beta distribution. This family function therefore extends betaR. One has M=3 or M=4 per response. Multiple responses are allowed.

Value

Similar to betaR.

Author(s)

Thomas W. Yee and Xiangjie Xue.

See Also

Examples

nn <- 1000; set.seed(1)
bdata <- data.frame(x2 = runif(nn))
bdata <- transform(bdata,
  pobs0 = logitlink(-2 + x2, inverse = TRUE),
  pobs1 = logitlink(-2 + x2, inverse = TRUE))
bdata <- transform(bdata,
  y1 = rzoabeta(nn, shape1 = exp(1 + x2), shape2 = exp(2 - x2),
                pobs0 = pobs0, pobs1 = pobs1))
summary(bdata)
fit1 <- vglm(y1 ~ x2, zoabetaR(parallel.pobs = TRUE),
             data = bdata, trace = TRUE)
coef(fit1, matrix = TRUE)
summary(fit1)

VGAM

Vector Generalized Linear and Additive Models

v1.1-5
GPL-3
Authors
Thomas Yee [aut, cre], Cleve Moler [ctb] (author of several LINPACK routines)
Initial release
2021-01-13

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.