zibinomial(lphi="logit", link.mu="logit",
ephi=list(), emu=list(),
iphi=NULL, zero=1, mv=FALSE)
Links
for more choices.Links
for more choices.earg
in Links
for general information.zero=NULL
enables both
$\phi$ and $\mu$ to be modelled as a functionFALSE
to mean the function does
not handle multivariate responses. This is to remain compatible with
the same argument in binomialff
."vglmff"
(see vglmff-class
).
The object is used by modelling functions such as vglm
and vgam
.iphi
.size
in
rzibinom
is $N$ here.
The parameter $\phi$ 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
n = 200
phi = 0.50
mubin = 0.3 # Mean of an ordinary binomial distribution
sv = rep(size, len=n)
y = rzibinom(n=n, size=sv, prob=mubin, phi=phi) / sv # A proportion
table(y)
fit = vglm(y ~ 1, zibinomial, weight=sv, trace=TRUE)
coef(fit, matrix=TRUE)
Coef(fit)
fit@misc$p0 # Estimate of P(Y=0)
fitted(fit)[1:4,]
mean(y) # Compare this with fitted(fit)
summary(fit)
Run the code above in your browser using DataLab