local_moran: Calculate the Local Moran's I Statistic

View source: R/lisa.R

local_moranR Documentation

Calculate the Local Moran's I Statistic

Description

Moran's I is calculated for each polygon based on the neighbor and weight lists.

Usage

local_moran(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

The number of simulations to run.

...

See ?spdep::localmoran_perm() for more options.

Details

local_moran() calls spdep::localmoran_perm() and calculates the Moran I for each polygon. As well as provide simulated p-values.

Value

a data.frame containing the columns ii, eii, var_ii, z_ii, p_ii, p_ii_sim, and p_folded_sim. For more details please see spdep::localmoran_perm().

See Also

Other stats: st_lag()

Examples

local_moran(guerry_nb$crime_pers, guerry_nb$nb, guerry_nb$wt)

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