# MI.vec: Local Moran Coefficient In spfilteR: Semiparametric Spatial Filtering with Eigenvectors in (Generalized) Linear Models

## Description

Reports the local Moran Coefficient for each unit.

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

## Usage

 ```1 2 3``` ```MI.local(x, W, alternative = "greater") MI.vec(x, W, alternative = "greater", symmetrize = TRUE) ```

## 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).

## Details

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

## Value

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

`Ii`

observed value of local Moran's I

`EIi`

expected value of local Moran coefficients

`VarIi`

variance of local Moran's I

`zIi`

standardized local Moran coefficient

`pIi`

p-value of the test statistic

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

## Note

The calculation of the statistic and its moments follows Anselin (1995) and Sokal et al. (1998).

Estimation of the variance (under the normality assumption) follows Cliff and Ord (1981), see also Upton and Fingleton (1985). It assumes the connectivity matrix W to be symmetric. For inherently non-symmetric matrices, it is recommended to specify `symmetrize=TRUE`.

Sebastian Juhl

Sebastian Juhl

## References

Anselin, Luc (1991): Local Indicators of Spatial Association-LISA. Geographical Analysis, 27 (2): pp. 93 - 115.

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

Sokal, Robert R., Neal L. Oden, Barbara A. Thomson (1998): Local Spatial Autocorrelation in a Biological Model. Geographical Analysis, 30 (4): pp. 331 - 354.

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.

`MI.vec`, `MI.ev`, `MI.sf`, `MI.resid`, `MI.decomp`
`MI.resid`, `MI.local`
 ```1 2 3 4 5 6 7 8 9``` ```data(fakedata) x <- fakedataset\$x2 (MIi <- MI.local(x = x, W = W, alternative = "greater")) data(fakedata) X <- cbind(fakedataset\$x1, fakedataset\$x2, fakedataset\$x3) (MI <- MI.vec(x = X, W = W, alternative = "greater", symmetrize = TRUE)) ```