Skip to content

Spatial auto-correlation globally (sphere)

4 messages · Roger Bivand, Rolando Valdez, Alex Mandel

#
Has anyone seen a method for creating a neighbor list, for use in
spatial auto-correlation tests, that treats the earth as a sphere so
that relationships can go shortest distance. I'm trying to make a
neighbor list of all countries in the world.

Yes I realize that the relatedness may not be distance and I might
weight on some other factor but I need the neighbor list to start.

Example, US <-> Japan, China or Russia should be a line across the Pacific

Perhaps I need to develop the neighbor list using some sort of social
diagramming tool instead.

Any leads would be appreciated.

Thanks,
Alex
#
On Sun, 23 Mar 2014, Alex Mandel wrote:

            
Please start by specifying the support you intend to use (centroid point 
support, polygonal support, what?). If point support, setting longlat=TRUE 
in dnearneigh() in spdep with a matrix of coordinates, or using an object 
inheriting from SpatialPoints with the appropriate CRS will give you Great 
Circle distances; polygons are more complicated. Have you looked at the 
cshapes package, also mentioned in the Spatial Task View, which appears to 
do what you want to do? It has an R Journal article:

http://journal.r-project.org/archive/2010-1/RJournal_2010-1_Weidmann+Skrede~Gleditsch.pdf

Roger

  
    
#
Hi,

I?m not sure what kind of data you have. I work with shapes layers.

Without more information, I expose you what have I done with my data:
Checking rgeos availability: TRUE
Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
   1021    4359    8492   13510   15290  273900
Characteristics of weights list object:
Neighbour list object:
Number of regions: 345 
Number of nonzero links: 3296 
Percentage nonzero weights: 2.769166 
Average number of links: 9.553623 
64 regions with no links:
1 2 3 4 25 26 27 28 29 30 31 32 33 34 35 36 37 38 42 44 45 46 47 48 49 56 57 61 62 63 65 66 86 87 88 93 149 150 152 166 167 168 170 172 177 179 228 229 236 237 239 241 242 243 244 284 285 291 298 309 314 315 334 335
Link number distribution:

 0  1  2  3  4  5  6  7  8  9 10 11 12 13 14 15 16 17 18 19 20 21 26 27 28 29 30 31 33 
64 30 21 11 15 20 14 10  9 10 15 12  7  8 10 11 12  9  5 11  2  3  2  1  2  2  4  1  3 
34 35 36 37 38 
 7  3  3  5  3 
30 least connected regions:
23 24 40 41 58 59 60 64 148 151 181 202 212 213 224 225 226 227 230 231 232 233 234 235 294 308 322 325 329 333 with 1 link
3 most connected regions:
262 275 282 with 38 links

Weights style: W 
Weights constants summary:
    n    nn  S0       S1       S2
W 281 78961 281 126.7744 1149.688

After that, you can to do the autocorrelation test (Moran test) with your statistical data:
Moran's I test under randomisation

data:  datos$ind_alim  
weights: l20  

Moran I statistic standard deviate = 3.762, p-value = 8.428e-05
alternative hypothesis: greater
sample estimates:
Moran I statistic       Expectation          Variance 
      0.135908714      -0.003571429       0.001374638

Other option you have, is to create the neighbor list object with GeoDa.

Hope this example helps,

Regards. 

Inicio del mensaje reenviado:
Rolando Valdez
#
Thanks it looks like cshapes might be exactly what I was looking for and
more. I thought I knew what most of the Spatial packages were for,
clearly there are still a few more to wander through. It's odd that the
Task View pages don't have the same short description lines next to
packages the way the normal package list on the website does.

I think I was leaning towards polygons, I wasn't sure since the wrapping
of the dateline was the bigger problem to solve in my mind.
Cshapes has an interesting way of doing that where they look for the
nearest 2 nodes that make up the borders rather than directly testing
polygons or line edges. So it's really all points then.

The reason for the package is actually quite similar what I planned to
do with it so that paper you linked is very useful.

Thanks,
Alex
On 03/23/2014 02:41 PM, Roger Bivand wrote: