Juliann, For a p-value for the global Moran I think you could do a permutation test, something like this:
library(raster) r <- raster(nrows=10, ncols=10) r[] <- 1:ncell(r) M <- Moran(r) s <- r n <- 100 m <- rep(NA, n) for (i in 1:n) { values(s) <- sample(values(s)) m[i] <- Moran(s) } p <- sum(m > M) / n This may take a while for a large raster. I do not know how you determine p values for the local measure. Have a look at spdep. Robert On Tue, Feb 26, 2013 at 1:01 PM, Empty Empty <phytophthor...@yahoo.com>wrote: > Hi, > > I am trying to do some spatial analysis on raster data sets. I am able to > calculate global and local Moran's I. But I am trying to figure out how to > get z-values and significance levels. The output of local Moran is a raster > map of Moran's I values (I believe). I'd like to be able to identify, not > just where there are clusters, but where those are significant, so another > raster of p-values would be ideal. Any ideas? > > library(raster) > r<- raster("sample.tif") #import rasters from geotif files > Moran(r) #gives global Moran's I value, but not p-value > MLr<-MoranLocal(r) #local Moran's I - output is a raster map > plot(MLr) > > Thanks a lot, > Juliann > > [[alternative HTML version deleted]] > > > _______________________________________________ > R-sig-Geo mailing list > R-sig-Geo@r-project.org > https://stat.ethz.ch/mailman/listinfo/r-sig-geo > > [[alternative HTML version deleted]] _______________________________________________ R-sig-Geo mailing list R-sig-Geo@r-project.org https://stat.ethz.ch/mailman/listinfo/r-sig-geo