EBlocal                package:spdep                R Documentation

_L_o_c_a_l _E_m_p_i_r_i_c_a_l _B_a_y_e_s _e_s_t_i_m_a_t_o_r

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

     The function computes local empirical Bayes estimates for rates
     "shrunk" to a neighbourhood mean for neighbourhoods given by the
     'nb' neighbourhood list.

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

     EBlocal(ri, ni, nb, zero.policy = FALSE, spChk = NULL, geoda=FALSE)

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

      ri: a numeric vector of counts of cases the same length as the
          neighbours list in nb

      ni: a numeric vector of populations at risk the same length as
          the neighbours list in nb

      nb: a 'nb' object of neighbour relationships

zero.policy: if TRUE assign zero to the lagged value of zones without
          neighbours, if FALSE assign NA

   spChk: should the data vector names be checked against the spatial
          objects for identity integrity, TRUE, or FALSE, default NULL
          to use 'get.spChkOption()'

   geoda: default=FALSE, following Marshall's algorithm as interpreted
          by Bailey and Gatrell, pp. 305-307, and exercise 8.2, pp.
          328-330 for the definition of phi; TRUE for the definition of
          phi used in GeoDa (see discussion on OpenSpace mailing list
          June 2003:
          http://agec221.agecon.uiuc.edu/pipermail/openspace/2003-June/
          thread.html)

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

     Details of the implementation are to be found in Marshall, p. 286,
     and Bailey and Gatrell p. 307 and exercise 8.2, pp. 328-330. The
     example results do not fully correspond to the sources because of
     slightly differing neighbourhoods, but are generally close.

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

     A data frame with two columns: 

     raw: a numerical vector of raw (crude) rates

     est: a numerical vector of local empirical Bayes estimates

       a: a numerical vector of local phi values

       m: a numerical vector of local gamma values

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

     Roger Bivand Roger.Bivand@nhh.no, based on contributions by
     Marilia Carvalho

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

     Marshall R M (1991) Mapping disease and mortality rates using
     Empirical Bayes Estimators, Applied Statistics, 40, 283-294;
     Bailey T, Gatrell A (1995) Interactive Spatial Data Analysis,
     Harlow: Longman, pp. 303-306.

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

     'EBest', 'probmap'

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

     data(auckland)
     res <- EBlocal(spNamedVec("Deaths.1977.85", auckland),
      9*spNamedVec("Under.5.1981", auckland), auckland.nb)
     brks <- c(-Inf,2,2.5,3,3.5,Inf)
     cols <- grey(6:2/7)
     library(maptools)
     plot(auckpolys, col=cols[findInterval(res$est*1000, brks)], forcefill=FALSE)
     legend(c(70,90), c(70,95), fill=cols, legend=leglabs(brks), bty="n")
     title(main="Local moment estimator of infant mortality per 1000 per year")

