Learn R Programming

spdep (version 0.1-10)

probmap: Probability mapping for rates

Description

The function returns a data frame of rates for counts in populations at risk with crude rates, expected counts of cases, relative risks, and Poisson probabilities.

Usage

probmap(n, x)

Arguments

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

Value

  • rawraw (crude) rates
  • expCountexpected counts of cases assuming global rate
  • relRiskrelative risks: ratio of observed and expected counts of cases multiplied by 100
  • pmapPoisson probability map values: probablility of getting a more ``extreme'' count than actually observed - here two-tailed, with extreme tails indicating ``unusual'' values

Details

The function returns a data frame, from which rates may be mapped after class intervals have been chosen. The class intervals used in the examples are mostly taken from the referenced source.

References

Bailey T, Gatrell A (1995) Interactive Spatial Data Analysis, Harlow: Longman, pp. 300--303.

See Also

EBest, EBlocal, ppois

Examples

Run this code
data(auckland)
res <- probmap(auckland$Deaths.1977.85, 9*auckland$Under.5.1981)
res.f <- as.ordered(cut(res$raw*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="Crude (raw) estimates of infant mortality per 1000 per year")
res.f <- as.ordered(cut(res$relRisk, breaks=c(-Inf,47,83,118,154,190,Inf),
 include.lowest=TRUE))
cols <- cm.colors(6)
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="Standardised mortality ratios for Auckland child deaths")
res.f <- as.ordered(cut(res$pmap, breaks=c(0,0.05,0.1,0.2,0.8,0.9,0.95,1),
 include.lowest=TRUE))
cols <- cm.colors(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="Poisson probabilities for Auckland child mortality")

Run the code above in your browser using DataLab