View source: R/local-joincount-univariate.R
local_joincount_uni | R Documentation |
The univariate local join count statistic is used to identify clusters of rarely occurring binary variables. The binary variable of interest should occur less than half of the time.
local_joincount_uni(
fx,
chosen,
listw,
alternative = "two.sided",
nsim = 199,
iseed = NULL,
no_repeat_in_row=FALSE
)
fx |
a binary variable either numeric or logical |
chosen |
a scalar character containing the level of |
listw |
a listw object containing binary weights created, for example, with |
alternative |
default |
nsim |
the number of conditional permutation simulations |
iseed |
default NULL, used to set the seed; the output will only be reproducible if the count of CPU cores across which computation is distributed is the same |
no_repeat_in_row |
default |
The local join count statistic requires a binary weights list which can be generated with nb2listw(nb, style = "B")
. Additionally, ensure that the binary variable of interest is rarely occurring in no more than half of observations.
P-values are estimated using a conditional permutation approach. This creates a reference distribution from which the observed statistic is compared. For more see Geoda Glossary.
a data.frame
with two columns BB
and Pr()
and number of rows equal to the length of x
.
Josiah Parry josiah.parry@gmail.com
Anselin, L., & Li, X. (2019). Operational Local Join Count Statistics for Cluster Detection. Journal of geographical systems, 21(2), 189–210. \Sexpr[results=rd]{tools:::Rd_expr_doi("10.1007/s10109-019-00299-x")}
data(oldcol)
fx <- as.factor(ifelse(COL.OLD$CRIME < 35, "low-crime", "high-crime"))
listw <- nb2listw(COL.nb, style = "B")
set.seed(1)
(res <- local_joincount_uni(fx, chosen = "high-crime", listw))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.