moran_test | R Documentation |
Spatial autocorrelation test based on global moran index.
moran_test(sfj, wt = NULL, alternative = "greater", symmetrize = FALSE)
sfj |
An |
wt |
(optional) Spatial weight matrix. Must be a |
alternative |
(optional) Specification of alternative hypothesis as |
symmetrize |
(optional) Whether or not to symmetrize the asymmetrical spatial weight matrix
wt by: 1/2 * (wt + wt'). Default is |
A list with moran_test
class and result stored on the result
tibble.
Which contains 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
This is a C++
implementation of the MI.vec
function in spfilteR
package,
and embellishes the console output.
The return result of this function is actually a list
, please access the result
tibble using $result
.
The non-numeric columns of the attribute columns in sfj
are ignored.
gzma = sf::read_sf(system.file('extdata/gzma.gpkg',package = 'sdsfun'))
moran_test(gzma)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.