Learn R Programming

sdsfun (version 0.8.0)

moran_test: global spatial autocorrelation test

Description

global spatial autocorrelation test

Usage

moran_test(sfj, wt = NULL, alternative = "greater", symmetrize = FALSE)

Value

A list utilizing a result tibble to store the following information for each variable:

MoranI

observed value of the Moran coefficient

EI

expected value of Moran's I

VarI

variance of Moran's I (under normality)

ZI

standardized Moran coefficient

PI

p-value of the test statistic

Arguments

sfj

An sf object or can be converted to sf by sf::st_as_sf().

wt

(optional) Spatial weight matrix. Must be a matrix class. If wt is not provided, sdsfun will use a first-order queen adjacency binary matrix.

alternative

(optional) Specification of alternative hypothesis as greater (default), lower, or two.sided.

symmetrize

(optional) Whether or not to symmetrize the asymmetrical spatial weight matrix wt by: 1/2 * (wt + wt'). Default is FALSE.

Examples

Run this code
gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun'))
moran_test(gzma)

Run the code above in your browser using DataLab