ztpoisson: Family Object for the Zero-Truncated Poisson Distribution

View source: R/ztpoisson.R

ztpoissonR Documentation

Family Object for the Zero-Truncated Poisson Distribution

Description

Family object for specification of zero-truncated Poisson models as a glm.

Usage

ztpoisson()

Details

The ztpoisson family allows to estimate zero-truncated Poisson regression models as generalized linear models. As in the zerotrunc function, the link function is a log-link between the mean \lambda of the untruncated Poisson distribution and the linear predictor. This corresponds to a non-canonical link between for the mean of the zero-truncated Poisson distribution which does not have a closed-form representation.

Note that for new family objects 'glm()' estimates a dispersion parameter by default. Thus, unlike for the poisson family the dispersion parameter is not fixed, unless dispersion = 1 is set explicitly .

Value

An object of class "family".

See Also

dztpois, poisson, zerotrunc

Examples

## data
data("CrabSatellites", package = "countreg")
cs <- subset(CrabSatellites, subset = satellites > 0)
cs$color <- as.numeric(cs$color)

## model
ztp1 <- glm(satellites ~ width + color, data = cs, family = ztpoisson)
ztp2 <- zerotrunc(satellites ~ width + color, data = cs)
summary(ztp1, dispersion = 1) ## to get fixed dispersion as for poisson
summary(ztp2)

countreg documentation built on Dec. 4, 2023, 3:09 a.m.