The function to apply local Moran statistics
local_moran(
w,
df,
permutations = 999,
permutation_method = "complete",
significance_cutoff = 0.05,
cpu_threads = 6,
seed = 123456789
)
An instance of Weight object
A data frame with only selected variable. E.g. guerry["Crm_prs"]
(optional) The number of permutations for the LISA computation
(optional) The permutation method used for the LISA computation. Options are ('complete', 'lookup'). Default is 'complete'.
(optional) A cutoff value for significance p-values to filter not-significant clusters
(optional) The number of cpu threads used for parallel LISA computation
(optional) The seed for random number generator
An instance of LISA-class
library(sf)
guerry_path <- system.file("extdata", "Guerry.shp", package = "rgeoda")
guerry <- st_read(guerry_path)
#> Reading layer `Guerry' from data source
#> `/Users/runner/work/_temp/Library/rgeoda/extdata/Guerry.shp'
#> using driver `ESRI Shapefile'
#> Simple feature collection with 85 features and 29 fields
#> Geometry type: MULTIPOLYGON
#> Dimension: XY
#> Bounding box: xmin: 47680 ymin: 1703258 xmax: 1031401 ymax: 2677441
#> Projected CRS: NTF (Paris) / Lambert zone II
queen_w <- queen_weights(guerry)
lisa <- local_moran(queen_w, guerry["Crm_prs"])
lms <- lisa_values(lisa)
lms
#> [1] 0.516120231 0.818275138 0.794086560 0.733161543 0.228467334
#> [6] 0.829040272 0.615280448 1.627415446 -0.019525625 0.687081885
#> [11] 1.707896579 0.821748275 -0.213568315 0.291316827 -0.184833414
#> [16] -0.047198613 0.249972417 0.054411195 0.862095943 0.835368441
#> [21] 0.538432168 -0.050446242 -0.681022658 0.678851849 -0.105369231
#> [26] 0.038567922 1.116236578 1.168138859 0.162030880 0.069037225
#> [31] 0.021522359 1.000255304 0.276308094 0.423159405 -0.101271972
#> [36] 0.015647332 0.554846307 -0.027584417 0.111200075 -0.082994402
#> [41] 0.281817532 -0.048962443 -0.015839144 0.830286100 -0.160743989
#> [46] 1.597607483 0.396712769 0.862342357 -0.466396879 0.262343383
#> [51] 1.424738721 -0.379247703 0.388066026 0.316231271 0.068795845
#> [56] 0.405538158 0.977019076 0.202610060 0.714533504 0.601447598
#> [61] -0.177594467 0.229608404 0.284505927 2.247991283 0.532787318
#> [66] 1.039424040 -0.129846379 0.136565215 1.033851456 1.238521154
#> [71] 0.296054062 -0.167632280 -0.041663121 0.036396148 -0.055081083
#> [76] 1.166507105 0.773315084 0.523682291 0.851277285 0.884651013
#> [81] 0.025497212 -0.326497225 -0.306819894 0.001277301 -0.125219240