Whether high values of one variable sit next to high values of another
(Wartenberg 1985): with zx and zy
the centred values, I = n / S0 sum_ij w_ij zx_i zy_j / sqrt(sum zx^2 sum zy^2), which is Moran's I (gmoran()) when y is x (proved in
Lean: see proof("bvmor")) and, with row-standardised weights,
spdep::moran_bv()'s statistic. Inference is by permutation: y's
values are shuffled over the units nsim times from seed while x
stays, so under the null its expectation is 0. The statistic mixes the
two variables' correlation at a unit with their spatial association; it
is not a test of spillover from x to y.
Arguments
- x, y
The two variables: finite numbers, one per unit, neither constant.
- w
The weights:
spwt()'s list, an spdeplistwobject, or ann x nmatrix of weights from 0 (zero diagonal).- nsim
The number of permutations: a whole number from 0.
- seed
NULLto draw the simulations' seed from R's generator (soset.seed()fixes them), or one whole number from 0.
Value
A named numeric vector: i, mean and sd (of the permuted
statistics), z ((i - mean) / sd), p ((1 + #{I* >= I}) / (nsim + 1)) and ptwo ((1 + min(#{I* >= I}, #{I* <= I})) / (nsim + 1));
NaN without permutations.
References
Wartenberg, D. (1985). Multivariate spatial correlation: a method for exploratory geographical analysis. Geographical Analysis, 17(4), 263-283. doi:10.1111/j.1538-4632.1985.tb00849.x