FitMoransI | R Documentation |
Calculate fitted values of Moran's I as linear regression.
FitMoransI(X, Y, I, all = FALSE)
X |
A matrix with observations as rows and features as columns. |
Y |
A matrix of spatial lags. |
I |
A matrix of Moran's I, output by |
all |
Whether to use multivariate Moran's I, default is |
A list containing the following:
residuals, residuals of fitted Moran's I.
fitted.values, fitted values of Moran's I.
all.fitted.values, a three-dimensional tensor of all fitted multivariate Moran's I, if calculated.
all.residuals, a three-dimensional tensor of all residuals using fitted multivariate Moran's I, if calculated.
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) res.fitted <- FitMoransI(res$X, res$Y, res$Morans.I) }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.