[R-sig-Geo] Global and Local Moran: how can I calculate them with different spatial threshold?

Roger Bivand Roger.Bivand at nhh.no
Fri Mar 10 21:44:00 CET 2017


On Fri, 10 Mar 2017, Maurizio Marchi wrote:

> Hello everybody,
> I need to calculate the Global and Local Moran indices in R using a
> variable distance as threshold: I have a SpatialPointsDataFrame with
> almost 300 points and I want to calculate the Global Moran index using
> 4 different distances (e.g 5 km - 10 km - 50 km - 100 km).
> I know the 'ape' and 'spdep' packages but it seems that no adjustment
> can be done concerning the spatial width to be considered...

Please examine ?spdep::dnearneigh, especially d1= and d2=, which do 
exactly what you ask for. The functions in spdep are modularised, first 
construct the neighbour object, then the weights list object, then the 
Moran tests. Note that Moran tests should really be run on regression 
residuals (lm.morantest(), localmoran.sad() or localmoran.exact()), and 
remember to adjust p.values for banded local tests (many tests using the 
same data affect tabulated significance levels). The ape function makes 
undocumented assumptions about what you may want, spdep requires that you 
know what you want to do.

Hope this clarifies,

Roger

> Thanks
>
>

-- 
Roger Bivand
Department of Economics, Norwegian School of Economics,
Helleveien 30, N-5045 Bergen, Norway.
voice: +47 55 95 93 55; e-mail: Roger.Bivand at nhh.no
Editor-in-Chief of The R Journal, https://journal.r-project.org/index.html
http://orcid.org/0000-0003-2392-6140
https://scholar.google.no/citations?user=AWeghB0AAAAJ&hl=en
http://depsy.org/person/444584



More information about the R-sig-Geo mailing list