[R-sig-Geo] localmoran p-values with/without permutation

Danlin Yu yud at mail.montclair.edu
Sun Feb 15 15:57:57 CET 2009


Valerio:

For a local Moran's I, a randomization approximation is probably not a 
good idea since for each permutation, the mean and variance (which are 
used to calculated the p-values) of a specific location will change, 
which causes the randomized p-values not poolable (in global Moran's 
case, however, randomization will not change the global mean and variance).

The p-values will be somewhat inflated (pseudo-significant), a not 
significant local autocorrelation might become significant because of 
the reuse of the local samples, hence there is a p.adjust() function 
with various adjustment options. I would be very reluctant to use a 
non-adjusted p-value to judge for local significance. Depending on your 
data and research, you could choose one that suits your purpose the best 
(or try a few and see which ones make more sense as in an exploratory way).

Hope this helps.

Danlin Yu

Valerio Bartolino ??:
> Dear list,
> I've the objective to identify hotspot areas from a model prediction
> over a high resolution grid. After calculating a spatial weight object I
> easily applied the localmoran function from the spdep library. It's not
> really clear to me the meaning of the p-values associated to the
> localmoran function and how much I can rely on them in terms of
> statistical significance. For instance can I use these p-values instead
> using a randomization approach? I would be glad for any clarification.
>
> Moreover, I want to calculate a statistical significance also through a
> randomization approach (commonly used with Moran's I statistic). The
> idea behind the randomization is rather simple, and also coding doesn't
> seem too difficult, but the identified hotspots appear larger and
> disaggregated respect those identified looking at the p-values provided
> by the localmoran function at a similar significant level.
>
> Did I do some mistake in the following code I wrote for the permutation?
> Thanks for any advice, explanation or comment you will have
>
> Valerio Bartolino
>
> ###########################################
> require(spdep)
>
> locMoranI.perm <- function(x, R, listw, ...){
>
> # x is a vector of the values on which to calculate the MoranI statistic
> # R, listw, ... are all the arguments passed to the localmoran function
>
> 	mat <- matrix(data=NA, nrow=R, ncol=length(x))
> 		for(i in 1:R){
> 		perm <- sample(x, replace=F)
> 		I.locmor <- localmoran(perm, listw, ...)
> 		mat[i,] <- I.locmor[,1]
> 		rm(I.locmor)
> 		rm(perm)
> 		}
>
> 	return(mat)
> }
>
> # I used this new function as follow:
> nsim <- 1000
> I.perm <- locMoranI.perm(z, R=nsim, listw=nbw)
>
> MorI <- localmoran(z, listw=nbw)
>
> # select for instance a 0.01 pseudo-significance level
> p.perm <- apply(I.perm, 2, quantile, probs=0.99)
>
> ## because I-Moran identify spatial clustering
> ## high and low hotspots have no distinct I values
> ## make a vector to distinguish significant and high hotspots
> hot <- ifelse(p.perm-MorI[,1]<0 & z>mean(z),1,0)
>
> _______________________________________________
> R-sig-Geo mailing list
> R-sig-Geo at stat.math.ethz.ch
> https://stat.ethz.ch/mailman/listinfo/r-sig-geo
>   

-- 
___________________________________________
Danlin Yu, Ph.D.
Assistant Professor
Department of Earth & Environmental Studies
Montclair State University
Montclair, NJ, 07043
Tel: 973-655-4313
Fax: 973-655-4072
email: yud at mail.montclair.edu
webpage: csam.montclair.edu/~yu



More information about the R-sig-Geo mailing list