Skip to contents

Assuncao-Reis adjustment of Moran I for rates from heterogeneous populations. With cases \(O_i\), populations \(n_i\), raw rates \(p_i = O_i/n_i\): \(b = \sum O / \sum n\), \(s^2 = \sum n_i (p_i - b)^2 / \sum n\), \(a = \max(0, s^2 - b/(\sum n / m))\), \(v_i = a + b/n_i\), \(z_i = (p_i - b)/\sqrt{v_i}\), and Moran I is computed on the centred z: \(EBI = (m/S_0) \sum_i \tilde z_i (W\tilde z)_i / \sum_i \tilde z_i^2\).

Usage

empirical_bayes_moran(cases, population, W)

Arguments

cases

Event counts, length m.

population

Population at risk, length m, strictly positive.

W

Spatial weights matrix, m by m.

Value

List with statistic (EBI), z, rates, eb_rates, a, b, s2, S0, n.

References

Assuncao, R. M. and Reis, E. A. (1999). A new proposal to adjust Moran I for population density. Statistics in Medicine, 18(16), 2147-2162.

Bivand, R. S., Pebesma, E. and Gomez-Rubio, V. (2013). Applied Spatial Data Analysis with R, 2nd ed., Springer, Sec. 9.3, p. 282. Local PDF: WD_BLACK/library/pdf/bivand2013.pdf.

Reference implementation spdep EBImoran.mc, EBest (CRAN); the subtract-mean-in-numerator convention (spdep default since 2016) is adopted.

Examples

W <- matrix(0, 4, 4); W[cbind(1:3, 2:4)] <- 1; W[cbind(2:4, 1:3)] <- 1
empirical_bayes_moran(c(5, 2, 9, 4), c(200, 90, 400, 150), W)
#> $statistic
#> [1] -0.3753188
#> 
#> $z
#> [1]  0.10910895 -0.09759001 -0.16973368  0.22677868
#> 
#> $rates
#> [1] 0.02500000 0.02222222 0.02250000 0.02666667
#> 
#> $eb_rates
#> [1] 0.02380952 0.02380952 0.02380952 0.02380952
#> 
#> $a
#> [1] 0
#> 
#> $b
#> [1] 0.02380952
#> 
#> $s2
#> [1] 2.881708e-06
#> 
#> $S0
#> [1] 6
#> 
#> $n
#> [1] 4
#> 
#> $method
#> [1] "Assuncao-Reis EB-standardized Moran I"
#>