OLSMoransI | R Documentation |
Calculate Moran's I as linear regression using ordinary least squares (OLS).
OLSMoransI( X, W, normalize = TRUE, alternative = c("two.sided", "less", "greater"), p.adjust.method = "BH" )
X |
A matrix with observations as rows and features as columns. |
W |
A weight matrix across all observations, i.e inverse of a pairwise distance matrix. |
normalize |
Whether to normalize the weight matrix such that each row adds up to one. Default is |
alternative |
Alternative hypothesis used, default is |
p.adjust.method |
Method used for multiple comparisons correction, default is |
A list containing the following:
Morans.I, the Moran's I.
Z.I, the Z score of Moran's I.
X, data matrix used for calculating Moran's I.
Y, a matrix of spatial lags.
Expected.I, the expectation of Moran's I under the null hypothesis.
SD.I, the standard deviation of Moran's I under the null hypothesis.
p.val, p-values.
p.adj, adjusted p-values.
alternative, alternative hypothesis used.
p.adjust.method, method used for multiple comparisons correction.
Anselin, L. Local indicators of spatial association-LISA. Geogr. Anal. 27, 93–115 (2010)
{ data.use <- quakes[1:100,] W <- 1/as.matrix(dist(data.use[,1:2])) diag(W) <- 0 res <- OLSMoransI(data.use[,3:4], W) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.