4.3 Bivariate Local Join Count

No-colocation Local Join Count

Bivariate or no-colocation local join count (2019) only works when two events cannot happen in the same location (e.g., a zoning classification, or a case-control design). It can be used to identify negative spatial autocorrelation, i.e., evidence of spatial outliers. For more information, please read http://geodacenter.github.io/workbook/6a_local_auto/lab6a.html

local_bijoincount()

local_bijoincount() is a PostgreSQL WINDOW function. Please call it with an OVER clause.

Synopsis

Short version:

float[] local_bijoincount(real val1, numeric val2, bytea weights)

Full version:

float[] local_bijoincount(numeric val1, numeric val2, bytea weights,
    integer permutations, 
    character varying permutation_method,
    float significance_cutoff, 
    integer cpu_threads, 
    integer seed)

Arguments

Name

Type

Description

val1

numeric

the first numeric column that contains the binary values (e.g. 0 and 1) for LISA statistics

val1

numeric

the second numeric column 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'}

The results do NOT have 'category indicator'.

Examples

Apply bivariate local join count statistics on the variable "death_dum" (dummy variable for death incidence, dataset 'deaths_nd_by_house'), and "1 - death_dum" using distance-based weights "d20" (distance cutoff value = 20 meters):

  • Create weights:

-- add a new column 'd20' first
-- ALTER TABLE deaths_nd_by_house ADD COLUMN d20 bytea
UPDATE deaths_nd_by_house SET d20 = w.distance_weights
FROM (
  SELECT 
    gid, 
    distance_weights(gid, ST_Transform(the_geom, 27700), 20.0) 
  OVER() FROM deaths_nd_by_house
) AS w 
WHERE deaths_nd_by_house.gid = w.gid

When importing the dataset to PostgresSQL, the projection could be changed (e.g. using EPSG: 4326). In this example, we need to use ST_Transform(geom, srid) to project the points from EPSG 4326 to EPSG 27700 (unit: meter) so that we can create distance weights using 20.0 meters as the cutoff value.

  • apply local_bijoincount()

SELECT local_bijoincount(death_dum, (1-death_dum), d20) OVER() FROM deaths_nd_by_house;

 local_joincount 
-----------------
 {0,-1,11}
 {0,-1,11}
 {0,-1,12}
 {0,-1,12}
 {7,0.009,14}
 {6,0.021,12}
 {7,0.005,13}
 {5,0.079,13}
 ...

Last updated