> For the complete documentation index, see [llms.txt](https://xunli.gitbook.io/postgeoda/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/postgeoda/4.-lisa-multivariate/4.3-multivariate-local-join-coun.md).

# 4.4 Multivariate Local Join Count

Co-location Local Join Count

Multivariate or colocation local join count ([2019](https://geodacenter.github.io/workbook/6d_local_discrete/lab6d.html#ref-AnselinLi:18)) works when two or more events happen in the same location (e.g., a city block that is both low-density and commercial, or a parcel that can be single family/multifamily, or owned/rented). It can be used to identify *positive* spatial autocorrelation. For more information, please read [http://geodacenter.github.io/workbook/6a\_local\_auto/lab6a.html](https://geodacenter.github.io/workbook/6d_local_discrete/lab6d.html#bivariate-local-join-count-statistic)

## local\_multijoincount()

{% hint style="info" %}
local\_multijoincount() is a PostgreSQL WINDOW function. Please call it  with an OVER clause.
{% endhint %}

### Synopsis

Short version:

```sql
float[] local_multijoincount(anyarray vals, bytea weights)
```

Full version:

```sql
float[] local_multijoincount(anyarray vals, bytea weights,
    integer permutations, 
    character varying permutation_method,
    float significance_cutoff, 
    integer cpu_threads, 
    integer seed)
```

### Arguments

| Name                 | Type              | Description                                                                                                |
| -------------------- | ----------------- | ---------------------------------------------------------------------------------------------------------- |
| vals                 | *anyarray*        | an array of numeric columns that contains the binary values (e.g. 0 and 1) for LISA statistics             |
| weights              | bytea             | the bytea column that stores the spatial weights information                                               |
| permutations         | integer           | the number of permutations for the LISA computation. Default: 999.                                         |
| permutation\_method  | character varying | the permutation method used for the LISA computation. Options are 'complete', 'lookup'. Default: 'lookup'. |
| significance\_cutoff | float             | the cutoff value for significance p-values to filter not-significant clusters. Default: 0.05.              |
| cpu\_threads         | integer           | the number of cpu threads used for parallel LISA computation. Default: 6.                                  |
| seed                 | integer           | the seed for random number generator used in LISA statistics. Default: 123456789.                          |

### Return

| Type     | Description                                                                                          |
| -------- | ---------------------------------------------------------------------------------------------------- |
| float\[] | an array contains 3 values, which are {'local join count',  'pseudo-p value', 'number of neighbors'} |

{% hint style="info" %}
The results do NOT have 'category indicator'.
{% endhint %}
