Skip to contents

Global Moran Permutation Test

Usage

global_moran_perm(x, nb, wt, alternative = "two.sided", nsim = 499, ...)

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.

nsim

number of simulations to run.

...

additional arguments passed to spdep::moran.mc()

Value

an object of classes htest, and mc.sim.

See also

Examples

nb <- guerry_nb$nb
wt <- guerry_nb$wt
x <- guerry_nb$crime_pers
moran <- global_moran_perm(x, nb, wt)
moran
#> 
#> 	Monte-Carlo simulation of Moran I
#> 
#> data:  x 
#> weights: listw  
#> number of simulations + 1: 500 
#> 
#> statistic = 0.41146, observed rank = 500, p-value < 2.2e-16
#> alternative hypothesis: two.sided
#>