quasipois {aod} | R Documentation |
Quasi-Likelihood Model for Counts
Description
The function fits the log linear model (“Procedure II”) proposed by Breslow (1984) accounting for
overdispersion in counts .
Usage
quasipois(formula, data, phi = NULL, tol = 0.001)
Arguments
formula |
A formula for the fixed effects. The left-hand side of the formula must be the counts |
data |
A data frame containing the response ( |
phi |
When |
tol |
A positive scalar (default to 0.001). The algorithm stops at iteration |
Details
For a given count , the model is:
with a random variable of mean
and variance
.
The marginal mean and variance are:
The function uses the function glm
and the parameterization: , where
is a design-matrix,
is a vector of fixed effects and
is the linear predictor.
The estimate of maximizes the quasi log-likelihood of the marginal model.
The parameter
is estimated with the moment method or can be set to a constant
(a regular glim is fitted when
is set to 0). The literature recommends to estimate
with the saturated model. Several explanatory variables are allowed in
. None is allowed in
.
An offset can be specified in the argument formula
to model rates (see examples). The offset and the
marginal mean are
and
, respectively.
Value
An object of formal class “glimQL”: see glimQL-class
for details.
Author(s)
Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot renaud.lancelot@cirad.fr
References
Breslow, N.E., 1984. Extra-Poisson variation in log-linear models. Appl. Statist. 33, 38-44.
Moore, D.F., Tsiatis, A., 1991. Robust estimation of the variance in moment methods for extra-binomial
and extra-poisson variation. Biometrics 47, 383-401.
See Also
glm
, negative.binomial
in the recommended package MASS,
geese
in the contributed package geepack,
glm.poisson.disp
in the contributed package dispmod.
Examples
# without offset
data(salmonella)
quasipois(y ~ log(dose + 10) + dose,
data = salmonella)
quasipois(y ~ log(dose + 10) + dose,
data = salmonella, phi = 0.07180449)
summary(glm(y ~ log(dose + 10) + dose,
family = poisson, data = salmonella))
quasipois(y ~ log(dose + 10) + dose,
data = salmonella, phi = 0)
# with offset
data(cohorts)
i <- cohorts$age ; levels(i) <- 1:7
j <- cohorts$period ; levels(j) <- 1:7
i <- as.numeric(i); j <- as.numeric(j)
cohorts$cohort <- j + max(i) - i
cohorts$cohort <- as.factor(1850 + 5 * cohorts$cohort)
fm1 <- quasipois(y ~ age + period + cohort + offset(log(n)),
data = cohorts)
fm1
quasipois(y ~ age + cohort + offset(log(n)),
data = cohorts, phi = fm1@phi)