spaMM (version 1.9.16)

negbin: Family function for negative binomial GLMs and mixed models.

Description

Specifies the information required to fit a negative binomial generalized linear model, with known or unknown underlying Gamma shape parameter.

Usage

negbin(shape = stop("negbin's 'shape' must be specified"), link = "log")

Arguments

shape
Shape parameter of the underlying Gamma distribution, given that the negbin family can be represented as a Poisson-Gamma mixture, where the conditional Poisson mean is $\mu$ times a Gamma random variable with mean 1 and shape shape (as produced by rgamma(., shape=shape,scale=1/shape)).
link
log, sqrt or identity link, specified by the sevaral available ways for GLM links (name, character string, one-element character vector, or object of class link-glm as returned by make.link).

Value

A family object.

Details

shape is the $k$ parameter of McCullagh and Nelder (1989, p.373) and the theta parameter of Venables and Ripley (2002, section 7.4). The negbin family is sometimes called the NegBin1 model in the literature on negative binomial models.

References

McCullagh, P. and Nelder, J.A. (1989) Generalized Linear Models, 2nd edition. London: Chapman & Hall.

Venables, W. N. and Ripley, B. D. (2002) Modern Applied Statistics with S-PLUS. Fourth Edition. Springer.

Examples

Run this code
## Fitting negative binomial model with estimated scale parameter:
data(scotlip)
fitme(cases~I(prop.ag/10)+offset(log(scotlip$expec)),family=negbin(), data=scotlip)

Run the code above in your browser using DataCamp Workspace