[R-sig-Geo] newbie: Moran's I

Jeffrey Stratford stratja at auburn.edu
Fri Nov 3 13:21:37 CET 2006


Does anyone have an example of estimating Moran's I from a file with
point (not polygon) data?  I'm getting close(r) but I still have a few

Here's my code so far:

ctpoints <- read.csv("c:\\Georgia\\xy.csv", header=TRUE)
# only two columns containing the long-lat data 
neigh <- tri2nb(ctpoints)
plot (neigh, ctpoints)
nblist <- nb2listw(neigh, glist=NULL, style="W", zero.policy=FALSE)
????? <- spNamedVec("?????", ctpoints)
gamoran <- moran(?????, nblist, n, S0, zero.policy=FALSE, NAOK=FALSE)   

I'm not sure what goes where I have "?????".  And yup, I did a
help(spNamedVec) but I'm not sure how to translate that material to my

Eventually, I would like to run a number of Poisson or negative binomial
regressions linking avian species richness to landscape variables around
the same points where I surveyed birds. See
http://web6.duc.auburn.edu/~stratja/georgia.pdf (map showing points on a
LANDSAT map) to get an idea of the proximity and location of points.
Since I will eventually incorporate spatial effects into my regressions
should I change the file to one that contains the coordinates, the bird
data, and the landscape data? 

Many thanks (again),


Jeffrey A. Stratford, Ph.D.
Postdoctoral Associate
331 Funchess Hall
Department of Biological Sciences
Auburn University
Auburn, AL 36849
FAX 334-844-9234

More information about the R-sig-Geo mailing list