Learn R Programming

spdep (version 0.1-10)

EBest: Global Empirical Bayes estimator

Description

The function computes global empirical Bayes estimates for rates "shrunk" to the overall mean.

Usage

EBest(n, x)

Arguments

n
a numeric vector of counts of cases
x
a numeric vector of populations at risk

Value

  • A data frame with two columns:
  • rawa numerical vector of raw (crude) rates
  • estmma numerical vector of empirical Bayes estimates
  • and a parameters attribute list with components:
  • aglobal method of moments phi value
  • mglobal method of moments gamma value

Details

Details of the implementation are to be found in Marshall, p. 284--5, and Bailey and Gatrell p. 303--306 and exercise 8.2, pp. 328--330.

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

EBlocal, probmap, EBImoran.mc

Examples

Run this code
data(auckland)
res <- EBest(auckland$Deaths.1977.85, 9*auckland$Under.5.1981)
attr(res, "parameters")
res.f <- as.ordered(cut(res$estmm*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="Global moment estimator of infant mortality per 1000 per year")

Run the code above in your browser using DataLab