Datos
library(readxl)
BD_MODELADO <- read_excel("BD_MODELADO.xlsx")
View(BD_MODELADO)
#EN R
Indice de Moran Ce7
library(ape)
plot(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE,col=BD_MODELADO$Avg_CEa_07,pch=16,cex=1.3)
ce75.dists = as.matrix(dist(cbind(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE)))
ce75.dists.inv<-1/ce75.dists
diag(ce75.dists.inv)<-0
ce75.dists.inv[1:5,1:5]
## 1 2 3 4 5
## 1 0.00000000 0.19320482 0.02207833 0.05403989 0.04558763
## 2 0.19320482 0.00000000 0.02476496 0.04650837 0.05738726
## 3 0.02207833 0.02476496 0.00000000 0.01665161 0.03039597
## 4 0.05403989 0.04650837 0.01665161 0.00000000 0.03392139
## 5 0.04558763 0.05738726 0.03039597 0.03392139 0.00000000
Moran.I(BD_MODELADO$Avg_CEa_07,ce75.dists.inv)
## $observed
## [1] 0.2687468
##
## $expected
## [1] -0.003205128
##
## $sd
## [1] 0.004665906
##
## $p.value
## [1] 0
#Si hay dependencia espacial
Indice de Moran Ce150
plot(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE,col=BD_MODELADO$Avg_CEa_15,pch=16,cex=1.3)
ce15.dists = as.matrix(dist(cbind(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE)))
ce15.dists.inv<-1/ce15.dists
diag(ce15.dists.inv)<-0
ce15.dists.inv[1:5,1:5]
## 1 2 3 4 5
## 1 0.00000000 0.19320482 0.02207833 0.05403989 0.04558763
## 2 0.19320482 0.00000000 0.02476496 0.04650837 0.05738726
## 3 0.02207833 0.02476496 0.00000000 0.01665161 0.03039597
## 4 0.05403989 0.04650837 0.01665161 0.00000000 0.03392139
## 5 0.04558763 0.05738726 0.03039597 0.03392139 0.00000000
Moran.I(BD_MODELADO$Avg_CEa_15,ce15.dists.inv)
## $observed
## [1] 0.160951
##
## $expected
## [1] -0.003205128
##
## $sd
## [1] 0.00465455
##
## $p.value
## [1] 0
#Si hay dependencia espacial
Indice de Moran NDVI
plot(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE,fill=BD_MODELADO$NDVI,pch=16,cex=1.3)
## Warning in plot.window(...): "fill" is not a graphical parameter
## Warning in plot.xy(xy, type, ...): "fill" is not a graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "fill" is not a
## graphical parameter
## Warning in axis(side = side, at = at, labels = labels, ...): "fill" is not a
## graphical parameter
## Warning in box(...): "fill" is not a graphical parameter
## Warning in title(...): "fill" is not a graphical parameter
NDVI.dists = as.matrix(dist(cbind(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE)))
NDVI.dists.inv<-1/NDVI.dists
diag(NDVI.dists.inv)<-0
NDVI.dists.inv[1:5,1:5]
## 1 2 3 4 5
## 1 0.00000000 0.19320482 0.02207833 0.05403989 0.04558763
## 2 0.19320482 0.00000000 0.02476496 0.04650837 0.05738726
## 3 0.02207833 0.02476496 0.00000000 0.01665161 0.03039597
## 4 0.05403989 0.04650837 0.01665161 0.00000000 0.03392139
## 5 0.04558763 0.05738726 0.03039597 0.03392139 0.00000000
Moran.I(BD_MODELADO$NDVI,NDVI.dists.inv)
## $observed
## [1] 0.09750403
##
## $expected
## [1] -0.003205128
##
## $sd
## [1] 0.004644979
##
## $p.value
## [1] 0
#Si hay dependencia espacial
Indice de Moran DEM
plot(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE,col=BD_MODELADO$DEM,pch=16,cex=1.3)
DEM.dists = as.matrix(dist(cbind(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE)))
DEM.dists.inv<-1/DEM.dists
diag(DEM.dists.inv)<-0
DEM.dists.inv[1:5,1:5]
## 1 2 3 4 5
## 1 0.00000000 0.19320482 0.02207833 0.05403989 0.04558763
## 2 0.19320482 0.00000000 0.02476496 0.04650837 0.05738726
## 3 0.02207833 0.02476496 0.00000000 0.01665161 0.03039597
## 4 0.05403989 0.04650837 0.01665161 0.00000000 0.03392139
## 5 0.04558763 0.05738726 0.03039597 0.03392139 0.00000000
Moran.I(BD_MODELADO$DEM,DEM.dists.inv)
## $observed
## [1] 0.3096708
##
## $expected
## [1] -0.003205128
##
## $sd
## [1] 0.004672384
##
## $p.value
## [1] 0
#Si hay dependencia espacial
Indice de Moran SLOPE
plot(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE,col=BD_MODELADO$SLOPE,pch=16,cex=1.3)
SLOPE.dists = as.matrix(dist(cbind(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE)))
SLOPE.dists.inv<-1/SLOPE.dists
diag(SLOPE.dists.inv)<-0
SLOPE.dists.inv[1:5,1:5]
## 1 2 3 4 5
## 1 0.00000000 0.19320482 0.02207833 0.05403989 0.04558763
## 2 0.19320482 0.00000000 0.02476496 0.04650837 0.05738726
## 3 0.02207833 0.02476496 0.00000000 0.01665161 0.03039597
## 4 0.05403989 0.04650837 0.01665161 0.00000000 0.03392139
## 5 0.04558763 0.05738726 0.03039597 0.03392139 0.00000000
Moran.I(BD_MODELADO$SLOPE,SLOPE.dists.inv)
## $observed
## [1] 0.06993324
##
## $expected
## [1] -0.003205128
##
## $sd
## [1] 0.004654307
##
## $p.value
## [1] 0
#Si hay dependencia espacial
Indice de Moran Avg_z
plot(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE,col=BD_MODELADO$Avg_z,pch=16,cex=1.3)
Avg_z.dists = as.matrix(dist(cbind(BD_MODELADO$Avg_X_MCB,BD_MODELADO$Avg_Y_MCE)))
Avg_z.dists.inv<-1/Avg_z.dists
diag(Avg_z.dists.inv)<-0
Avg_z.dists.inv[1:5,1:5]
## 1 2 3 4 5
## 1 0.00000000 0.19320482 0.02207833 0.05403989 0.04558763
## 2 0.19320482 0.00000000 0.02476496 0.04650837 0.05738726
## 3 0.02207833 0.02476496 0.00000000 0.01665161 0.03039597
## 4 0.05403989 0.04650837 0.01665161 0.00000000 0.03392139
## 5 0.04558763 0.05738726 0.03039597 0.03392139 0.00000000
Moran.I(BD_MODELADO$Avg_z,Avg_z.dists.inv)
## $observed
## [1] 0.3505031
##
## $expected
## [1] -0.003205128
##
## $sd
## [1] 0.004667935
##
## $p.value
## [1] 0
#Si hay dependencia espacial
#GEODA
Ce7
knitr::include_graphics("CE70.png")
Ce150
knitr::include_graphics("CE150.png")
NDVI
knitr::include_graphics("NDVI.png")
DEM
knitr::include_graphics("DEM.png")
SLOPE
knitr::include_graphics("SLOPE.png")
Avg_z
knitr::include_graphics("Avg_z.png")