Learn R Programming

spdep (version 0.1-10)

EBImoran.mc: Permutation test for empirical Bayes index

Description

An empirical Bayes index modification of Moran's I for testing for spatial autocorrelation in a rate, typically the number of observed cases in a population at risk. The index value is tested by using nsim random permutations of the index for the given spatial weighting scheme, to establish the rank of the observed statistic in relation to the nsim simulated values.

Usage

EBImoran.mc(n, x, listw, nsim, zero.policy = FALSE, 
 alternative = "greater", spChk=NULL)

Arguments

n
a numeric vector of counts of cases the same length as the neighbours list in listw
x
a numeric vector of populations at risk the same length as the neighbours list in listw
listw
a listw object created for example by nb2listw
nsim
number of permutations
zero.policy
if TRUE assign zero to the lagged value of zones without neighbours, if FALSE assign NA
alternative
a character string specifying the alternative hypothesis, must be one of greater (default), less or two.sided
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 list with class htest and mc.sim containing the following components:
  • statisticthe value of the observed Moran's I.
  • parameterthe rank of the observed Moran's I.
  • p.valuethe pseudo p-value of the test.
  • alternativea character string describing the alternative hypothesis.
  • methoda character string giving the method used.
  • data.namea character string giving the name(s) of the data, and the number of simulations.
  • resnsim simulated values of statistic, final value is observed statistic
  • za numerical vector of Empirical Bayes indices as z above

item

  • z
  • nn
  • S0

Details

The statistic used is (m is the number of observations): $$EBI = \frac{m}{\sum_{i=1}^{m}\sum_{j=1}^{m}w_{ij}} \frac{\sum_{i=1}^{m}\sum_{j=1}^{m}w_{ij}z_i z_j}{\sum_{i=1}^{m}(z_i - \bar{z})^2}$$ where: $$z_i = \frac{p_i - b}{\sqrt{v_i}}$$ and: $$p_i = n_i / x_i$$ $$v_i = a + (b / x_i)$$ $$b = \sum_{i=1}^{m} n_i / \sum_{i=1}^{m} x_i$$ $$a = s^2 - b / (\sum_{i=1}^{m} x_i / m)$$ $$s^2 = \sum_{i=1}^{m} x_i (p_i - b)^2 / \sum_{i=1}^{m} x_i$$

References

Assun��o RM, Reis EA 1999 A new proposal to adjust Moran's I for population density. Statistics in Medicine 18, pp. 2147--2162

See Also

moran, moran.mc, EBest

Examples

Run this code
data(nc.sids)
EBImoran.mc(spNamedVec("SID74", nc.sids), spNamedVec("BIR74", nc.sids),
 nb2listw(sidsorig.nb, style="B", zero.policy=TRUE), nsim=999,
 zero.policy=TRUE)
sids.p <- nc.sids$SID74 / nc.sids$BIR74
names(sids.p) <- rownames(nc.sids)
moran.mc(sids.p, nb2listw(sidsorig.nb, style="B", zero.policy=TRUE),
 nsim=999, zero.policy=TRUE)

Run the code above in your browser using DataLab