[R] Newbie Question: Spatial Autocorrelation with R Tutorial?

Roger Bivand Roger.Bivand at nhh.no
Fri Aug 27 09:58:43 CEST 2004

On Wed, 25 Aug 2004, Jeff Hollister wrote:

> Howdy All,
> I am looking for some good tutorials (books, websites, whatever) for
> calculating/testing for Spatial Autocorrelation using R.
> Specifically, I am wanting to test for autocorrelation of a number of
> variables measured at a set of discrete locations.

>From your signature line, "Environmental Data", spatial autocorrelation 
could mean a number of things, depending on whether the variables could be 
measurements of a continuous surface of values at your discrete locations, 
or whether the discrete locations are "spatial entities" formed as areal 
aggregations of some kind. Since you mention spdep below, I'm assuming 
that the data you are working on refer to "spatial entities", for which 
Moran's I would be a reasonable choice of test. If the variable of 
interest isn't of this form, then other packages are more relevant (see R 
spatial projects link below).

> Up to this point I have been exploring the "spdep" package and I can get
> "moran.test" to work, but I am concerned that somewhere along the line I
> may not be doing things correctly.  Hence my request for a tutorial so
> that I may brush up on my autocorrelation basics, specifically
> autocorrelation with R, and reassure myself that the results I am
> getting aren't bogus.

Admittedly, the help page for moran.test() simply refers to Cliff, A. D., 
Ord, J. K. 1981 Spatial processes, Pion, p. 21 as the original source, and 
the "sids" vignette (see the foot of the output of help(package=spdep) to 
locate it on your system) is incomplete. My guess is however that if your 
data are for "spatial entities", theb constructing a sensible 
neighbour weights is at least 75% of the work - you will also see this in 
Virgilio Gómez-Rubio's "DCluster" package, and the existing "sids" 
vignette does cover that a little. Completing and improving this vignette 
is on my TODO list.

If you are unsure of the result, and want to stay within the R framework, 
consider calculating Moran's I using DCluster, or gearymoran() in "ade4". 
Beyond that, you could access the GeoDa software (Windows, not R) and 
documentation at http://sal.agecon.uiuc.edu/csiss/geoda.html, the site 
also housing the R spatial projects web pages:


Please contact me off-list, or on the R-sig-geo list if you feel that 
would help.

Best wishes,

Roger Bivand

> Thanks in advance for any suggestions!
> Jeff Hollister
> *****************************************************
> Jeffrey William Hollister                          
> Ph.D. Candidate                                      
> Environmental Data Center                       
> Department of Natural Resources Science  
> University of Rhode Island                           
> office: (401) 874 5054
> fax: (401) 874 4561
> cell: (401)556 4087
> http://www.edc.uri.edu/personal/jeff/home/jwh_cv_full.htm
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html

Roger Bivand
Economic Geography Section, Department of Economics, Norwegian School of
Economics and Business Administration, Breiviksveien 40, N-5045 Bergen,
Norway. voice: +47 55 95 93 55; fax +47 55 95 93 93
e-mail: Roger.Bivand at nhh.no

More information about the R-help mailing list