Learn R Programming

sfdep (version 0.2.5)

global_g_test: Getis-Ord Global G

Description

Getis-Ord Global G

Usage

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

Value

an htest object

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().

Examples

Run this code
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)

Run the code above in your browser using DataLab