Learn R Programming

spdep (version 0.1-10)

EBlocal: Local Empirical Bayes estimator

Description

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

Usage

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

Arguments

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

Value

  • A data frame with two columns:
  • rawa numerical vector of raw (crude) rates
  • esta numerical vector of local empirical Bayes estimates
  • and a parameters attribute list with components:
  • aa numerical vector of local phi values
  • ma numerical vector of local gamma values

Details

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.

References

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.

See Also

EBest, probmap

Examples

Run this code
data(auckland)
res <- EBlocal(spNamedVec("Deaths.1977.85", auckland),
 9*spNamedVec("Under.5.1981", auckland), auckland.nb)
res.f <- as.ordered(cut(res$est*1000, breaks=c(-Inf,2,2.5,3,3.5,Inf),
 include.lowest=TRUE))
cols <- grey(6:2/7)
plotpolys(auckpolys, auckbbs, col=cols[codes(res.f)])
legend(c(70,90), c(70,95), fill=cols, legend=levels(res.f), bty="n")
title(main="Local moment estimator of infant mortality per 1000 per year")

Run the code above in your browser using DataLab