Learn R Programming

spfilteR (version 2.1.0)

MI.vec: Moran Test for Spatial Autocorrelation

Description

Tests for the presence of spatial autocorrelation in variables as indicated by the Moran coefficient. The variance is calculated under the normality assumption.

Usage

MI.vec(x, W, alternative = "greater", symmetrize = TRUE, na.rm = TRUE)

Value

Returns an object of class data.frame that contains the following information for each variable:

I

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

x

a vector or matrix

W

spatial connectivity matrix

alternative

specification of alternative hypothesis as 'greater' (default), 'lower', or 'two.sided'

symmetrize

symmetrizes the connectivity matrix W by: 1/2 * (W + W') (TRUE/ FALSE)

na.rm

listwise deletion of observations with missing values (TRUE/ FALSE)

Author

Sebastian Juhl

Details

If x is a matrix, this function computes the Moran test for spatial autocorrelation for each column.

References

Cliff, Andrew D. and John K. Ord (1981): Spatial Processes: Models & Applications. Pion, London.

Upton, Graham J. G. and Bernard Fingleton (1985): Spatial Data Analysis by Example, Volume 1. New York, Wiley.

Bivand, Roger S. and David W. S. Wong (2018): Comparing Implementations of Global and Local Indicators of Spatial Association. TEST 27: pp. 716 - 748.

See Also

MI.resid, MI.local

Examples

Run this code
data(fakedata)
X <- cbind(fakedataset$x1, fakedataset$x2, fakedataset$x3)

(MI <- MI.vec(x = X, W = W, alternative = "greater", symmetrize = TRUE))

Run the code above in your browser using DataLab