global_jc_perm: Global Join Counts

View source: R/global-measures.R

global_jc_permR Documentation

Global Join Counts

Description

Calculate global join count measure for a categorical variable.

Usage

global_jc_perm(
  fx,
  nb,
  wt,
  alternative = "greater",
  nsim = 499,
  allow_zero = FALSE,
  ...
)

global_jc_test(fx, nb, wt, alternative = "greater", allow_zero = NULL, ...)

tally_jc(fx, nb, wt, allow_zero = TRUE, ...)

Arguments

fx

a factor or character vector of the same length as nb.

nb

a neighbor list object for example as created by st_contiguity().

wt

a weights list as created by st_weights().

alternative

default "two.sided". Should be one of "greater", "less", or "two.sided" to specify the alternative hypothesis.

nsim

number of simulations to run.

allow_zero

If TRUE, assigns zero as lagged value to zone without neighbors.

...

additional arguments passed to methods

Details

  • global_jc_perm() implements the monte-carlo based join count using spdep::joincount.mc()

  • global_jc_test() implements the traditional BB join count statistic using spdep::joincount.test()

  • tally_jc() calculated join counts for a variable fx and returns a data.frame using spdep::joincount.multi()

Value

an object of class jclist which is a list where each element is of class htest and mc.sim.

Examples

geo <- sf::st_geometry(guerry)
nb <- st_contiguity(geo)
wt <- st_weights(nb, style = "B")
fx <- guerry$region
global_jc_perm(fx, nb, wt)

global_jc_test(fx, nb, wt)

tally_jc(fx, nb, wt)

sfdep documentation built on Jan. 11, 2023, 9:08 a.m.