The R package robspdep is a collection of functions and tests for robust spatial autocorrelation fully compatible with spdep. It include global and local Robust Moran and GK presented in Nardelli and Arbia (2024).
The package is work in progress and it is not available in the CRAN. However you can install it directly from the github repo.
# The easiest way to get robspdep is to install it from GitHub:
# install.packages("devtools")
devtools::install_github("vincnardelli/robspdep")
This is a basic example which shows you how use robspdep and compare the results obtained with spdep:
library(spdep)
library(robspdep)
moran.mc(sampledata$x, sampledata$w, nsim=999)
moran.mc(sampledata$y, sampledata$w, nsim=999)
robustmoran(sampledata$x, sampledata$w)
robustmoran(sampledata$y, sampledata$w)
gk(sampledata$x,sampledata$w)
gk(sampledata$y,sampledata$w)
Nardelli, Vincenzo, and Giuseppe Arbia. "On Robust Measures of Spatial Correlation." arXiv preprint arXiv:2402.07297 (2024).