global_g_test: Getis-Ord Global G

View source: R/global-measures.R

global_g_testR Documentation

Getis-Ord Global G

Description

Getis-Ord Global G

Usage

global_g_test(x, nb, wt, alternative = "greater", allow_zero = NULL, ...)

Arguments

x

A numeric vector.

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.

allow_zero

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

...

additional methods passed to spdep::globalG.test().

Value

an htest object

Examples

geo <- sf::st_geometry(guerry)
nb <- st_contiguity(geo)
wt <- st_weights(nb, style = "B")
x <- guerry$crime_pers
global_g_test(x, nb, wt)

sfdep documentation built on Sept. 13, 2024, 5:07 p.m.