[GRASS-stats] Re: R, Moran index, getis e ord.....
Gabriele N.
gis.gn at libero.it
Tue Oct 12 10:54:06 EDT 2010
Hi Roger....and thanks.
It works .... :)
I have 3 other questions.
I followed your instructions (raster index_water_2009):
> library(spgrass6)
> gmeta6()
> execGRASS("g.region", parameters=list(res="150"))
> iw<-readRAST6("index_water_2009")
> GT <- slot(iw, "grid")
> library(spdep)
> # Distance-based nearest neighbors list = dnearneigh
> nb_rook <- dnearneigh(coordinates(iw), 0, mean(slot(GT,"cellsize"))*1.05)
1) here I did not understand how is used the function Neighbourhood
contiguity by distance (I have seen the help(dnearneigh) )
> summary(iw)
> mt <- moran.test(iw$index_water_2009, nb2listw(nb_rook),
> na.action=na.omit)
> mt
Moran's I test under randomisation
data: iw$index_water_2009
weights: nb2listw(nb_rook)
Moran I statistic standard deviate = 633.2733, p-value < 2.2e-16
alternative hypothesis: greater
sample estimates:
Moran I statistic Expectation Variance
9.745175e-01 -4.723063e-06 2.368106e-06
2) I would now create a new raster (always starting with index_water_2009)
containing in the pixel the value of Moran (from -1 to 1).
3) I would do the same for Getis and Ord.
How can I do this?
Thank you very much.
Gabriele
--
View this message in context: http://osgeo-org.1803224.n2.nabble.com/R-Moran-index-getis-e-ord-tp5610836p5627018.html
Sent from the Grass - Stats mailing list archive at Nabble.com.
More information about the grass-stats
mailing list