> For the complete documentation index, see [llms.txt](https://xunli.gitbook.io/jsgeoda/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://xunli.gitbook.io/jsgeoda/local-spatial-autocorrelation/local-getis-ord-g.md).

# Local Getis-Ord G

The local Getis-Ord statistic is a ratio of the weighted average of the values in the neighboring locations to the sum of all values. It is called local g or local g\*, when not including the value at the location. In local g/g\*, a value larger than the mean (or, a positive value for a standardized z-value) suggests a High-High cluster or hot spot, a value smaller than the mean (or, negative for a z-value) indicates a Low-Low cluster or cold spot. For more information, please read: <https://geodacenter.github.io/workbook/6b_local_adv/lab6b.html#getis-ord-statistics>

{% hint style="info" %}
In contrast to the Local Moran and Local Geary statistics, the Getis-Ord approach does not consider spatial outliers.
{% endhint %}

**CONTENTS**

1. localG() and localGStar()

## localG()

```sql
function localG(
    WeightResult w,
    Array val,
    Number permutations, 
    String permutation_method,
    NUmber significance_cutoff, 
    Number seed)
```

## localGStar()

```sql
function localGStar(
    WeightResult w,
    Array val,
    Number permutations, 
    String permutation_method,
    NUmber significance_cutoff, 
    Number seed)
```

### Arguments

| Name                 | Type           | Description                                                                                                |
| -------------------- | -------------- | ---------------------------------------------------------------------------------------------------------- |
| w                    | *WeightResult* | the WeightResult object created from weights function                                                      |
| val                  | Array          | the values of a selected variable                                                                          |
| permutations         | Number         | the number of permutations for the LISA computation. Default: 999.                                         |
| permutation\_method  | String         | the permutation method used for the LISA computation. Options are 'complete', 'lookup'. Default: 'lookup'. |
| significance\_cutoff | Number         | the cutoff value for significance p-values to filter not-significant clusters. Default: 0.05.              |
| seed                 | Number         | the seed for random number generator used in LISA statistics. Default: 123456789.                          |

### Return

| Type       | Description                                                                                                                  |
| ---------- | ---------------------------------------------------------------------------------------------------------------------------- |
| LisaResult | The LisaResult object contains the results of LISA computation: *pvalues, clusters, lisa\_values, neighbors, labels, colors* |

**Try it yourself in the playground (jsgeoda + deck.gl):**

{% embed url="<https://codesandbox.io/s/5lisaunivariate-zhhop>" %}
