Skip to contents

Given two continuous numeric variables, calculate the bivariate Moran's I.

Usage

global_moran_bv(x, y, nb, wt, nsim = 99)

Arguments

x

a numeric vector of same length as nb.

y

a numeric vector of 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().

nsim

the number of simulations to run.

Details

\( I_B = \frac{\Sigma_i(\Sigma_j{w_{ij}y_j\times x_i})}{\Sigma_i{x_i^2}} \)

See also

Examples

x <- guerry_nb$crime_pers
y <- guerry_nb$wealth
nb <- guerry_nb$nb
wt <- guerry_nb$wt
global_moran_bv(x, y, nb, wt)
#> $Ib
#> [1] -0.1006674
#> 
#> $p_sim
#> [1] 0.04
#>