Learn R Programming

aod (version 1.1-35)

quasipois: Quasi-Likelihood Model for Counts

Description

The function fits the log linear model (Procedure II) proposed by Breslow (1984) accounting for overdispersion in counts $y$.

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 y i.e., positive integers (y >= 0). The right-hand side can involve an offset term.
data
A data frame containing the response (y) and explanatory variable(s).
phi
When phi is NULL (the default), the overdispersion parameter $\phi$ is estimated from the data. Otherwise, its value is considered as fixed.
tol
A positive scalar (default to 0.001). The algorithm stops at iteration $r + 1$ when the condition $\chi{^2}[r+1] - \chi{^2}[r]

Value

  • An object of formal class glimQL: see glimQL-class for details.

Details

For a given count $y$, the model is: $$y~|~\lambda \sim Poisson(~\lambda)$$ with $\lambda$ a random variable of mean $E[\lambda] = \mu$ and variance $Var[\lambda] = \phi * \mu^2$. The marginal mean and variance are: $$E[y] = \mu$$ $$Var[y] = \mu + \phi * \mu^2$$ The function uses the function glm and the parameterization: $\mu = exp(X b) = exp(\eta)$, where $X$ is a design-matrix, $b$ is a vector of fixed effects and $\eta = X b$ is the linear predictor. The estimate of $b$ maximizes the quasi log-likelihood of the marginal model. The parameter $\phi$ is estimated with the moment method or can be set to a constant (a regular glim is fitted when $\phi$ is set to 0). The literature recommends to estimate $\phi$ with the saturated model. Several explanatory variables are allowed in $b$. None is allowed in $\phi$. An offset can be specified in the argument formula to model rates $y/T$ (see examples). The offset and the marginal mean are $log(T)$ and $\mu = exp(log(T) + \eta)$, respectively.

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

Run this code
# 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)

Run the code above in your browser using DataLab