Local Moran's I per polygon + quadrant + 999-permutation significance
Source:R/mrm_lisa.R
mrm_tps_lisa.RdLocal Moran's I per polygon + quadrant + 999-permutation significance
Usage
mrm_tps_lisa(
data,
count_col,
lat_col = "lat",
lon_col = "lon",
id_col = NULL,
k = 6L,
n_permutations = 999L,
seed = 42L
)Arguments
- data
data.frame with one row per polygon.
- count_col
Column with per-polygon counts (e.g. "ASSAULT_2024").
- lat_col, lon_col
WGS84 centroid columns.
- id_col
Optional polygon-ID column (passed through to output).
- k
k-NN spatial-weights neighbourhood (default 6).
- n_permutations
MC permutations (default 999, the spatial-statistics convention).
- seed
RNG seed.
Value
A list with elements n_polygons, global_moran_I,
permutations, knn_k, table (per-polygon
data.frame), quadrants_all, quadrants_significant_p05,
n_significant_p05.
Examples
if (FALSE) {
ncr <- read.csv("Neighbourhood_Crime_Rates_Open_Data.csv")
res <- mrm_tps_lisa(ncr,
count_col = "ASSAULT_2024",
lat_col = "lat", lon_col = "lon"
)
}