View source: R/global-colocation-impl.R
global_colocation | R Documentation |
Calculate the Global Colocation Quotient (CLQ) for a categorical variable using simulation based significance testing.
global_colocation(A, nb, nsim = 99)
A |
a character or factor vector. |
nb |
a neighbors list e.g. created by |
nsim |
default |
The CLQ is defined as CLQ_{Global} = \frac{\sum_{A \in X} C_{A \to A}}{\sum_{A \in X} N_A ({\frac{N_A - 1}{N-1})}}
. The numerator identifies the observed proportion of same-category neighbors while the denominator contains the expected proportion of same-category neighbors under the assumption of no spatial association. Thus the CLQ is just a ratio of observed to expected.
Inference is done using conditional permutation as suggested by Anselin 1995 where a number of replicates are created. The observed values are compared to the replicates and a the simulated p-value is the proportion of cases where the observed is more extreme as compared to replicate. The simulated p-value returns the lower p-value of either tail.
Given that the CLQ is a ratio of the observed to expected, we interpret values larger than one to mean that there is more colocation than to be expected under the null hypothesis of no spatial association. When the value is smaller than 0, we interpret it to mean that there is less colocation than expected under the null.
A list of two elements CLQ
and p_sim
containing the observed colocation quotient and the simulated p-value respectively.
Leslie, T.F. and Kronenfeld, B.J. (2011), The Colocation Quotient: A New Measure of Spatial Association Between Categorical Subsets of Points. Geographical Analysis, 43: 306-326. \Sexpr[results=rd]{tools:::Rd_expr_doi("https://doi.org/10.1111/j.1538-4632.2011.00821.x")}
A <- guerry$main_city
nb <- st_contiguity(sf::st_geometry(guerry))
global_colocation(A, nb, 49)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.