Learn R Programming

VGAM (version 0.8-1)

posbinomial: Positive Binomial Distribution Family Function

Description

Fits a positive binomial distribution.

Usage

posbinomial(link = "logit", earg=list())

Arguments

link
Link function for the usual probability parameter. See Links for more choices.
earg
List. Extra argument for the link. See earg in Links for general information.

Value

  • An object of class "vglmff" (see vglmff-class). The object is used by modelling functions such as vglm, and vgam.

Warning

Under- or over-flow may occur if the data is ill-conditioned.

Details

The positive binomial distribution is the ordinary binomial distribution but with the probability of zero being zero. Thus the other probabilities are scaled up (i.e., divided by $1-P(Y=0)$).

References

Patil, G. P. (1962) Maximum likelihood estimation for generalised power series distributions and its application to a truncated binomial distribution. Biometrika, 49, 227--237.

Documentation accompanying the VGAM package at http://www.stat.auckland.ac.nz/~yee contains further information and examples.

See Also

binomialff.

Examples

Run this code
# Number of albinotic children in families with 5 kids (from Patil, 1962)
akids = data.frame(y = c(rep(1,25), rep(2,23), rep(3,10), 4,5), n=rep(5,60))
akids = transform(akids, yprop = y / 5)
fit1 = vglm(yprop~1, posbinomial, akids, trace=TRUE, weights=n)
fit2 = vglm(cbind(y,n-y)~1, posbinomial, akids, trace=TRUE) # Same model
summary(fit1)
Coef(fit2)   # = MLE of p = 0.3088
head(fitted(fit2))

Run the code above in your browser using DataLab