powered by
Getis-Ord Global G
global_g_test(x, nb, wt, alternative = "greater", allow_zero = NULL, ...)
an htest object
htest
A numeric vector.
a neighbor list object for example as created by st_contiguity().
st_contiguity()
a weights list as created by st_weights().
st_weights()
default "two.sided". Should be one of "greater", "less", or "two.sided" to specify the alternative hypothesis.
"two.sided"
"greater"
"less"
If TRUE, assigns zero as lagged value to zone without neighbors.
TRUE
additional methods passed to spdep::globalG.test().
spdep::globalG.test()
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