[R-sig-Geo] Specifying neighbourhood structure for Spatial Eigenvector Mapping (SEVM) using ME() in spdep
Xingli Giam
xingli.giam at adelaide.edu.au
Tue Jan 27 09:38:42 CET 2009
Dear people of the R-sig-Geo list,
I am very interested in the Spatial Eigenvector Mapping (SEVM) method in
analysing my spatial data as described in your papers (Griffith and Peres-Neto
2006, Dormann et al. 2007).
However I am rather new to spatial analysis and therefore have some questions
regarding the script provided in the appendix of Dormann et al. 2007.
Code
nb1.0 <- dnearneigh(coordinates(snouter_sp), 0, 1.0)
nb1.0_dists <- nbdists(nb1.0, coordinates(snouter_sp))
nb1.0_sims <- lapply(nb1.0_dists, function(x) (1-((x/4)^2)) )
ME.listw <- nb2listw(nb1.0, glist=nb1.0_sims, style="B")
sevm1 <- ME(snouter1.1 ~ rain + djungle, data=snouter.df, family=gaussian,
listw=ME.listw)
# modify the arguments "family" according to your error distribution
I hope someone who has experience in suing SEVM can give me a hand with some of
the questions I have.
Regarding the weights, is it imperative for me to use (1-((x/4t)^2)? Can we
just do an inverse weighting system like (1/x)? Can I also use weighted (C or
W) instead of binary (B) weighting in this line -ME.listw <- nb2listw(nb1.0,
glist=nb1.0_sims, style="B")? Lastly, can I specify t, the threshold distance
instead of using a spanning tree algorithm?
Some background information about my data - it is in long-lat coordinates, and
I have calculated great circle distances.
And the code I was trying to use:
nb <- dnearneigh(as.matrix(dat$x_long, dat$y_lat), 0, 4000, longlat=T)
nb_dists <- nbdists(nb, as.matrix(dat$x_long, dat$y_lat))
nb_sims <- lapply(nb_dists, function(x) (1/x))
ME.listw <- nb2listw(nb, glist=nb_sims, style="W", zero.policy=T)
sevm1 <- ME(lg.sp1 ~ lg.area, data=dat, family=gaussian, listw=ME.listw)
lmlag1 <- lm(lg.sp1 ~ lg.area + fitted(sevm1), data=dat)
moran<- moran.test(residuals(lmlag1), listw=ME.listw, na.action=na.omit,
zero.policy=T)
moran
Thank you in advance for your help! Hope to hear from you soon!
Many thanks,
Xingli
--
Xingli Giam
Research Visitor
Research Institute of Climate Change and Sustainability
School of Earth and Environmental Sciences
The University of Adelaide
Mobile: +61 (0) 425 150 966
Email: xingli.giam at adelaide.edu.au
Alt email: giam at nus.edu.sg
and
M.Sc. Candidate
Department of Biological Sciences
National University of Singapore
(on study leave till 30 June 2009)
More information about the R-sig-Geo
mailing list