gLocal
Performs the Gi or Gi* statistic on the x column of the dataframe.DataFrame
the dataframe to perform the G statistic on
String
The column name we want to perform hotspot analysis on
String
The column name containing the neighbors array. The array should be of type
Array<Struct<value: T, neighbor: U>>, where each element is a Struct with two fields:value: The weight for the neighbor (e.g., spatial weight).neighbor: A Struct containing the data of the neighboring row (schema must match the parent row, excluding the neighbors/weights column itself). You can usewherobots.weighing.add_distance_band_columnto generate this column in the required format.
Int
Not used. Permutation tests are not supported yet. The number of permutations to use for the significance test.
Boolean
Specifies whether to calculate the Getis-Ord Gi* statistic.
true: Calculates the Gi* statistic, which includes the focal observation (the row itself) in the local sum. Whenstar=true, theweightsarray must include the focal observation as one of its own neighbors.false: (Default) Calculates the G-statistic, which excludes the focal observation.
Double
Not used. The weight for the simulated neighbor used for records without a neighbor in perm tests
Returns
A DataFrame with the original columns plus the following additional columns:Double
The calculated local G or G* statistic.
Double
The expected value of G/G* under spatial randomness.
Double
The variance of G/G* under spatial randomness.
Double
The Z-score (standard score) for the statistic.
Double
The p-value (significance) derived from the Z-score.

