Performs a statistical test for spatial autocorrelation using Moran's I. Returns the test statistic, expected value, standard deviation, and p-value.
Usage
moranI_test(
x,
W,
alternative = c("greater", "less", "two.sided"),
standardize = TRUE
)Arguments
- x
Numeric vector of values.
- W
Square numeric matrix of spatial weights.
- alternative
Character string specifying the alternative hypothesis. One of "greater" (default), "less", or "two.sided".
"greater": Test for positive spatial autocorrelation (similar values cluster together)"less": Test for negative spatial autocorrelation (dissimilar values are neighbors)"two.sided": Test for any spatial autocorrelation
- standardize
Logical. If TRUE (default), row-standardize weights.