> 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-join-count.md).

# Local Join Count

Local join count ([2019](https://geodacenter.github.io/workbook/6d_local_discrete/lab6d.html#ref-AnselinLi:18)) is a local spatial autocorrelation statistic for binary variables (e.g. 0 and 1). It can be used to identify co-occurrences of uncommon events, i.e., situations where observations that take on the value of 1 constitute much less than half of the sample. For more information, please read <http://geodacenter.github.io/workbook/6a_local_auto/lab6a.html>

## localJoinCount()

```sql
function localJoinCount(
    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 numeric column that contains the binary values (e.g. 0 and 1) for LISA statistics                      |
| 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>" %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://xunli.gitbook.io/jsgeoda/local-spatial-autocorrelation/local-join-count.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
