Learn R Programming

VGAM (version 1.1-14)

poissonff: Poisson Regression

Description

Family function for a generalized linear model fitted to Poisson responses.

Usage

poissonff(link = "loglink", imu = NULL, imethod = 1,
  parallel = FALSE, zero = NULL, bred = FALSE,
  earg.link = FALSE, type.fitted = c("mean", "quantiles"),
  percentiles = c(25, 50, 75), bhhh = FALSE, oim.bhhh = NULL)

Arguments

Value

An object of class "vglmff" (see

vglmff-class). The object is used by modelling functions such as

vglm, vgam,

rrvglm, cqo, and cao.

Details

\(M\) defined above is the number of linear/additive predictors. With overdispersed data try negbinomial.

References

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

See Also

Links, hdeff.vglm, negbinomial, genpoisson1, genpoisson2, genpoisson0, gaitdpoisson, zipoisson, N1poisson, pospoisson, skellam, mix2poisson, cens.poisson, ordpoisson, amlpoisson, inv.binomial, simulate.vlm, loglink, polf, rrvglm, cqo, cao, binomialff, poisson, Poisson, poisson.points, ruge, V1, V2, residualsvglm, margeff.

Examples

Run this code
poissonff()

set.seed(123)
pdata <- data.frame(x2 = rnorm(nn <- 100))
pdata <- transform(pdata, y1 = rpois(nn, exp(1 + x2)),
                          y2 = rpois(nn, exp(1 + x2)))
(fit1 <- vglm(cbind(y1, y2) ~ x2, poissonff, pdata))
(fit2 <- vglm(y1 ~ x2, poissonff(bred = TRUE), pdata))
coef(fit1, matrix = TRUE)
coef(fit2, matrix = TRUE)

nn <- 200
cdata <- data.frame(x2 = rnorm(nn), x3 = rnorm(nn), x4 = rnorm(nn))
cdata <- transform(cdata, lv1 = 0 + x3 - 2*x4)
cdata <- transform(cdata, lambda1 = exp(3 - 0.5 *  (lv1-0)^2),
                          lambda2 = exp(2 - 0.5 *  (lv1-1)^2),
                          lambda3 = exp(2 - 0.5 * ((lv1+4)/2)^2))
cdata <- transform(cdata, y1 = rpois(nn, lambda1),
                          y2 = rpois(nn, lambda2),
                          y3 = rpois(nn, lambda3))
if (FALSE)  lvplot(p1, y = TRUE, lcol = 2:4, pch = 2:4, pcol = 2:4, rug = FALSE) 

Run the code above in your browser using DataLab