[R-sig-Geo] Spdep: help needed calculating Moran's I

Roger Bivand Roger.Bivand at nhh.no
Fri Oct 26 19:40:32 CEST 2007


On Fri, 26 Oct 2007, Sam Field wrote:

> The value of the Moran's I will always depend on how the spatial weight 
> matrix is defined (and thus more specifically on your choice of an upper 
> bound for dnearneigh()).  I don't know if there are any statistical 
> criteria for choosing an upper bound - I imagine somebody has looked 
> into this - I usually use a substantively grounded criteria.  Ask 
> yourself, for example, at what distance is interaction between proximate 
> geographic units no longer possible?  What is generating (do you think) 
> the spatial autocorrelation in residual species richness?  What 
> important variables have you left out and on what spatial scale do their 
> influences operate?
>
> The other, technical consideration, is to pick a number that does not 
> generate very many spatial isolates (i.e. geographic units with no 
> neighbors).
>

This is good advice. A third possibility, given that you have to make an 
a-priori choice which neighbours are proximate neighbours, is to use your 
original everyone-in binary weights, but to generalise them as inverse 
distance weights - see the example using nbdists() on the nb2listw() help 
page, using the glist= argument. Then nearer neighbours get more weight, 
ones further away less weight (you will also need the longlat=TRUE 
argument).

Roger


>
>
> hope this helps!
>
> Sam
>
>
>
> Quoting Geertje Van der Heijden <g.m.f.vanderheijden04 at leeds.ac.uk>:
>
>> Hi,
>>
>> I have just posted the same question on the general R help mailing list,
>> but thought that this list might be more appropriate. I am a new user of
>> R.
>>
>> Here is my problem:
>> I have 58 sites from across South America. I have done a regression
>> analysis to relate environmental and biogeographical variables to
>> species richness and want to test whether my residuals are
>> autocorrelated. As far as I understand the Moran's I, I have to take all
>> possible combinations between all points into account to test this. So I
>> have used dnearneigh() with the lower boundary set to 0 and the upper
>> boundary set arbitrarily high to make sure all connections are included.
>>
>>
>>> coords <- as.matrix(cbind(lowland$long, lowland$lat))
>>> coord.nb <- dnearneigh(coords, 0, 10000, longlat=TRUE)
>>> coord.list <- nb2listw(coord.nb, style="W")
>>> lianasp.lm <- lm(lianasprich ~ log(averdist) + dsl + lianadens +
>> wooddens)
>>> lm.morantest(lianasp.lm, coord.list, alternative="two.sided")
>>
>> However, this gives me a Moran's I which is exactly the same as the
>> expected Moran's I (and hence a p-value of 1). If I change the lower or
>> upper boundary slightly so that not all possible links are taken into
>> account, the value is different, but still really near to the expected
>> Moran's I. I don't understand why these values are or the same or nearly
>> so.
>>
>> I am new to spatial statistics, so this might me a really basic question
>> and my appologies if it is, but I am generally a bit at a loss now about
>> the Moran's I and I am wondering if I have calculated it right. Have
>> used to right method to convert my coordinates into neighbourhood
>> distances (and if not, which method should I have used) and am I
>> understanding and calculation the Moran's I correctly?
>>
>> Any help would be greatly appreciated.
>>
>> Many thanks,
>> Geertje
>>
>> ~~~~
>> Geertje van der Heijden
>> PhD student
>> Tropical Ecology
>> School of Geography
>> University of Leeds
>> Leeds LS2 9JT
>>
>> Tel: (+44)(0)113 3433345
>> Email: g.m.f.vanderheijden04 at leeds.ac.uk
>>
>>
>>
>> 	[[alternative HTML version deleted]]
>>
>> _______________________________________________
>> R-sig-Geo mailing list
>> R-sig-Geo at stat.math.ethz.ch
>> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>>
>>
>
>
>

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




More information about the R-sig-Geo mailing list