View source: R/family.aunivariate.R
zoabetaR | R Documentation |
Estimation of the shape parameters of the two-parameter beta distribution plus the probabilities of a 0 and/or a 1.
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)
lshape1 , lshape2 , lpobs0 , lpobs1 |
Details at |
ishape1 , ishape2 |
Details at |
trim , zero |
Same as |
parallel.shape , parallel.pobs |
See |
type.fitted |
The choice |
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.
Similar to betaR
.
Thomas W. Yee and Xiangjie Xue.
Zoabeta
,
betaR
,
betaff
,
Beta
,
zipoisson
.
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)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.