[R] spatial correlation test
Roger Bivand
Roger.Bivand at nhh.no
Mon Jun 30 19:59:43 CEST 2003
(I think Barry Rowlingson replied off-list, both his advice and Stéphane
Dray's reply are relevant)
On Mon, 30 Jun 2003, Martin Wegmann wrote:
> On Monday 30 June 2003 15:23, Barry Rowlingson wrote:
> > Think you may be looking at the wrong sort of spatial correlation! For
> > Geary tests you are comparing 'adjacent' objects, where adjacency is
> > defined however you want - N-nearest neighbours, shared border between
> > regions etc etc.
>
> sorry, I misunderstood the purpose of geary's I test, thanks for this info.
>
> > When you say 'sampled data' it sounds more like you've got samples
> > taken at locations, and you want to investigate spatial correlation as a
> > function of distance between samples? Am I guessing right?
>
> Yes you are right. I want to look for spatial correlation of my samples as a
> function of distances between sampling sites (x,y coords).
>
> > Take a look at some of the R kriging libraries, which will have
> > functions to plot variograms. This is a plot of something like
> > E(|Y_i - Y_j|) against distance.
> >
> > Baz
>
> I found variograms() and correlograms(), but is there a way to get the a
> p-value for spatial correlation?
> additionaly I found sp.correlogram() but again with this mysterious "nb
> class".
>
There is a literature that you will find referenced on help pages of the
functions that you are interested in. For geary.test(), the reference is:
Cliff, A. D., Ord, J. K. 1981 Spatial processes, Pion, p. 21.
For sp.correlogram(): Cliff, A. D., Ord, J. K. 1981 Spatial processes,
Pion, pp. 118-122, Martin, R. L., Oeppen, J. E. 1975 The identification
of regional forecasting models using space-time correlation functions,
Transactions of the Institute of British Geographers, 66, 95-118.
These are the places to look first. For nb2listw() - Tiefelsdorf, M.,
Griffith, D. A., Boots, B. 1999 A variance-stabilizing coding scheme for
spatial link matrices, Environment and Planning A, 31, pp. 165-180.
The "nb" class defines neighbour relations needed to carry out further
calculations, and is "a list of integer vectors containing neighbour
region number ids", quoting its documentation in the example Stéphane
Dray used, tri2nb() to generate neighbours from points by triangulation.
If your point data are not areal but are sampled from a possibly
continuous surface, then, as Barry Rowlingson suggested, you could look at
one or other of the geostatistical packages, for example sgeostat.
However, asking for a p-value implies that you are testing some kind of a
hypothesis, doesn't it?
It is possible to do Moran tests within a testing framework in
sp.correlogram(), and indeed to provide nb2listw() with inverse distance
weights, but it isn't clear that this would answer your underlying
research question.
Roger
--
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