empbaysmooth            package:DCluster            R Documentation

_E_m_p_i_r_i_c_a_l _B_a_y_e_s _S_m_o_o_t_h_i_n_g

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

     Smooth  relative risks from a set of expected and observed number
     of cases using a Poisson-Gamma model as proposed by _Clayton and
     Kaldor_ (1987) .

     If nu and alpha are the two parameters of the  prior Gamma
     distribution, smoothed relative risks are (O_i+nu)/(E_i+alpha).

     nu and alpha are estimated via Empirical Bayes, by using mean and
     variance, as described by _Clayton and Kaldor_(1987).

     Size and probabilities for a Negative Binomial model are also
     calculated (see below).

     See _Details_ for more information.

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

     empbaysmooth(Observed, Expected, maxiter=20, tol=1e-5)

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

Observed: Vector of observed cases.

Expected: Vector of expected cases.

 maxiter: Maximum number of iterations allowed.

     tol: Tolerance used to stop the iterative procedure.

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

     The Poisson-Gamma model, as described by _Clayton and Kaldor_, is
     a two-layers Bayesian Hierarchical model:


                    O_i|theta_i ~ Po(theta_i E_i)



                       theta_i ~ Ga(nu, alpha)


     The posterior distribution of O_i,unconditioned to theta_i, is
     Negative Binomial with size nu and probability alpha/(alpha+E_i).

     The estimators of relative risks are
     thetahat_i=(O_i+nu)/(E_i+alpha). Estimators of nu and alpha (nuhat
     and alphahat,respectively) are calculated by means of an iterative
     procedure using these two equations (based on mean and variance
     estimations):


                nuhat/alphahat=(1/n)*sum_i(thetahat_i)



 nuhat/alphahat^2 = (1/(n-1))*sum_i[(1+alphahat/E_i)*(thetahat_i-nuhat/alphahat)^2]

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

     A list of four elements: 

       n: Number of regions.

      nu: Estimation of parameter nu

   alpha: Estimation of parameter alpha

  smthrr: Vector of smoothed relative risks.

    size: Size parameter of the Negative Binomial. It is equal to 

                             widehat{nu}

    prob: It is a vector of probabilities of the Negative Binomial,
          calculated as

                        alphahat/(alphahat+E_i

          .

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

     Clayton, David and Kaldor, John (1987). Empirical Bayes Estimates
     of Age-standardized Relative Risks for Use in Disease Mapping.
     Biometrics 43, 671-681.

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

     library(spdep)

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

     smth<-empbaysmooth(sids$Observed, sids$Expected)

