Tests for Overdispertion      package:DCluster      R Documentation

_L_i_k_e_l_i_h_o_o_d _r_a_t_i_o _t_e_s_t _a_n_d _D_e_a_n'_s _t_e_s_t_s _f_o_r _O_v_e_r_d_i_s_p_e_r_t_i_o_n

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

     When working with count data,  the assumption of a Poisson model
     is  common. However, sometimes the variance of the data is
     significantly  higher that their mean which means that the
     assumption of that data have been drawn from a Poisson
     distribution is wrong. 

     In that case is is usually said that data are overdispersed and a
     better model must be proposed. A good choice is a Negative
     Binomial distribution (see, for example, 'negative.binomial'.

     Tests for overdispersion available in this package are the
     Likelihood Ratio Test (LRT) and Dean's P_B and  P'_B tests.

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

     test.nb.pois(x.nb, x.glm)
     DeanB(x.glm, alternative="greater")
     DeanB2(x.glm, alternative="greater")

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

    x.nb: Fitted Negative Binomial.

   x.glm: Fitted Poisson model.

alternative: Alternative hipothesis to be tested. It can be "less",
          "greater" or "two.sided", although the usual choice will
          often be "greater".

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

     The LRT is computed to compare a fitted Poisson model against a
     fitted Negative Binomial model.

     Dean's P_B and  P'_B tests are score tests. These two tests were
     proposed for the case in which we look for overdispersion of the
     form  var(Y_i)=mu_i(1+tau mu_i), where  E(Y_i)=mu_i. See Dean
     (1992) for more details.

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

     An object of type _htest_ with the results (p-value, etc.).

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

     Dean, C.B. (1992), Testing for overdispersion in Poisson and
     binomial regression models, _J. Amer. Statist. Assoc._ 87,
     451-457.

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

     DCluster, achisq.stat, pottwhit.stat, negative.binomial (MASS),
     glm.nb (MASS)

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

     library(spdep)
     library(MASS)

     data(nc.sids)

     sids<-data.frame(Observed=nc.sids$SID74)
     sids<-cbind(sids, Expected=nc.sids$BIR74*sum(nc.sids$SID74)/sum(nc.sids$BIR74))
     sids<-cbind(sids, x=nc.sids$x, y=nc.sids$y)

     x.glm<-glm(Observed~1+offset(log(sids$Expected)), data=sids, family=poisson())
     x.nb<-glm.nb(Observed~1+offset(log(Expected)), data=sids)

     print(test.nb.pois(x.nb, x.glm))
     print(DeanB(x.glm))
     print(DeanB2(x.glm))

