Skip to content
Prev 34014 / 398513 Next

spatial correlation test

At 18:48 30/06/2003, Martin Wegmann wrote:
This functions require a list of spatial weights for each geographical 
unit. To construct this list, you must firstly establish the neighborhood 
relationships (who are the neighbors of a point). There are different ways 
to construct this neighborhood: based on distances (dnearneigh), number of 
nearest neighbors (knearneigh)... Then, you must transform this 
neighborhood to weights (see nb2listw for example). Here is a small example 
requiring the tripack library based on tesselation and voronoi mosaic to 
create the neighboorhood:

xy=matrix(rnorm(20),5,2)
z=rnorm(5)
library(spdep)

mynb=tri2nb(xy)
mylw=nb2listw(mynb)

geary.mc(z,mylw,10)

         Monte-Carlo simulation of Geary's C

data:  z
weights: mylw
number of simulations + 1: 11

There is no simplest method.....


statistic = 0.8384, observed rank = 2, p-value = 0.1818
alternative hypothesis: less