The function to apply Getis-Ord's local G* statistics

local_gstar(
  w,
  df,
  permutations = 999,
  permutation_method = "complete",
  significance_cutoff = 0.05,
  cpu_threads = 6,
  seed = 123456789
)

Arguments

w

An instance of Weight object

df

A data frame with selected variable only. E.g. guerry["Crm_prs"]

permutations

(optional) The number of permutations for the LISA computation

permutation_method

(optional) The permutation method used for the LISA computation. Options are 'complete', 'lookup'. Default is 'complete'.

significance_cutoff

(optional) A cutoff value for significance p-values to filter not-significant clusters

cpu_threads

(optional) The number of cpu threads used for parallel LISA computation

seed

(optional) The seed for random number generator

Value

An instance of LISA-class

Examples

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_gstar(queen_w,  guerry["Crm_prs"])
lms <- lisa_values(lisa)
lms
#>  [1] 0.014270222 0.015807678 0.015485705 0.008315062 0.009224485 0.008819945
#>  [7] 0.014961277 0.006953285 0.013152942 0.007173126 0.006898546 0.007845469
#> [13] 0.013523322 0.007458852 0.011289400 0.012630942 0.015340884 0.011057393
#> [19] 0.014597110 0.015314172 0.014050381 0.011030881 0.011811302 0.008413883
#> [25] 0.011878745 0.012620950 0.016069618 0.006595570 0.008347058 0.010244797
#> [31] 0.012382889 0.007406347 0.015364123 0.013727734 0.014876307 0.011307545
#> [37] 0.014699000 0.011801400 0.014125401 0.012016630 0.009446979 0.013589716
#> [43] 0.011794136 0.008991930 0.010579653 0.007148765 0.013539907 0.015023811
#> [49] 0.014277631 0.013418811 0.017041222 0.011136808 0.014445073 0.014528019
#> [55] 0.010046286 0.014325708 0.016157879 0.013120245 0.014767580 0.016391423
#> [61] 0.013304133 0.009617901 0.009758617 0.005608600 0.009113563 0.007561237
#> [67] 0.014419926 0.013501073 0.015755475 0.015328760 0.009552577 0.013986432
#> [73] 0.011392248 0.011003674 0.012534774 0.015343101 0.008167716 0.008603441
#> [79] 0.007818946 0.007497836 0.012606384 0.013122855 0.013681762 0.011639370
#> [85] 0.013248815