I have some coding and theoretical questions regarding the Moran's I index and the R + spdep packages.
- To illustrate the situation of the sampling plot:
http://users.pandora.be/requested/thesis/a1grid.gif
(coordinates in lat lon projection, point size representative for sample value)
- The data distribution:
http://users.pandora.be/requested/thesis/hista1.gif (haven't tested for normality yet)
=> My method to get my Moran's I index in R + spdep:
a1.knn <- knearneigh(a1$coords, k=4, lonlat=TRUE) #with a1$coords the latlon coords out of a geoR geodata file
a1.nb <- knn2nb(a1.knn) # conversion to nb object
a1.listw <- nb2listw(a1.nb) # conversion to listw object, requested for moran.test()
results <- moran.test(a1$data, a1.listw, randomization=FALSE, alternative="two.sided")
The results show the following statistics:
moran.test(a1$data, a1.listw, randomisation=FALSE, alternative="two.sided")
Moran's I test under normality
data: a1$data weights: a1.listw
Moran I statistic standard deviate = 0.2911, p-value = 0.771
alternative hypothesis: two.sided
sample estimates:
Moran I statistic Expectation Variance
-0.03762590 -0.08333333 0.02464896With a Moran's I of -0.04 and a p-value of 0.771 I would say this isn't much of a statistic or not exactly what I expected.
I would think that since I evaluate ecological/biophysical paramters it wouldn't be possible to get negative correlations since in vegetations there is always some kind of autocorrelation involved. It could be just a little but certainly not negative.
Strange thing is that I get the same weights in my weights class of my a1.listw file
a1.listw$weights
[[1]] [1] 0.25 0.25 0.25 0.25
[[2]] [1] 0.25 0.25 0.25 0.25
[[3]] [1] 0.25 0.25 0.25 0.25 ...
I think it has something to do with the k-value in knearneigh(), but even if I change it to 8 (changing from bishops/rooks to queens case?) they stay the same. Any idea why this is the case?
So maybe the strange statistics could be a problem of a faulty weights matrix. So if you have any comments on the code/method used it would be appreciated.
Best regards, Koen.
-- * To post a message to the list, send it to [EMAIL PROTECTED] * As a general service to the users, please remember to post a summary of any useful responses to your questions. * To unsubscribe, send an email to [EMAIL PROTECTED] with no subject and "unsubscribe ai-geostats" followed by "end" on the next line in the message body. DO NOT SEND Subscribe/Unsubscribe requests to the list * Support to the list is provided at http://www.ai-geostats.org
