sp.tau | R Documentation |
Compute the Global Indicators of Mobility Association index Rey (2016)
sp.tau(x, y, W, perm = NULL)
x |
rank variable |
y |
rank variable. |
W |
an object of class |
perm |
number of random spatial permutations for calculation of pseudo p-values, the default value is NULL. |
The Global Indicators of Mobility Association (GIMA) is based on the Spatial Tau indicator (Rey,2004). The implementation is a two step algorith based on the Rey's implementation (Rey,2014)
a vector coantaning
The GIMA statistic value
The GIMA's pseudo p value, only available for perm >0
The number of spatial Concordant pairs
The number of spatial Discordant pairs
The Tau statistic value
The tau's p value
The number of Concordant pairs
The number of Discordant pairs
The number of extra x pairs. An extra x pair is a pair which sgn(x_i - x_j)=0
The number of extra y pairs. An extra y pair is a pair which sgn(y_i - y_j)=0
data(mexico)
n <- nrow(mexico)
w <- matrix(0,n,n)
for(i in 1:n){
w[,i] <- 1*(mexico$Regime[i]==mexico$Regime)
}
diag(w) <- 0
W <- mat2listw(w,style="B")
a <- lapply(1:(ncol(mexico)-2),function(i) sp.tau(mexico[,i],mexico[,(i+1)],W,999))
b<-do.call(rbind.data.frame,a)
colnames(b) <- names(a[[1]])
b <- round(b,3)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.