library(spData)library(spdep)# KNNk4.48<-knn2nb(knearneigh(as.matrix(centers48), k =4))# Moran I testmoran.test(x = arrests48$Assault, listw =nb2listw(k4.48))
Moran I test under randomisation
data: arrests48$Assault
weights: nb2listw(k4.48)
Moran I statistic standard deviate = 3.4216, p-value = 0.0003113
alternative hypothesis: greater
sample estimates:
Moran I statistic Expectation Variance
0.294385644 -0.021276596 0.008511253
# Permutation test for Moran's I statisticmoran.mc(x = arrests48$Assault, listw =nb2listw(k4.48), nsim =499)
Monte-Carlo simulation of Moran I
data: arrests48$Assault
weights: nb2listw(k4.48)
number of simulations + 1: 500
statistic = 0.29439, observed rank = 499, p-value = 0.002
alternative hypothesis: greater
Blangiardo, Marta, Michela Cameletti, Gianluca Baio, 和 Håvard Rue. 2013. 《Spatial and spatio-temporal models with R-INLA》. Spatial and Spatio-temporal Epidemiology 7 (十二月): 39–55. https://doi.org/10.1016/j.sste.2013.07.003.
Cabral, Rafael, David Bolin, 和 Håvard Rue. 2022. 《Controlling the Flexibility of Non-Gaussian Processes Through Shrinkage Priors》. Bayesian Analysis -1 (-1): 1–24. https://doi.org/10.1214/22-BA1342.
Donegan, Connor. 2022. 《geostan: An R package for Bayesian spatialanalysis》. Journal of Open Source Software 7 (79): 4716. https://doi.org/10.21105/joss.04716.
Moraga, Paula. 2020. Geospatial health data: modeling and visualization with R-INLA and Shiny. Boca Raton, Florida: Chapman; Hall/CRC. https://www.paulamoraga.com/book-geospatial/.
Morris, Mitzi, Katherine Wheeler-Martin, Dan Simpson, Stephen J. Mooney, Andrew Gelman, 和 Charles DiMaggio. 2019. 《Bayesian hierarchical spatial models: Implementing the Besag York Mollié model in stan》. Spatial and Spatio-temporal Epidemiology 31 (十一月): 100301. https://doi.org/10.1016/j.sste.2019.100301.
Tobler, Waldo. 1970. 《A computer movie simulating urban growth in the Detroit region》. Economic Geography 46 (Supplement): 234–40. https://doi.org/10.2307/143141.