zibinomial(lpstr0 = "logit", lprob = "logit",
type.fitted = c("mean", "prob", "pobs0", "pstr0", "onempstr0"),
ipstr0 = NULL, zero = NULL, multiple.responses = FALSE,
imethod = 1)
zibinomialff(lprob = "logit", lonempstr0 = "logit",
type.fitted = c("mean", "prob", "pobs0", "pstr0", "onempstr0"),
ionempstr0 = NULL, zero = "onempstr0",
multiple.responses = FALSE, imethod = 1)
Links
for more choices.
For the zero-deflated model see below.CommonVGAMffArguments
and fittedvlm
.FALSE
to mean the
function does not handle multivariate responses. This
is to remain compatible with the same argument in
binomialff
.CommonVGAMffArguments
for information.
Argument zero
changed its default value for version 0.9-2."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.ipstr0
or ionempstr0
,
or imethod
.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.
By default, the two linear/additive predictors
for zibinomial()
are $(logit(\phi), logit(\mu))^T$. The zibinomialff()
has a few
changes compared to zibinomial()
.
These are:
(i) the order of the linear/additive predictors is switched so the
binomial probability comes first;
(ii) argument onempstr0
is now 1 minus
the probability of a structural zero, i.e.,
the probability of the parent (binomial) component,
i.e., onempstr0
is 1-pstr0
;
(iii) argument zero
has a new default so that the onempstr0
is intercept-only by default.
Now zibinomialff()
is generally recommended over
zibinomial()
.
Both functions implement Fisher scoring.
rzibinom
,
binomialff
,
posbinomial
,
rbinom
.size <- 10 # Number of trials; N in the notation above
nn <- 200
zdata <- data.frame(pstr0 = logit( 0, inverse = TRUE), # 0.50
mubin = logit(-1, inverse = TRUE), # Mean of usual binomial
sv = rep(size, length = nn))
zdata <- transform(zdata,
y = rzibinom(nn, size = sv, prob = mubin, pstr0 = pstr0))
with(zdata, table(y))
fit <- vglm(cbind(y, sv - y) ~ 1, zibinomialff, data = zdata, trace = TRUE)
fit <- vglm(cbind(y, sv - y) ~ 1, zibinomialff, data = zdata, trace = TRUE,
stepsize = 0.5)
coef(fit, matrix = TRUE)
Coef(fit) # Useful for intercept-only models
fitted(fit, type = "pobs0") # Estimate of P(Y = 0)
head(fitted(fit))
with(zdata, mean(y)) # Compare this with fitted(fit)
summary(fit)
Run the code above in your browser using DataLab