quasipois                package:aod                R Documentation

_Q_u_a_s_i-_L_i_k_e_l_i_h_o_o_d _M_o_d_e_l _f_o_r _C_o_u_n_t_s

_D_e_s_c_r_i_p_t_i_o_n:

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

_U_s_a_g_e:

     quasipois(formula, data, phi = NULL, tol = 0.001)

_A_r_g_u_m_e_n_t_s:

 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]
          <= tol is met by the chi-squared statistics .

_D_e_t_a_i_l_s:

     For a given count y, the model is:

                     y | lambda ~ 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 recrystallization: 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.

_V_a_l_u_e:

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

_A_u_t_h_o_r(_s):

     Matthieu Lesnoff matthieu.lesnoff@cirad.fr, Renaud Lancelot
     renaud.lancelot@cirad.fr

_R_e_f_e_r_e_n_c_e_s:

     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.

_S_e_e _A_l_s_o:

     'glm', 'negative.binomial' in the recommended package 'MASS', 
     'geese' in the contributed package 'geepack',  'glm.poisson.disp'
     in the contributed package 'dispmod'.

_E_x_a_m_p_l_e_s:

       # 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)
       

