Skip to content
Prev 27112 / 29559 Next

inference of local Gi* using permutations

On Wed, 6 Mar 2019, Jay Wang wrote:

            
Monte Carlo or Hope type tests or permutation bootstraps work like 
analytical permutation in the global case, and are redundant for that 
reason. Monte Carlo (conditional permutation) in the local case requires 
that there is no global autocorrelation or other mis-specifications.

Your code snippet is not an example, and I think is not how permutation is 
actually done. In the local case in ArcGIS, GeoDa, etc., you fix the value 
of interest at i, randomly re-assign all the values to the other 
observations, and recompute the local indicator at i, doing this say 499 
times. Then you move on to the next i, and repeat. In your snippet, we 
cannot see where res is coming from. Is this an n by nsim matrix from nsim 
runs? Might you be needing to compare the sample values with the observed 
value? If you are outputting Z-values of G_i anyway, you may need to step 
back to the actual G_i (here from spdep):

attr(localG(..., return_internals=TRUE), "internals")[,1]

Then

mns <- apply(res, 1, mean)
sds <- apply(res, 1, sd)
permZ <- (obs_localG - mns)/sds

are z values that can be considered as drawn from the normal. However, I 
advise against inference unless the assumptions are met, and p-values must 
be adjusted anyway.

Roger