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

Tomislav Hengl hengl at science.uva.nl
Mon Oct 29 08:43:55 CET 2007



You can also fit a variogram to the residuals using the gstat package and then record the nugget and
sill variation (see http://www.gstat.org/manual/node7.html). I do not know how to test that the
nugget variation is statistically significant from the sill variation. You could split the variogram
cloud into closer points and more distant points and then run some statistical tests on the two
sub-sets (e.g. the t-test). But where to put a boundary between closer/more distant points?

Tom Hengl
http://spatial-analyst.net 



-----Original Message-----
From: r-sig-geo-bounces at stat.math.ethz.ch [mailto:r-sig-geo-bounces at stat.math.ethz.ch] On Behalf Of
Geertje Van der Heijden
Sent: vrijdag 26 oktober 2007 18:12
To: r-sig-geo at stat.math.ethz.ch
Subject: [R-sig-Geo] Spdep: help needed calculating Moran's I

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




More information about the R-sig-Geo mailing list