sp.tau: Global Indicators of Mobility Association (GIMA)

View source: R/sp.tau.R

sp.tauR Documentation

Global Indicators of Mobility Association (GIMA)

Description

Compute the Global Indicators of Mobility Association index Rey (2016)

Usage

sp.tau(x, y, W, perm = NULL)

Arguments

x

rank variable

y

rank variable.

W

an object of class listw

perm

number of random spatial permutations for calculation of pseudo p-values, the default value is NULL.

Details

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)

Value

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

Examples

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)



amvallone/estdaR documentation built on March 30, 2024, 9:38 p.m.