zibinomial(lpstr0 = "logit", lprob = "logit",
ipstr0 = NULL, zero = 1, mv = FALSE, imethod = 1)
Links
for more choices.
For the zero-deflated model see below.FALSE
to mean the function does
not handle multivariate responses. This is to remain compatible with
the same argument in binomialff
.CommonVGAMffArguments
for information."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.ipstr0
.size
in
rzibinom
is $N$ here.
The parameter $\phi$ is the probability of a structural zero,
and it satisfies $0 < \phi < 1$.
The mean of $Y$ is $E(Y)=(1-\phi) \mu$
and these are returned as the fitted values.
By default, the two linear/additive predictors
are $(logit(\phi), logit(\mu))^T$.rzibinom
,
binomialff
,
posbinomial
,
rbinom
.size <- 10 # Number of trials; N in the notation above
nn <- 200
zibdata <- data.frame(pstr0 = logit( 0, inverse = TRUE), # 0.50
mubin = logit(-1, inverse = TRUE), # Mean of usual binomial
sv = rep(size, length = nn))
zibdata <- transform(zibdata,
y = rzibinom(nn, size = sv, prob = mubin, pstr0 = pstr0))
with(zibdata, table(y))
fit <- vglm(cbind(y, sv - y) ~ 1, zibinomial, zibdata, trace = TRUE)
fit <- vglm(cbind(y, sv - y) ~ 1, zibinomial, zibdata, trace = TRUE, stepsize = 0.5)
coef(fit, matrix = TRUE)
Coef(fit) # Useful for intercept-only models
fit@misc$pobs0 # Estimate of P(Y = 0)
head(fitted(fit))
with(zibdata, mean(y)) # Compare this with fitted(fit)
summary(fit)
Run the code above in your browser using DataLab