On Sun, 14 Mar 2004, Koen Hufkens wrote:
> Hi list,
>
> 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)
First, thanks for including links to your figures, makes helping easier.
>
>
> => 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()
Note that you have called nb2listw() with the default style, which is
row-standardised ("W") - so with 4 neighbours for each object, all thw
weights will be 1/4. With style="B", the weights would all be 1. This
isn't a full analogy of a rook pattern, because those around the edges
will already be queen style or more. Look at plot(a1.nb, a1$coords) to see
this.
>
> 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.02464896
>
> With 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.
>
Well, looking at your figure (just eyeballing), there are quite a lot of
big/small neighbours as well as small/small and big/big. Did you try
looking at a Moran scatterplot to get a feel for what is going on?
moran.plot() is the function to try. I think you'll see that all four
quadrants of the plot have observations, leading to a very flat and
non-significant relationships. Maybe this is because the k-nearest
neighbours weights are not reflecting what you want - could you try using
dnearneigh() for the appropriate number of km instead, or use edit.nb() to
cut out the possibly disturbing long links?
> 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.
Note that it is still greater than its expectation (which shows that you
only have the 13 observations shown on the figure), but with the variance
you have is not significantly different from its expectation. Why did you
use normality rather than randomisation (or Monte Carlo)? With so few
observations, this may be an issue.
>
> Strange thing is that I get the same weights in my weights class of my
> a1.listw file
>
Explained above - this was what you asked for. For distance weighted see
nbdists(), though your points are regularly spaced.
> > 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
>
--
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: [EMAIL PROTECTED]
--
* 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