VGAM (version 1.1-1)

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
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.

Value

Similar to betaR.

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.

See Also

Zoabeta, betaR, betaff, Beta, zipoisson.

Examples

Run this code
# NOT RUN {
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)
# }

Run the code above in your browser using DataLab