Skip to content
Back to formatted view

Raw Message

Message-ID: <CANZ=wL3bJdgDv_HOVHRwhzx2AQNEG5VR9Qr=_C2KWY5GrFt1mg@mail.gmail.com>
Date: 2019-03-06T21:31:35Z
From: Jay Wang
Subject: inference of local Gi* using permutations

Hello,

I am currently using the localG () in spdep package, I was wondering if we
can have a conditional permutation-based inference to get the P value for
every Gi*. I saw that a Mote Carlo simulation is used in Moran.MC(), and I
borrowed the following codes from this function and tried to see if I can
do a permutation for localG():

pvals<-matrix(0, nrow = V, ncol = 1)
for (i in 1:V){
  rankresi<-rank(res[i, ])
  xranki <- rankresi[length(res[i, ])]
  diffi <- nsim - xranki
  diffi <- ifelse(diffi > 0, diffi, 0)
  pvali <- punif((diffi + 1)/(nsim + 1))
  pvals[i,]<-pvali
}

After running these codes with several different datasets, I found that all
the negative Gi*s have very high P values say 0.999 with 999 permutations,
meaning that there are no significant cold spots. Where is the problem? How
can we do conditional permutation-based inference for localG() with R
spdep? I understand the critics of permutation-based inference for local
indicators, but I just want to explore this. Thank you!

Best

	[[alternative HTML version deleted]]