Atividade Espacial

Gabriel Peixoto

2022-09-18

Apresentação dos resultados para atividade de Espacial

Primeiro vamos carregar os pacotes necessários

require(maptools)  
## Carregando pacotes exigidos: maptools
## Carregando pacotes exigidos: sp
## Checking rgeos availability: TRUE
## Please note that 'maptools' will be retired by the end of 2023,
## plan transition at your earliest convenience;
## some functionality will be moved to 'sp'.
gpclibPermit() 
## [1] FALSE
require(sp)  
require(dplyr)
## Carregando pacotes exigidos: dplyr
## 
## Attaching package: 'dplyr'
## The following objects are masked from 'package:stats':
## 
##     filter, lag
## The following objects are masked from 'package:base':
## 
##     intersect, setdiff, setequal, union
require(spdep)        
## Carregando pacotes exigidos: spdep
## Carregando pacotes exigidos: spData
## To access larger datasets in this package, install the spDataLarge
## package with: `install.packages('spDataLarge',
## repos='https://nowosad.github.io/drat/', type='source')`
## Carregando pacotes exigidos: sf
## Linking to GEOS 3.9.1, GDAL 3.4.3, PROJ 7.2.1; sf_use_s2() is TRUE
require(rgdal)
## Carregando pacotes exigidos: rgdal
## Please note that rgdal will be retired by the end of 2023,
## plan transition to sf/stars/terra functions using GDAL and PROJ
## at your earliest convenience.
## 
## rgdal: version: 1.5-32, (SVN revision 1176)
## Geospatial Data Abstraction Library extensions to R successfully loaded
## Loaded GDAL runtime: GDAL 3.4.3, released 2022/04/22
## Path to GDAL shared files: C:/Users/Gabriel/AppData/Local/R/win-library/4.2/rgdal/gdal
## GDAL binary built with GEOS: TRUE 
## Loaded PROJ runtime: Rel. 7.2.1, January 1st, 2021, [PJ_VERSION: 721]
## Path to PROJ shared files: C:/Users/Gabriel/AppData/Local/R/win-library/4.2/rgdal/proj
## PROJ CDN enabled: FALSE
## Linking to sp version:1.5-0
## To mute warnings of possible GDAL/OSR exportToProj4() degradation,
## use options("rgdal_show_exportToProj4_warnings"="none") before loading sp or rgdal.
require(classInt)     
## Carregando pacotes exigidos: classInt
require(RColorBrewer) 
## Carregando pacotes exigidos: RColorBrewer
library(raster) 
## 
## Attaching package: 'raster'
## The following object is masked from 'package:dplyr':
## 
##     select
library(readxl) 

library(skimr)
## 
## Attaching package: 'skimr'
## The following object is masked from 'package:raster':
## 
##     bind
par.ori <- par(no.readonly=TRUE)

Vamos agora carregar nossos arquivos

readxl::read_excel
## function (path, sheet = NULL, range = NULL, col_names = TRUE, 
##     col_types = NULL, na = "", trim_ws = TRUE, skip = 0, n_max = Inf, 
##     guess_max = min(1000, n_max), progress = readxl_progress(), 
##     .name_repair = "unique") 
## {
##     path <- check_file(path)
##     format <- check_format(path)
##     read_excel_(path = path, sheet = sheet, range = range, col_names = col_names, 
##         col_types = col_types, na = na, trim_ws = trim_ws, skip = skip, 
##         n_max = n_max, guess_max = guess_max, progress = progress, 
##         .name_repair = .name_repair, format = format)
## }
## <bytecode: 0x0000022f27fa1080>
## <environment: namespace:readxl>
Indicadores = read_xlsx("Data_BA.xlsx", sheet = 1, col_names = T ) # Carregando indicadores
Ba_shape <- readShapePoly("BA_Municipios_2021.SHP") # Carregando shape
## Warning: readShapePoly is deprecated; use rgdal::readOGR or sf::st_read
proj4string(Ba_shape) <- CRS("+init=epsg:4674")
## Warning in showSRID(uprojargs, format = "PROJ", multiline
## = "NO", prefer_proj = prefer_proj): Discarded datum
## Sistema_de_Referencia_Geocentrico_para_las_AmericaS_2000 in Proj4 definition

Agora irei fazer as transformações para que sejá possível concatenar posteriormente nossos dados ao shape.

library(stringr)
Ba_shape@data$NM_MUN <- as.character(Ba_shape@data$NM_MUN )
Ba_shape@data$NM_MUN <- str_to_title(Ba_shape@data$NM_MUN)
Indicadores$Município <- str_to_title(Indicadores$Município)
head(Ba_shape@data$NM_MUN)
## [1] "Abaíra"        "Abaré"         "Acajutiba"     "Adustina"     
## [5] "Água Fria"     "Érico Cardoso"
head(Indicadores$Município)
## [1] "Abaíra"        "Abaré"         "Acajutiba"     "Adustina"     
## [5] "Água Fria"     "Érico Cardoso"
head(Indicadores)
## # A tibble: 6 × 4
##   Município      GINI THEIL  IDHM
##   <chr>         <dbl> <dbl> <dbl>
## 1 Abaíra         0.46  0.44 0.603
## 2 Abaré          0.55  0.59 0.575
## 3 Acajutiba      0.57  0.61 0.582
## 4 Adustina       0.54  0.55 0.546
## 5 Água Fria      0.53  0.54 0.55 
## 6 Érico Cardoso  0.49  0.51 0.584

Vamos plotar agora o mapa da Bahia e puxar algumas estatísticas a respeito do shape

class(Ba_shape)
## [1] "SpatialPolygonsDataFrame"
## attr(,"package")
## [1] "sp"
plot(Ba_shape)
title("Municípios da Bahia")
slotNames(Ba_shape)
## [1] "data"        "polygons"    "plotOrder"   "bbox"        "proj4string"
dim(Ba_shape)
## [1] 417   4
dim(Indicadores)
## [1] 417   4
#par(c(0,0,0,0))
plot(Ba_shape, add=T, lwd=1)

#head(Ba_shape@data)
#head(Indicadores)

Agora iremos concatenar as duas bases de dados isso só é possível graças a transformação feita lá em cima.

ind <- match(Ba_shape@data$NM_MUN, Indicadores$Município)
head(ind)
## [1] 1 2 3 4 5 6

Passando os indices para o shape e transformando os indicadores em numéricos

Indicadores <- Indicadores[ind,]
row.names(Indicadores) <- (Ba_shape$NM_MUN)
## Warning: Setting row names on a tibble is deprecated.
row.names(Indicadores) = row.names(Ba_shape)
## Warning: Setting row names on a tibble is deprecated.
Ba_shape <- spCbind(Ba_shape, Indicadores)
#table(Ba_shape)
names(Ba_shape)
## [1] "CD_MUN"    "NM_MUN"    "SIGLA"     "AREA_KM2"  "Município" "GINI"     
## [7] "THEIL"     "IDHM"
head(Ba_shape@data)
##    CD_MUN        NM_MUN SIGLA AREA_KM2     Município GINI THEIL  IDHM
## 0 2900108        Abaíra    BA  538.677        Abaíra 0.46  0.44 0.603
## 1 2900207         Abaré    BA 1604.923         Abaré 0.55  0.59 0.575
## 2 2900306     Acajutiba    BA  181.475     Acajutiba 0.57  0.61 0.582
## 3 2900355      Adustina    BA  629.099      Adustina 0.54  0.55 0.546
## 4 2900405     Água Fria    BA  742.775     Água Fria 0.53  0.54 0.550
## 5 2900504 Érico Cardoso    BA  735.249 Érico Cardoso 0.49  0.51 0.584
min(Ba_shape$IDHM)
## [1] 0.486
max(Ba_shape$IDHM)
## [1] 0.759
Ba_shape$IDHM  = as.numeric(Ba_shape$IDHM)
Ba_shape$THEIL  = as.numeric(Ba_shape$THEIL)
Ba_shape$GINI  = as.numeric(Ba_shape$GINI)
Indicadores$Municípi
## Warning: Unknown or uninitialised column: `Municípi`.
## NULL
Indicadores %>% dplyr::select(c(IDHM,Município)) %>% arrange(desc(IDHM))
## # A tibble: 417 × 2
##     IDHM Município             
##    <dbl> <chr>                 
##  1 0.759 Salvador              
##  2 0.754 Lauro De Freitas      
##  3 0.721 Barreiras             
##  4 0.716 Luís Eduardo Magalhães
##  5 0.712 Feira De Santana      
##  6 0.712 Itabuna               
##  7 0.708 Madre De Deus         
##  8 0.7   Santo Antônio De Jesus
##  9 0.699 Cruz Das Almas        
## 10 0.694 Camaçari              
## # … with 407 more rows

fazendo a estatística descritiva dos dados

skim(Indicadores$IDHM)
Data summary
Name Indicadores$IDHM
Number of rows 417
Number of columns 1
_______________________
Column type frequency:
numeric 1
________________________
Group variables None

Variable type: numeric

skim_variable n_missing complete_rate mean sd p0 p25 p50 p75 p100 hist
data 0 1 0.59 0.04 0.49 0.57 0.59 0.61 0.76 ▁▇▅▁▁

Visualizando o mapa para o indice IDH

INT1 <- classIntervals(Ba_shape$IDHM, n=4, style="quantile")
COLORES1 <- (c('red',"#964b00",'lightgrey','green2',"green4"))
COL1 <-  findColours(INT1, COLORES1)
INT1
## style: quantile
##   one of 518,665 possible partitions of this variable into 4 classes
## [0.486,0.566) [0.566,0.589) [0.589,0.614) [0.614,0.759] 
##           101           107           100           109
#border=NA
plot(Ba_shape, col=COL1)
#sp::wkt(Ba_shape)
#locator(1)
TB1 <- attr(COL1, "table")
names(TB1)= c('Baixo','Médio','Alto','Muito Alto')
legtext <- paste(names(TB1))
legend(-48.7785, -15.95352, fill=attr(COL1, "palette"), legend=legtext, 
       bty="n",cex=1)

#locator(1)

scalebar(100, xy=c(-35.97071, -16.87172), 
         type="bar", below="km",
         cex=1, lonlat=T,divs=4)
#locator(1)
compassRose(-35.53014, -13.28069, cex=1)
title("IDH dos municípios da Bahia")

Visualizando o mapa para o indice de Theil

quantile(Ba_shape$THEIL)
##   0%  25%  50%  75% 100% 
## 0.29 0.46 0.52 0.58 0.98
min(Ba_shape$THEIL)
## [1] 0.29
max(Ba_shape$THEIL)
## [1] 0.98
INT2 <- classIntervals(Ba_shape$THEIL, n=4, style="quantile")
COLORES2<- (c('red',"#964b00",'lightgrey','green2',"green4"))
COL2 <-  findColours(INT2, COLORES2)

#border=NA
plot(Ba_shape, col=COL2)

#locator(1)
TB2 <- attr(COL2, "table")
names(TB2)= c('Baixo','Médio','Alto','Muito Alto')
legtext <- paste(names(TB2))

legend(-48.7785, -15.95352, fill=attr(COL2, "palette"), legend=legtext, 
       bty="n",cex= 1)

#locator(1)

scalebar(100, xy=c(-35.97071, -16.87172), 
         type="bar", below="km",
         cex=0.8, lonlat=T,divs=4)
#locator(1)
compassRose(-35.53014, -12.28069, cex=1)
title("Indice de theil por municípios da Bahia")

Visualizando o mapa para o indice de Gini

INT3 <- classIntervals(Ba_shape$GINI, n=4, style="quantile")
COLORES3 <- (c('red',"#964b00",'lightgrey','green2',"green4"))
COL3 <-  findColours(INT3, COLORES3)

#border=NA
plot(Ba_shape, col=COL3)
#locator(1)
TB3 <- attr(COL3, "table")


names(TB3)= c('Baixo','Médio','Alto','Muito Alto')
legtext <- paste(names(TB3))

legend(-48.7785, -15.95352, fill=attr(COL3, "palette"), legend=legtext, 
       bty="n",cex=0.6)

#locator(1)

scalebar(100, xy=c(-35.97071, -16.87172), 
         type="bar", below="km",
         cex=0.8, lonlat=T,divs=4)
#locator(1)
compassRose(-35.53014, -12.28069, cex=0.8)
title("Indice de Gini por municípios da Bahia")

Agora iremos calcular as vizinhanças

require(spdep)
Ba_shape.nb1 <- poly2nb(Ba_shape)
class(Ba_shape.nb1)
## [1] "nb"
Ba_shape.nb1[[1]]
## [1]   6 222 264 298 329 331
Ba_shape.nb1[[6]]
## [1]   1  94 234 290 329 331
Ba_shape@data[Ba_shape.nb1[[6]],5]
## [1] "Abaíra"                      "Caturama"                   
## [3] "Livramento De Nossa Senhora" "Paramirim"                  
## [5] "Rio De Contas"               "Rio Do Pires"
class(Ba_shape.nb1)
## [1] "nb"
Ba_shape.nb1 = poly2nb(Ba_shape)
vizinhanca = nb2listw(Ba_shape.nb1, style="W",
                      zero.policy=TRUE)
vizinhanca
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 417 
## Number of nonzero links: 2360 
## Percentage nonzero weights: 1.357188 
## Average number of links: 5.659472 
## 
## Weights style: W 
## Weights constants summary:
##     n     nn  S0       S1       S2
## W 417 173889 417 156.5982 1724.023

Calulando o indice de Moran global

Mglobal1 = moran.test(Ba_shape$IDHM, listw=nb2listw(Ba_shape.nb1))
Mglobal1
## 
##  Moran I test under randomisation
## 
## data:  Ba_shape$IDHM  
## weights: nb2listw(Ba_shape.nb1)    
## 
## Moran I statistic standard deviate = 12.958, p-value < 2.2e-16
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.3832125066     -0.0024038462      0.0008856233
is.numeric(Ba_shape$THEIL)
## [1] TRUE
Mglobal2 = moran.test(Ba_shape$THEIL, listw=nb2listw(Ba_shape.nb1))
Mglobal2
## 
##  Moran I test under randomisation
## 
## data:  Ba_shape$THEIL  
## weights: nb2listw(Ba_shape.nb1)    
## 
## Moran I statistic standard deviate = 9.4815, p-value < 2.2e-16
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.2796889641     -0.0024038462      0.0008851704
Mglobal3 = moran.test(Ba_shape$GINI, listw=nb2listw(Ba_shape.nb1))
Mglobal3
## 
##  Moran I test under randomisation
## 
## data:  Ba_shape$GINI  
## weights: nb2listw(Ba_shape.nb1)    
## 
## Moran I statistic standard deviate = 10.175, p-value < 2.2e-16
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##      0.3006368779     -0.0024038462      0.0008870922

Calculando o indice de Moran local para o IDH

Ba_shape.mloc1 <- localmoran(Ba_shape$IDHM, listw=vizinhanca,
                             zero.policy=T, 
                             alternative = "two.sided")

dim(Ba_shape.mloc1)
## [1] 417   5
head(Ba_shape.mloc1)
##             Ii          E.Ii      Var.Ii        Z.Ii Pr(z != E(Ii))
## 0 -0.001272182 -0.0001171665 0.008044022 -0.01287808     0.98972506
## 1  0.037910379 -0.0005060820 0.105210572  0.11843707     0.90572135
## 2  0.216727888 -0.0002006788 0.020765359  1.50538308     0.13222562
## 3  0.979391381 -0.0032497872 0.267547587  1.89974117     0.05746709
## 4  0.634438250 -0.0027297299 0.139505292  1.70591977     0.08802302
## 5 -0.034595336 -0.0001389114 0.009536702 -0.35283455     0.72421248
min(Ba_shape.mloc1)
## [1] -3.130361
max(Ba_shape.mloc1)
## [1] 10.88678

Checando a amplitude da estatística de Moran local para IDH

list_w <- vizinhanca
signif = 0.05
Sd_1 <- (Ba_shape$IDHM) - mean(Ba_shape$IDHM)

mI_1 <- Ba_shape.mloc1[, 5]
C_mI <- mI_1 - mean(mI_1)  # MAS N?O QUEREMOS CENTRAR! Apenas o sinal importa
quadrant <- vector(mode = "numeric", length = nrow(Ba_shape.mloc1))
# builds a data quadrant
quadrant[Sd_1 >0 & mI_1>0] <- 4
quadrant[Sd_1 <0 & mI_1<0] <- 1
quadrant[Sd_1 <0 & mI_1>0] <- 2
quadrant[Sd_1 >0 & mI_1<0] <- 3
quadrant[Ba_shape.mloc1[,5]>signif] <- 0.05

# plot in r
brks <- c(0,1,2,3,4)
colors <- c("white","blue",rgb(0,0,1,alpha=0.4),rgb(1,0,0,alpha=0.4),"red")
plot(Ba_shape,border="lightgray",col=colors[findInterval(quadrant,brks,
                                                          all.inside=FALSE)])

title("Indice de Moran Local para o IDH")

legend(-50.92708, -12.95683, legend = c("Não significativo","Baixo-baixo","Baixo-Alto","Alto-Baixo","Alto-Alto"),
       fill=colors,bty="n",cex=0.6)

scalebar(100, xy=c(-35.97071, -16.87172), 
         type="bar", below="km",
         cex=0.6, lonlat=T,divs=4)

compassRose(-35.53014, -12.28069, cex=0.6)

Calculando o indice de Moran local para o Theil

Ba_shape.mloc2 <- localmoran(Ba_shape$THEIL, listw=vizinhanca,
                             zero.policy=T, 
                             alternative = "two.sided")

dim(Ba_shape.mloc2)
## [1] 417   5
head(Ba_shape.mloc2)
##            Ii          E.Ii      Var.Ii       Z.Ii Pr(z != E(Ii))
## 0  0.24395151 -1.811387e-03 0.124149308  0.6974999      0.4854900
## 1  0.21780741 -9.891000e-04 0.205526931  0.4826208      0.6293650
## 2  0.49816735 -1.707178e-03 0.176385083  1.1902278      0.2339569
## 3  0.02342064 -1.372147e-04 0.011331850  0.2213020      0.8248573
## 4 -0.04697900 -4.596629e-05 0.002355470 -0.9670296      0.3335292
## 5  0.07617027 -6.435609e-05 0.004418575  1.1468620      0.2514387

Checando a amplitude do Moran local para o Theil

list_w <- vizinhanca

Sd_2 <- (Ba_shape$THEIL) - mean(Ba_shape$THEIL)

mI_2 <- Ba_shape.mloc2[, 5]
C_m2 <- mI_2 - mean(mI_2)  # MAS N?O QUEREMOS CENTRAR! Apenas o sinal importa
quadrant <- vector(mode = "numeric", length = nrow(Ba_shape.mloc2))
# builds a data quadrant
quadrant[Sd_2 >0 & mI_2>0] <- 4
quadrant[Sd_2 <0 & mI_2<0] <- 1
quadrant[Sd_2 <0 & mI_2>0] <- 2
quadrant[Sd_2 >0 & mI_2<0] <- 3
quadrant[Ba_shape.mloc2[,5]>signif] <- 0.05

# plot in r
#brks <- c(0,1,2,3,4)
colors <- c("white","blue",rgb(0,0,1,alpha=0.4),rgb(1,0,0,alpha=0.4),"red")
plot(Ba_shape,border="lightgray",col=colors[findInterval(quadrant,brks,
                                                          all.inside=FALSE)])

title("Indice de Moran Local para o Theil")

legend(-50.92708, -12.95683, legend = c("insignificant","low-low","low-high","high-low","high-high"),
       fill=colors,bty="n",cex=0.6)

scalebar(100, xy=c(-35.97071, -16.87172), 
         type="bar", below="km",
         cex=0.6, lonlat=T,divs=4)

compassRose(-35.53014, -12.28069, cex=0.6)

Calculando o indice de Moran local para Gini

Ba_shape.mloc3 <- localmoran(Ba_shape$GINI, listw=vizinhanca,
                             zero.policy=T, 
                             alternative = "two.sided")

dim(Ba_shape.mloc3)
## [1] 417   5
head(Ba_shape.mloc3)
##            Ii          E.Ii      Var.Ii       Z.Ii Pr(z != E(Ii))
## 0  0.86591059 -4.716150e-03 0.322296139  1.5335730     0.12513474
## 1  0.21486593 -6.498684e-04 0.135083213  0.5863790     0.55762084
## 2  0.64379311 -2.154673e-03 0.222520411  1.3693438     0.17089185
## 3  0.05471855 -2.258872e-04 0.018653198  0.4022973     0.68746524
## 4 -0.02610869 -2.085359e-05 0.001068636 -0.7980372     0.42484889
## 5  0.57832096 -1.390195e-03 0.095321748  1.8776544     0.06042846

Calculando a amplitude do indice de Moran local para Gini

list_w <- vizinhanca

Sd_3 <- (Ba_shape$GINI) - mean(Ba_shape$GINI)

mI_3 <- Ba_shape.mloc3[, 5]
C_m3 <- mI_3 - mean(mI_3)  # MAS N?O QUEREMOS CENTRAR! Apenas o sinal importa
quadrant <- vector(mode = "numeric", length = nrow(Ba_shape.mloc3))
# builds a data quadrant
quadrant[Sd_3 >0 & mI_3>0] <- 4
quadrant[Sd_3 <0 & mI_3<0] <- 1
quadrant[Sd_3 <0 & mI_3>0] <- 2
quadrant[Sd_3 >0 & mI_3<0] <- 3
quadrant[Ba_shape.mloc3[,5]>signif] <- 0.05

# plot in r
#brks <- c(0,1,2,3,4)
colors <- c("white","blue",rgb(0,0,1,alpha=0.4),rgb(1,0,0,alpha=0.4),"red")
plot(Ba_shape,border="lightgray",col=colors[findInterval(quadrant,brks,
                                                          all.inside=FALSE)])

title("Indice de Moran Local para o GINI")

legend(-50.92708, -12.95683, legend = c("insignificant","low-low","low-high","high-low","high-high"),
       fill=colors,bty="n",cex=0.6)

scalebar(100, xy=c(-35.97071, -16.87172), 
         type="bar", below="km",
         cex=0.6, lonlat=T,divs=4)

compassRose(-35.53014, -12.28069, cex=0.6)

Checando a amplitude do moran

#Checando a amplitude da estatística de moran local

list_w <- vizinhanca


Sd_1 <- (Ba_shape$IDHM) - mean(Ba_shape$IDHM)

mI_1 <- Ba_shape.mloc1[, 5]
C_mI <- mI_1 - mean(mI_1)  # MAS NÃO QUEREMOS CENTRAR! Apenas o sinal importa
quadrant <- vector(mode = "numeric", length = nrow(Ba_shape.mloc1))
quadrant[Sd_1 > 0 & mI_1 > 0] <- 1
quadrant[Sd_1 < 0 & mI_1 > 0] <- 2
quadrant[Sd_1 > 0 & mI_1 < 0] <- 3
quadrant[Sd_1 < 0 & mI_1 < 0] <- 4

signif <- 0.05
# places non-significant Moran's in the category '5'
quadrant[Ba_shape.mloc1[, 5] > signif] <- 5

colors <- c("red", "blue", "lightpink", "skyblue2", "white")

#par(mar=c(0,0,0,0))

plot(Ba_shape, col = colors[quadrant])
#locator
legend(-48.92708, -12.95683, legend = c("alto-alto", 
                                        "baixo-baixo", "alto-baixo", "baixo-alto","Não Sig."), 
       fill = colors, bty = "n", cex = 0.7, y.intersp = 1, x.intersp = 1)

### 

nobs <- length(Ba_shape)

Ne.nb <- poly2nb(Ba_shape, queen = T)
coords <- coordinates(Ba_shape)

#par(mar = c(0,0,0,0))

plot(Ba_shape, border = "grey")
plot(Ne.nb, coords, add = T, col = "red")

plot(Ba_shape, add = T, lwd = 2)
#locator(1)
scalebar(500, xy=c(-35.95657, -13.52004), 
         type="bar", below="km",
         cex=0.8, lonlat=T,divs=4)
compassRose(-49.95657, -13.52004)

vizinhança = nb2listw(Ne.nb, style = "W", zero.policy = T)
vizinhança
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 417 
## Number of nonzero links: 2360 
## Percentage nonzero weights: 1.357188 
## Average number of links: 5.659472 
## 
## Weights style: W 
## Weights constants summary:
##     n     nn  S0       S1       S2
## W 417 173889 417 156.5982 1724.023
Ne.nb <- poly2nb(Ba_shape, queen = T)

### indice de moran global para para detecar a presença de dependencias antes
### da  regressão espacial 

Mglobal1 <- moran.test(Ba_shape$IDHM, nb2listw(Ne.nb), alternative = "two.sided")
Ba_shape.mloc1
##                Ii          E.Ii       Var.Ii         Z.Ii Pr(z != E(Ii))
## 0   -0.0012721820 -1.171665e-04 8.044022e-03 -0.012878082   9.897251e-01
## 1    0.0379103786 -5.060820e-04 1.052106e-01  0.118437071   9.057214e-01
## 2    0.2167278884 -2.006788e-04 2.076536e-02  1.505383081   1.322256e-01
## 3    0.9793913805 -3.249787e-03 2.675476e-01  1.899741173   5.746709e-02
## 4    0.6344382505 -2.729730e-03 1.395053e-01  1.705919769   8.802302e-02
## 5   -0.0345953358 -1.389114e-04 9.536702e-03 -0.352834551   7.242125e-01
## 6   -0.0931189539 -1.683789e-04 1.390511e-02 -0.788251618   4.305495e-01
## 7    0.3986958447 -1.124154e-02 7.631966e-01  0.469244629   6.388948e-01
## 8    0.3883250361 -2.813825e-04 3.891272e-02  1.969990748   4.883943e-02
## 9   -0.0154010400 -1.352513e-03 1.397909e-01 -0.037574337   9.700271e-01
## 10   0.0855022029 -1.369358e-03 8.028511e-02  0.306591508   7.591543e-01
## 11   1.7879445880 -7.360908e-03 7.562196e-01  2.064497613   3.897056e-02
## 12   0.0834320709 -1.533237e-03 1.264453e-01  0.238940762   8.111515e-01
## 13   0.4375674811 -4.114842e-03 2.100006e-01  0.963828404   3.351320e-01
## 14   0.5287617245 -2.143385e-03 1.468551e-01  1.385391283   1.659329e-01
## 15  -0.0072900529 -4.936441e-05 4.077109e-03 -0.113397561   9.097154e-01
## 16   0.4230990907 -1.369358e-03 1.129488e-01  1.263003742   2.065878e-01
## 17  -0.1302860293 -3.405842e-05 7.083828e-03 -1.547569996   1.217259e-01
## 18   0.0431911204 -5.134272e-06 4.240689e-04  2.097625160   3.593827e-02
## 19  -0.5381619593 -1.533237e-03 1.051147e-01 -1.655168174   9.789039e-02
## 20  -0.0161768551 -2.375820e-05 1.962289e-03 -0.364648365   7.153739e-01
## 21   0.4084592622 -2.984094e-03 2.457392e-01  0.829990032   4.065444e-01
## 22  -0.3109493052 -2.486695e-03 1.703185e-01 -0.747431906   4.548029e-01
## 23   0.2251600253 -2.358109e-04 1.384123e-02  1.915837023   5.538584e-02
## 24  -0.7195509210 -8.091964e-04 6.678242e-02 -2.781261297   5.414814e-03
## 25   0.8965264422 -5.081860e-03 2.062643e-01  1.985207302   4.712141e-02
## 26  -0.0136667639 -4.936441e-05 3.389324e-03 -0.233903992   8.150595e-01
## 27   0.6560329369 -1.725291e-03 1.422565e-01  1.743934717   8.117047e-02
## 28  -0.2906239802 -5.060820e-04 4.177927e-02 -1.419365015   1.557926e-01
## 29  -0.2125687236 -9.502682e-04 6.518593e-02 -0.828851251   4.071886e-01
## 30  -0.0009994023 -3.405842e-05 1.745291e-03 -0.023107242   9.815647e-01
## 31   0.1285377064 -1.122762e-04 9.272541e-03  1.336011951   1.815454e-01
## 32   0.1725683051 -3.145721e-04 3.254683e-02  0.958291514   3.379158e-01
## 33   0.4164269958 -1.928673e-03 9.864575e-02  1.332006881   1.828579e-01
## 34   0.1604147158 -5.060820e-04 3.473135e-02  0.863478158   3.878746e-01
## 35  -0.0087434259 -2.606796e-03 2.690907e-01 -0.011829886   9.905613e-01
## 36   0.0354559164 -1.845127e-03 1.081278e-01  0.113436354   9.096846e-01
## 37  -0.0686731840 -4.046624e-04 3.341003e-02 -0.373492646   7.087818e-01
## 38   1.6544249899 -2.287564e-02 1.846217e+00  1.234438596   2.170395e-01
## 39   0.0380295211 -2.428747e-04 1.667237e-02  0.296406008   7.669200e-01
## 40  -0.0725791726 -3.668950e-04 3.795837e-02 -0.370644240   7.109025e-01
## 41   0.1702504664 -9.282025e-05 7.665883e-03  1.945556822   5.170800e-02
## 42   0.0504216071 -2.375820e-05 1.962289e-03  1.138779768   2.547950e-01
## 43   0.1503916337 -5.060820e-04 4.177927e-02  0.738247932   4.603638e-01
## 44   1.2867626971 -4.425853e-03 3.025458e-01  2.347437890   1.890302e-02
## 45   0.4125533947 -1.025053e-03 5.247578e-02  1.805420839   7.100885e-02
## 46   0.6010309788 -2.606796e-03 1.332391e-01  1.653714715   9.818549e-02
## 47  -0.1705319244 -2.164576e-03 1.106853e-01 -0.506072669   6.128056e-01
## 48   1.0696992841 -3.249787e-03 2.675476e-01  2.074333536   3.804835e-02
## 49   0.1307272903 -4.637367e-04 3.182663e-02  0.735374960   4.621112e-01
## 50   0.0562938700 -1.533237e-03 8.987859e-02  0.192887174   8.470473e-01
## 51  -0.0509283997 -1.171665e-04 9.676369e-03 -0.516539473   6.054777e-01
## 52  -0.0511836848 -5.060820e-04 5.235115e-02 -0.221489393   8.247114e-01
## 53  -0.0155103167 -1.357345e-05 1.121100e-03 -0.462826611   6.434887e-01
## 54   0.0083053639 -5.134272e-06 3.525309e-04  0.442617372   6.580425e-01
## 55   0.0932021284 -8.091964e-04 4.746960e-02  0.431491636   6.661109e-01
## 56  -0.7281291773 -5.460547e-03 2.009132e-01 -1.612259592   1.069055e-01
## 57   0.3723218037 -5.164060e-04 5.341856e-02  1.613148460   1.067123e-01
## 58   0.6794846915 -1.183118e-03 1.634673e-01  1.683525921   9.227333e-02
## 59   0.5486583721 -1.533237e-03 1.264453e-01  1.547257408   1.218012e-01
## 60  -0.2271011198 -2.358109e-04 1.071276e-02 -2.191883401   2.838793e-02
## 61   1.2333407303 -3.992384e-03 2.730333e-01  2.367984517   1.788528e-02
## 62   0.1475133243 -2.630161e-03 1.540110e-01  0.382587333   7.020258e-01
## 63   0.2324697609 -3.249787e-03 2.224139e-01  0.499821215   6.172010e-01
## 64   1.2099822176 -3.815161e-03 2.609597e-01  2.376071418   1.749808e-02
## 65   0.3514876296 -1.369358e-03 5.059086e-02  1.568782315   1.166987e-01
## 66   0.1243025456 -1.389114e-04 1.147195e-02  1.161840150   2.453004e-01
## 67  -0.2970906368 -1.551169e-03 2.142405e-01 -0.638505605   5.231446e-01
## 68   0.2451186390 -6.188309e-04 6.400712e-02  0.971308591   3.313946e-01
## 69   0.1024413528 -2.358109e-04 1.384123e-02  0.872743325   3.828030e-01
## 70   5.8582749134 -1.418870e-02 1.447644e+00  4.880782670   1.056656e-06
## 71   0.3218977057 -1.183118e-03 1.634673e-01  0.799090149   4.242381e-01
## 72   1.1175712378 -1.928673e-03 4.003857e-01  1.769232011   7.685516e-02
## 73  -0.0708753885 -8.847331e-05 4.533483e-03 -1.051325009   2.931093e-01
## 74  -0.1662369098 -1.183118e-03 1.634673e-01 -0.408234872   6.831012e-01
## 75   0.0321484520 -6.750271e-05 4.634602e-03  0.473221844   6.360549e-01
## 76   0.0463537166 -2.158473e-05 2.233894e-03  0.981195406   3.264964e-01
## 77  -0.1386792145 -6.750271e-05 4.634602e-03 -2.036074685   4.174286e-02
## 78   5.3938295839 -1.335094e-02 1.088014e+00  5.183864543   2.173348e-07
## 79  -0.0623249165 -1.194335e-05 1.652105e-03 -1.533061623   1.252607e-01
## 80  -0.0528984178 -7.130628e-05 7.379416e-03 -0.614958571   5.385821e-01
## 81   0.8675508104 -1.928673e-03 1.130143e-01  2.586381605   9.698948e-03
## 82   0.3200667736 -1.441459e-03 7.376222e-02  1.183791169   2.364957e-01
## 83  -0.0425992730 -3.677526e-05 2.159002e-03 -0.916010834   3.596612e-01
## 84  -0.1660775038 -1.039724e-03 5.322605e-02 -0.715354403   4.743901e-01
## 85   0.9909644918 -2.143385e-03 1.468551e-01  2.591504527   9.555728e-03
## 86   0.5523074274 -6.914078e-04 4.744107e-02  2.538908104   1.111990e-02
## 87  -0.1998600389 -2.486695e-03 5.159404e-01 -0.274782287   7.834835e-01
## 88  -0.0305451518 -4.539561e-04 3.747800e-02 -0.155435866   8.764777e-01
## 89  -0.0623743629 -8.091964e-04 1.118457e-01 -0.184088010   8.539444e-01
## 90   0.0107217827 -5.164060e-04 3.030262e-02  0.064558915   9.485252e-01
## 91  -0.2222810465 -2.006788e-04 1.657197e-02 -1.725135271   8.450310e-02
## 92   1.5059339424 -9.778436e-03 6.648480e-01  1.858898252   6.304156e-02
## 93  -0.0201848448 -7.429089e-04 6.131582e-02 -0.078515106   9.374183e-01
## 94   0.0171991358 -6.221008e-06 4.271482e-04  0.832481104   4.051374e-01
## 95  -0.0026482066 -5.262462e-05 3.613156e-03 -0.043180873   9.655574e-01
## 96   0.1066562103 -1.122762e-04 6.591014e-03  1.315124814   1.884680e-01
## 97  -0.1977474031 -7.130628e-05 5.889204e-03 -2.575881351   9.998495e-03
## 98   0.1232195670 -5.164060e-04 3.030262e-02  0.710813848   4.771996e-01
## 99   0.0079385182 -6.221008e-06 8.605474e-04  0.270827183   7.865240e-01
## 100  0.5573660368 -2.276724e-03 1.559700e-01  1.417066885   1.564634e-01
## 101  0.3081170753 -2.071992e-04 1.216218e-02  2.795774187   5.177556e-03
## 102  0.1973611186 -4.138997e-04 2.120183e-02  1.358265637   1.743794e-01
## 103  1.5235858614 -6.761061e-03 4.610936e-01  2.253695981   2.421530e-02
## 104  0.4707913888 -1.627848e-03 2.248138e-01  0.996359476   3.190755e-01
## 105  0.1021834911 -2.006788e-04 1.377637e-02  0.872299062   3.830452e-01
## 106  0.3077588407 -4.046624e-04 3.341003e-02  1.685942502   9.180687e-02
## 107 -0.0384333237 -5.134272e-06 3.525309e-04 -2.046686475   4.068888e-02
## 108  0.1352521133 -3.145721e-04 6.540965e-02  0.530068600   5.960644e-01
## 109  0.0305107849 -5.262462e-05 4.346362e-03  0.463595125   6.429378e-01
## 110  1.7595091942 -4.913610e-03 4.038511e-01  2.776463951   5.495373e-03
## 111  0.0433826901 -1.171665e-04 1.620576e-02  0.341706402   7.325719e-01
## 112 -0.0220703093 -2.158473e-05 1.482033e-03 -0.572736081   5.668234e-01
## 113 -0.0920268227 -3.677526e-05 3.805966e-03 -1.491105489   1.359338e-01
## 114  1.2566436745 -3.669569e-03 2.510378e-01  2.515411062   1.188937e-02
## 115  0.0079007102 -5.719076e-04 3.355758e-02  0.046251122   9.631101e-01
## 116  1.5744281352 -1.564162e-02 1.057196e+00  1.546459014   1.219938e-01
## 117 -0.2227088291 -2.358109e-04 1.947248e-02 -1.594287881   1.108716e-01
## 118  0.3356838526 -4.114842e-03 2.813734e-01  0.640590057   5.217891e-01
## 119  4.0188760978 -9.544500e-03 7.808146e-01  4.558908290   5.142022e-06
## 120 -0.0514895466 -1.194335e-05 1.652105e-03 -1.266483269   2.053401e-01
## 121  1.0494949854 -2.055261e-03 2.837202e-01  1.974171661   4.836223e-02
## 122  0.0659228637 -1.198876e-03 1.239306e-01  0.190666314   8.487870e-01
## 123 -0.3556135956 -3.526810e-03 3.637247e-01 -0.583798952   5.593556e-01
## 124  0.0120666510 -6.302416e-04 3.227687e-02  0.070672711   9.436582e-01
## 125  0.0647273187 -3.405842e-05 2.338462e-03  1.339216967   1.805001e-01
## 126  0.6166184489 -1.025053e-03 7.031068e-02  2.329309585   1.984267e-02
## 127  0.9348107252 -9.778436e-03 5.684798e-01  1.252810685   2.102746e-01
## 128  0.6190201346 -1.725291e-03 1.422565e-01  1.645801530   9.980463e-02
## 129  0.0112603792 -4.936441e-05 6.828248e-03  0.136866802   8.911361e-01
## 130  0.1516165405 -1.975058e-02 6.549444e-01  0.211750898   8.323014e-01
## 131  0.0153945750 -1.183118e-03 9.760540e-02  0.053062436   9.576822e-01
## 132 -0.0102681432 -3.582011e-04 3.705924e-02 -0.051478143   9.589445e-01
## 133 -0.0346968188 -1.928673e-03 1.321724e-01 -0.090132508   9.281819e-01
## 134 -0.0341267716 -8.222372e-04 1.708827e-01 -0.080566459   9.357867e-01
## 135 -0.9763640220 -2.055261e-03 1.694077e-01 -2.367172906   1.792456e-02
## 136  0.0098947148 -3.677526e-05 3.037383e-03  0.180204089   8.569923e-01
## 137  0.1360911896 -1.725291e-03 1.011173e-01  0.433399458   6.647246e-01
## 138 -0.0314750280 -1.157499e-06 2.407567e-04 -2.028434411   4.251593e-02
## 139 -0.0155147669 -4.539561e-04 2.325277e-02 -0.098766796   9.213234e-01
## 140  1.1076467661 -3.413507e-03 2.809801e-01  2.096041191   3.607854e-02
## 141  0.1355264235 -8.783162e-04 6.025455e-02  0.555692521   5.784211e-01
## 142  0.5481007101 -8.859683e-03 6.029397e-01  0.717277768   4.732027e-01
## 143 -0.4589075552 -1.825566e-03 1.505094e-01 -1.178181632   2.387242e-01
## 144  0.5398877690 -1.352513e-03 1.397909e-01  1.447606923   1.477270e-01
## 145  0.2607531421 -5.610403e-04 2.547946e-02  1.637072406   1.016153e-01
## 146  0.0185912894 -4.138997e-04 4.281939e-02  0.091844245   9.268218e-01
## 147 -0.1301410805 -1.369358e-03 1.129488e-01 -0.383159616   7.016014e-01
## 148  0.0148913512 -1.194335e-05 9.864629e-04  0.474506226   6.351390e-01
## 149  0.1161339887 -1.389114e-04 4.698570e-03  1.696272600   8.983427e-02
## 150  0.0179849646 -6.914078e-04 4.056459e-02  0.092729723   9.261183e-01
## 151 -0.0215645426 -1.389114e-04 1.147195e-02 -0.200039111   8.414500e-01
## 152  1.9123006955 -9.733337e-03 9.975602e-01  1.924383065   5.430659e-02
## 153  0.2306407124 -1.825566e-03 8.280257e-02  0.807863637   4.191691e-01
## 154  0.5664429961 -5.719076e-04 5.915652e-02  2.331273108   1.973896e-02
## 155  0.0893965665 -4.539561e-04 2.663973e-02  0.550497908   5.819779e-01
## 156  0.0017449273 -1.122762e-04 6.591014e-03  0.022876174   9.817490e-01
## 157  0.1162873736 -9.282025e-05 5.448986e-03  1.576599005   1.148878e-01
## 158 -0.8011257303 -2.509517e-03 2.067562e-01 -1.756340949   7.903021e-02
## 159  0.4610287718 -1.948778e-03 2.012984e-01  1.031905084   3.021166e-01
## 160  0.2402813614 -5.719076e-04 4.721035e-02  1.108495485   2.676479e-01
## 161  0.3330627188 -5.610403e-04 5.803307e-02  1.384902554   1.660823e-01
## 162  0.6394810841 -2.486695e-03 2.048807e-01  1.418282452   1.561083e-01
## 163  0.7130800364 -1.307735e-02 6.613954e-01  0.892894577   3.719136e-01
## 164  0.2942272842 -1.183118e-03 6.055809e-02  1.200437876   2.299693e-01
## 165 -0.0628320960 -2.729730e-03 1.869189e-01 -0.139016072   8.894374e-01
## 166 -0.3263179746 -8.200357e-03 4.167876e-01 -0.492754162   6.221863e-01
## 167  0.3889796132 -2.855496e-03 1.161592e-01  1.149678847   2.502762e-01
## 168  0.0003543715 -2.158473e-05 2.233894e-03  0.007954374   9.936534e-01
## 169  0.3512793636 -4.539561e-04 3.747800e-02  1.816876056   6.923609e-02
## 170  0.2056019616 -7.429089e-04 5.097220e-02  0.913959595   3.607381e-01
## 171  0.0283076386 -3.677526e-05 2.524994e-03  0.564075602   5.727027e-01
## 172 -0.1245889482 -9.643958e-04 7.957856e-02 -0.438234643   6.612162e-01
## 173  0.2819588496 -1.335094e-02 9.044722e-01  0.310513317   7.561706e-01
## 174  0.1218733111 -3.677526e-05 3.805966e-03  1.976092024   4.814436e-02
## 175 -0.3521184365 -9.643958e-04 9.971522e-02 -1.112031118   2.661248e-01
## 176  0.5831322899 -1.975058e-02 1.136657e+00  0.565481155   5.717465e-01
## 177 -0.0198876008 -1.683789e-04 1.742368e-02 -0.149389427   8.812464e-01
## 178  0.2863396387 -6.794537e-04 3.986373e-02  1.437546244   1.505628e-01
## 179  0.1530640035 -3.669569e-03 3.019801e-01  0.285215350   7.754792e-01
## 180  0.0387255390 -3.405842e-05 1.745291e-03  0.927780713   3.535213e-01
## 181  0.2443840057 -2.276724e-03 2.350962e-01  0.508718067   6.109499e-01
## 182  0.2730784990 -1.441459e-03 7.376222e-02  1.010780655   3.121214e-01
## 183  0.0011387651 -5.134272e-06 2.333009e-04  0.074890993   9.403014e-01
## 184  0.1811649272 -3.677526e-05 3.805966e-03  2.937174843   3.312173e-03
## 185  0.0278668586 -1.551169e-03 1.063421e-01  0.090211284   9.281193e-01
## 186  0.2764354905 -3.582011e-04 2.957543e-02  1.609498755   1.075073e-01
## 187 -0.0517611994 -3.582011e-04 2.102251e-02 -0.354524443   7.229459e-01
## 188 -0.2091496179 -1.389114e-04 1.437483e-02 -1.743279900   8.128473e-02
## 189  0.1801558660 -2.630161e-03 5.456283e-01  0.247454040   8.045569e-01
## 190  2.9406378842 -8.200357e-03 8.417476e-01  3.214104592   1.308520e-03
## 191  0.0458199302 -3.677526e-05 2.524994e-03  0.912583654   3.614616e-01
## 192 -0.3474982525 -6.794537e-04 4.662139e-02 -1.606238377   1.082215e-01
## 193  0.1825313148 -7.566522e-03 4.408704e-01  0.286300241   7.746482e-01
## 194  2.3459324679 -1.648867e-02 1.113488e+00  2.238795951   2.516920e-02
## 195 -0.1272311792 -7.429089e-04 5.097220e-02 -0.560252203   5.753074e-01
## 196  0.4651777546 -2.369426e-03 1.952418e-01  1.058130167   2.899961e-01
## 197  0.1826559737 -3.668950e-04 2.518274e-02  1.153330771   2.487746e-01
## 198  0.0501709842 -2.006788e-04 2.076536e-02  0.349555848   7.266721e-01
## 199  0.0470304269 -5.262462e-05 5.446171e-03  0.637997473   5.234753e-01
## 200  0.4339718650 -3.526810e-03 2.063293e-01  0.963155270   3.354696e-01
## 201 -0.0004224427 -1.303040e-08 7.650170e-07 -0.482968568   6.291181e-01
## 202 -0.0670684812 -8.091964e-04 5.551661e-02 -0.281212929   7.785471e-01
## 203 -0.3033566819 -2.071992e-04 2.865595e-02 -1.790809706   7.332384e-02
## 204  0.0106712598 -1.194335e-05 1.652105e-03  0.262834655   7.926780e-01
## 205  0.1855754817 -5.164060e-04 4.263112e-02  0.901288997   3.674347e-01
## 206 -0.0054659490 -1.157499e-06 7.947685e-05 -0.612989853   5.398830e-01
## 207 -0.7866996990 -4.298817e-03 1.944992e-01 -1.774068714   7.605179e-02
## 208  0.0950508613 -2.737753e-04 1.116579e-02  0.902112032   3.669974e-01
## 209  0.8921033377 -6.000916e-03 4.095662e-01  1.403345800   1.605137e-01
## 210 -0.4806425283 -2.034613e-03 1.192094e-01 -1.386195909   1.656871e-01
## 211  0.7217317560 -2.729730e-03 5.662274e-01  0.962764076   3.356659e-01
## 212 -0.5055708487 -7.158127e-03 2.404183e-01 -1.016495244   3.093936e-01
## 213  0.5899044830 -3.115524e-03 1.411289e-01  1.578561186   1.144367e-01
## 214  0.3109544954 -2.369426e-03 2.446460e-01  0.633467741   5.264282e-01
## 215 -0.5059346335 -5.060820e-04 6.997096e-02 -1.910736745   5.603842e-02
## 216 -0.0062293555 -1.157499e-06 9.560483e-05 -0.636975147   5.241410e-01
## 217  0.9960024985 -9.778436e-03 1.002137e+00  1.004708118   3.150374e-01
## 218  0.2047891558 -3.963586e-03 5.461101e-01  0.282482842   7.775733e-01
## 219  0.1370113481 -7.429089e-04 7.683126e-02  0.496976712   6.192055e-01
## 220 -0.0675608268 -1.025053e-03 7.031068e-02 -0.250925358   8.018718e-01
## 221 -0.0106712496 -9.282025e-05 6.372693e-03 -0.132513369   8.945782e-01
## 222  0.0399157862 -3.677526e-05 3.037383e-03  0.724927972   4.684962e-01
## 223 -0.6308289776 -3.386882e-03 2.787960e-01 -1.188311806   2.347106e-01
## 224 -0.0325243920 -8.847331e-05 4.019886e-03 -0.511586823   6.089402e-01
## 225  0.5482669444 -2.055261e-03 2.837202e-01  1.033170318   3.015242e-01
## 226  0.5946420828 -3.249787e-03 2.224139e-01  1.267773688   2.048788e-01
## 227  0.0134435586 -1.389114e-04 1.147195e-02  0.126811911   8.990893e-01
## 228  0.6485724535 -8.159061e-03 6.684085e-01  0.803279832   4.218130e-01
## 229  0.0174049273 -6.221008e-06 4.271482e-04  0.842438325   3.995426e-01
## 230 10.8867808291 -3.629698e-02 4.838720e+00  4.965691999   6.845653e-07
## 231 -0.1477271113 -1.198876e-03 7.030181e-02 -0.552634589   5.805137e-01
## 232  0.2760902129 -1.039724e-03 8.578787e-02  0.946172894   3.440604e-01
## 233  0.0916099520 -4.138997e-04 2.429006e-02  0.590454098   5.548863e-01
## 234  4.0349278349 -2.111117e-02 4.298372e+00  1.956366117   5.042204e-02
## 235  0.4284590881 -6.920142e-03 7.112534e-01  0.516244616   6.056836e-01
## 236 -0.0527570244 -1.743560e-04 1.196966e-02 -0.480619924   6.307867e-01
## 237  0.0186396763 -3.227226e-04 1.465983e-02  0.156613346   8.755496e-01
## 238 -0.0514718871 -1.443451e-04 1.493704e-02 -0.419969927   6.745074e-01
## 239  5.3837371354 -1.843530e-02 1.872813e+00  3.947492103   7.897412e-05
## 240  0.7082190245 -4.425853e-03 3.639404e-01  1.181294022   2.374859e-01
## 241 -0.1434048843 -4.539561e-04 9.437891e-02 -0.465317629   6.417040e-01
## 242  0.1407074718 -6.794537e-04 3.479548e-02  0.757962700   4.484733e-01
## 243 -0.1020445599 -1.441459e-03 9.883174e-02 -0.320009705   7.489610e-01
## 244  0.0763988049 -3.582011e-04 3.705924e-02  0.398721615   6.900983e-01
## 245  0.1604630522 -1.102669e-03 6.466650e-02  0.635344886   5.252035e-01
## 246 -0.0315343638 -3.677526e-05 3.037383e-03 -0.571514871   5.676507e-01
## 247 -0.0433460156 -2.428747e-04 1.425575e-02 -0.361005602   7.180953e-01
## 248  0.4005995338 -1.039724e-03 6.097886e-02  1.626471622   1.038494e-01
## 249  0.0078048950 -1.157499e-06 1.197968e-04  0.713195910   4.757245e-01
## 250  0.3761369521 -1.533237e-03 1.051147e-01  1.164879277   2.440679e-01
## 251  0.0524850790 -2.358109e-04 1.618758e-02  0.414373273   6.786008e-01
## 252  2.3904606629 -7.774968e-03 5.296992e-01  3.295165079   9.836388e-04
## 253 -0.1431830816 -6.794537e-04 9.392505e-02 -0.464980986   6.419451e-01
## 254  0.6502573066 -1.369358e-03 1.129488e-01  1.938911875   5.251207e-02
## 255  0.0334788648 -8.847331e-05 5.193822e-03  0.465771988   6.413787e-01
## 256 -0.2053104527 -1.117884e-03 7.667105e-02 -0.737435831   4.608574e-01
## 257  0.6544873815 -3.815161e-03 1.947650e-01  1.491660682   1.357881e-01
## 258  1.2377756077 -6.338918e-03 4.324879e-01  1.891791926   5.851871e-02
## 259  1.4080503820 -1.094279e-02 6.354226e-01  1.780118770   7.505653e-02
## 260  0.3610767344 -1.825566e-03 1.251194e-01  1.025952999   3.049137e-01
## 261  0.0672429331 -4.936441e-05 1.424225e-03  1.783101667   7.456976e-02
## 262 -0.0909082729 -8.222372e-04 1.708827e-01 -0.217925667   8.274870e-01
## 263  0.0212696006 -2.071992e-04 9.413213e-03  0.221360754   8.248115e-01
## 264  1.6793770917 -7.158127e-03 1.478216e+00  1.387159923   1.653930e-01
## 265  0.0915765168 -1.102669e-03 7.562871e-02  0.337006949   7.361117e-01
## 266  0.0316914254 -2.158473e-05 1.106103e-03  0.953541834   3.403156e-01
## 267  0.5319491382 -7.554064e-04 7.812277e-02  1.905888941   5.666462e-02
## 268 -0.0554452642 -2.855496e-03 1.671679e-01 -0.128624836   8.976545e-01
## 269  1.8143701946 -6.186704e-03 6.363401e-01  2.282231007   2.247571e-02
## 270 -0.0781895105 -7.130628e-05 5.889204e-03 -1.017944145   3.087045e-01
## 271  0.0858967655 -3.141063e-03 2.586248e-01  0.175081199   8.610158e-01
## 272  0.3723565171 -3.115524e-03 1.823431e-01  0.879291741   3.792431e-01
## 273  0.2311088057 -1.627848e-03 2.248138e-01  0.490855055   6.235290e-01
## 274  0.5206242482 -3.386882e-03 2.317647e-01  1.088471036   2.763872e-01
## 275  0.0304511666 -1.357345e-05 1.121100e-03  0.909861650   3.628955e-01
## 276  0.2896845075 -8.091964e-04 5.551661e-02  1.232892653   2.176158e-01
## 277  0.3323681136 -6.920142e-03 4.718671e-01  0.493922675   6.213608e-01
## 278  0.7394537242 -1.025053e-03 1.059805e-01  2.274571765   2.293163e-02
## 279  1.0597219282 -2.143385e-03 1.468551e-01  2.770926333   5.589707e-03
## 280  1.3369343825 -5.114463e-03 7.038658e-01  1.599644164   1.096775e-01
## 281 -0.0085796168 -1.357345e-05 1.121100e-03 -0.255833937   7.980791e-01
## 282  0.6951568681 -2.254989e-03 1.544844e-01  1.774381524   7.600006e-02
## 283  1.2071124386 -1.725291e-03 1.422565e-01  3.205028831   1.350490e-03
## 284  0.0839419817 -2.254989e-03 1.544844e-01  0.219305582   8.264120e-01
## 285 -0.0571229123 -2.428747e-04 2.513055e-02 -0.358805358   7.197407e-01
## 286  0.4814439481 -1.627848e-03 1.342351e-01  1.318495506   1.873378e-01
## 287 -0.0563239986 -8.847331e-05 5.193822e-03 -0.780310083   4.352084e-01
## 288  0.6101649781 -3.413507e-03 2.809801e-01  1.157530163   2.470558e-01
## 289  0.0032634721 -6.302416e-04 4.324678e-02  0.018723503   9.850617e-01
## 290 -0.0078871779 -2.158473e-05 1.482033e-03 -0.204316081   8.381065e-01
## 291  0.5318255220 -4.046624e-04 8.413475e-02  1.834897437   6.652089e-02
## 292 -0.1435458067 -1.683789e-04 1.742368e-02 -1.086202684   2.773893e-01
## 293 -0.6796716361 -9.085123e-03 9.317348e-01 -0.694718155   4.872319e-01
## 294  0.0084223872 -6.750271e-05 4.634602e-03  0.124708438   9.007544e-01
## 295 -0.0218985182 -4.936441e-05 4.077109e-03 -0.342183032   7.322132e-01
## 296  2.4420856037 -9.269382e-03 1.270349e+00  2.174926786   2.963560e-02
## 297 -0.1146374928 -7.429089e-04 6.131582e-02 -0.459956527   6.455474e-01
## 298  1.2378963984 -1.094279e-02 6.354226e-01  1.566661577   1.171938e-01
## 299  0.1551474557 -1.171665e-04 6.878059e-03  1.872145358   6.118650e-02
## 300  0.2699164678 -4.046624e-04 3.341003e-02  1.478909339   1.391645e-01
## 301 -0.1652836760 -4.637367e-04 3.828510e-02 -0.842354402   3.995896e-01
## 302  0.3768838763 -5.252943e-03 4.315937e-01  0.581676224   5.607848e-01
## 303  0.4026392007 -5.060820e-04 5.235115e-02  1.761969769   7.807441e-02
## 304  0.0912336879 -3.582011e-04 2.458623e-02  0.584132108   5.591314e-01
## 305  0.2789658581 -6.794537e-04 3.986373e-02  1.400614378   1.613294e-01
## 306  0.2810426772 -1.627848e-03 1.115904e-01  0.846188469   3.974476e-01
## 307 -0.2512156141 -1.443451e-04 9.909687e-03 -2.522127585   1.166474e-02
## 308  1.5840736818 -7.360908e-03 6.035073e-01  2.048554495   4.050570e-02
## 309  0.1886348761 -2.737753e-04 1.402599e-02  1.595089637   1.106922e-01
## 310  2.0165941095 -9.544500e-03 7.808146e-01  2.292953250   2.185070e-02
## 311  0.0933532933 -1.369358e-03 9.389497e-02  0.309123963   7.572272e-01
## 312  0.6496181757 -1.039724e-03 8.578787e-02  2.221466492   2.631938e-02
## 313  0.2576450782 -5.719076e-04 3.924624e-02  1.303424249   1.924300e-01
## 314  0.5512876528 -3.815161e-03 1.947650e-01  1.257818387   2.084574e-01
## 315  0.1573882386 -1.725291e-03 1.782533e-01  0.376867199   7.062723e-01
## 316  0.0193356942 -5.134272e-06 3.525309e-04  1.030093080   3.029663e-01
## 317  0.9841617338 -3.526810e-03 2.063293e-01  2.174400703   2.967506e-02
## 318  0.0347049758 -3.582011e-04 2.957543e-02  0.203885209   8.384432e-01
## 319  0.1965021628 -1.266400e-03 6.481545e-02  0.776815659   4.372675e-01
## 320  0.3459788433 -3.145721e-04 3.254683e-02  1.919507859   5.492009e-02
## 321  0.8703621955 -2.509517e-03 2.590741e-01  1.714898495   8.636384e-02
## 322 -0.3550620556 -3.582011e-04 2.957543e-02 -2.062530431   3.915726e-02
## 323  0.2605413464 -1.646322e-03 8.422819e-02  0.903407185   3.663098e-01
## 324  0.0757602391 -6.302416e-04 3.227687e-02  0.425200286   6.706907e-01
## 325  1.5032240403 -9.499943e-03 9.738694e-01  1.532884175   1.253044e-01
## 326 -0.1160515004 -7.130628e-05 4.186104e-03 -1.792581062   7.303994e-02
## 327 -0.2332766701 -4.114842e-03 4.241189e-01 -0.351883137   7.249259e-01
## 328  0.0488361061 -1.743560e-04 8.933451e-03  0.518536295   6.040841e-01
## 329 -0.0572658362 -4.539561e-04 3.115568e-02 -0.321862631   7.475568e-01
## 330 -0.0001923652 -1.303040e-08 6.677532e-07 -0.235390634   8.139056e-01
## 331  0.5450364417 -6.794537e-04 4.662139e-02  2.527399948   1.149106e-02
## 332  0.0620009345 -2.055261e-03 1.408296e-01  0.170692375   8.644657e-01
## 333 -0.2302244101 -3.668950e-04 1.879492e-02 -1.676634674   9.361394e-02
## 334  0.6906887909 -7.554064e-04 5.182902e-02  3.037180716   2.388022e-03
## 335  7.6281242072 -3.859959e-02 1.686269e+00  5.904000677   3.547907e-09
## 336 -0.1072513203 -1.683789e-04 1.390511e-02 -0.908098759   3.638260e-01
## 337  0.4488324467 -3.249787e-03 4.480825e-01  0.675364815   4.994440e-01
## 338  1.9978029437 -5.114463e-03 7.038658e-01  2.387361049   1.696982e-02
## 339 -0.1531797452 -3.668950e-04 3.795837e-02 -0.784343113   4.328388e-01
## 340  0.2587988292 -5.610403e-04 3.850090e-02  1.321804826   1.862332e-01
## 341 -0.0086965931 -2.375820e-05 9.692086e-04 -0.278581608   7.805659e-01
## 342  0.4399925480 -2.034613e-03 1.677093e-01  1.079370185   2.804227e-01
## 343  0.0654039281 -5.719076e-04 3.355758e-02  0.360155091   7.187312e-01
## 344  0.0578878123 -2.813825e-04 1.441561e-02  0.484480809   6.280447e-01
## 345 -0.0021641021 -5.134272e-06 3.525309e-04 -0.114986689   9.084557e-01
## 346  0.0153348861 -1.743560e-04 1.804207e-02  0.115464217   9.080772e-01
## 347 -0.0335098007 -6.750271e-05 3.962827e-03 -0.531243415   5.952501e-01
## 348  2.0438766941 -3.843417e-03 1.561921e-01  5.181327774   2.203120e-07
## 349  0.4669563441 -1.594070e-02 8.038718e-01  0.538593563   5.901673e-01
## 350 -0.3801345242 -1.458847e-03 1.203193e-01 -1.091690867   2.749690e-01
## 351 -0.3827844312 -3.145721e-04 2.159256e-02 -2.602826298   9.245879e-03
## 352  0.5955109279 -3.009089e-03 2.059903e-01  1.318728192   1.872600e-01
## 353  1.4283043963 -2.879947e-03 1.971753e-01  3.223066733   1.268260e-03
## 354  0.1885165578 -2.879947e-03 1.971753e-01  0.431030224   6.664464e-01
## 355  0.6130540647 -6.914078e-04 3.139596e-02  3.463788930   5.326243e-04
## 356  4.6381973799 -9.085123e-03 7.435787e-01  5.389340342   7.071677e-08
## 357 -0.0129273542 -5.134272e-06 3.014324e-04 -0.744290016   4.567010e-01
## 358  0.8646324091 -1.551169e-03 1.602913e-01  2.163490327   3.050349e-02
## 359 -0.2341210745 -3.249787e-03 2.675476e-01 -0.446343696   6.553490e-01
## 360  0.1210645081 -2.486695e-03 1.703185e-01  0.299375381   7.646536e-01
## 361 -0.0160293634 -1.157499e-06 9.560483e-05 -1.639249243   1.011614e-01
## 362  2.4651138453 -5.637838e-03 2.547399e-01  4.895314377   9.814870e-07
## 363  0.3444636621 -5.719076e-04 4.721035e-02  1.587980819   1.122907e-01
## 364  1.5615374740 -6.338918e-03 3.697998e-01  2.578270603   9.929620e-03
## 365  0.9926180894 -7.554064e-04 4.431652e-02  4.718780054   2.372632e-06
## 366  0.4251332243 -2.855496e-03 1.955060e-01  0.967948454   3.330701e-01
## 367  0.2548022762 -2.391704e-03 1.400815e-01  0.687179872   4.919694e-01
## 368  0.1627563594 -6.302416e-04 4.324678e-02  0.785668838   4.320615e-01
## 369 -0.1658182630 -7.360908e-03 5.016991e-01 -0.223712750   8.229808e-01
## 370  0.0062599753 -1.700867e-06 1.404848e-04  0.528294336   5.972951e-01
## 371  0.1253903679 -1.122762e-04 4.579868e-03  1.854498040   6.366794e-02
## 372 -0.0540110340 -2.813825e-04 2.323457e-02 -0.352489943   7.244709e-01
## 373 -0.1049066696 -1.102669e-03 6.466650e-02 -0.408201320   6.831259e-01
## 374 -0.2733158319 -2.276724e-03 1.032192e-01 -0.843629526   3.988765e-01
## 375  0.0195590981 -2.158473e-05 1.782777e-03  0.463745061   6.428304e-01
## 376  5.7758244778 -9.313395e-03 7.620862e-01  6.626919101   3.427654e-11
## 377 -0.0721581712 -1.266400e-03 1.044673e-01 -0.219333881   8.263900e-01
## 378  1.3779295094 -5.252943e-03 3.587864e-01  2.309199763   2.093250e-02
## 379  0.2315625359 -1.948778e-03 2.012984e-01  0.520460467   6.027427e-01
## 380 -0.0151387618 -5.134272e-06 4.240689e-04 -0.734894220   4.624039e-01
## 381 -0.0399437957 -1.389114e-04 1.437483e-02 -0.331997608   7.398911e-01
## 382  0.1832773510 -4.046624e-04 2.777395e-02  1.102167990   2.703886e-01
## 383  0.0417170505 -3.677526e-05 3.037383e-03  0.757611405   4.486837e-01
## 384  0.0640103449 -1.357345e-05 1.404784e-03  1.708194936   8.760018e-02
## 385  0.1924013551 -1.102669e-03 9.097581e-02  0.641544877   5.211687e-01
## 386 -0.0004184062 -1.303040e-08 1.348600e-06 -0.360282458   7.186359e-01
## 387  0.8316100076 -1.175189e-02 9.592540e-01  0.861087261   3.891900e-01
## 388  0.0017088011 -1.303040e-08 7.650170e-07  1.953706367   5.073595e-02
## 389  0.2450056185 -1.102669e-03 1.139965e-01  0.728921189   4.660499e-01
## 390  0.6722792308 -2.143385e-03 1.255687e-01  1.903230286   5.701050e-02
## 391 -0.5387022915 -3.582011e-04 2.957543e-02 -3.130360877   1.745917e-03
## 392  1.1480950150 -6.150842e-03 4.197354e-01  1.781601361   7.481426e-02
## 393  0.2947605409 -3.145721e-04 2.159256e-02  2.008077880   4.463502e-02
## 394 -0.0734569652 -1.743560e-04 1.196966e-02 -0.669823026   5.029706e-01
## 395  0.1036445166 -2.006788e-04 1.028188e-02  1.024118508   3.057793e-01
## 396 -0.1551427700 -4.138997e-04 2.840769e-02 -0.918022699   3.586070e-01
## 397  0.0076184818 -1.157499e-06 9.560483e-05  0.779281727   4.358138e-01
## 398  0.0557301802 -7.554064e-04 6.234652e-02  0.226220280   8.210301e-01
## 399  1.0088905798 -8.816757e-03 7.218095e-01  1.197875302   2.309656e-01
## 400  0.0313733197 -1.627848e-03 1.115904e-01  0.098790659   9.213045e-01
## 401  0.0340132903 -2.375820e-05 2.458830e-03  0.686416416   4.924506e-01
## 402  0.2572523320 -6.914078e-04 9.557640e-02  0.834352674   4.040823e-01
## 403  0.0128125274 -2.158473e-05 1.482033e-03  0.333377973   7.388490e-01
## 404 -0.1954769625 -1.198876e-03 8.221931e-02 -0.677543046   4.980615e-01
## 405  0.6942758968 -2.630161e-03 2.714962e-01  1.337495578   1.810609e-01
## 406  0.5251999304 -4.268931e-03 2.918648e-01  0.980052929   3.270600e-01
## 407  0.2328036423 -5.060820e-04 4.177927e-02  1.141438231   2.536876e-01
## 408 -0.0423069838 -2.143385e-03 2.213571e-01 -0.085366181   9.319703e-01
## 409 -0.1230663737 -8.847331e-05 6.074274e-03 -1.577901421   1.145883e-01
## 410  1.7036277600 -3.697281e-03 3.812405e-01  2.765137431   5.689882e-03
## 411 -0.2864328032 -4.046624e-04 2.777395e-02 -1.716287050   8.610952e-02
## 412 -1.6239586546 -1.001521e-02 5.080969e-01 -2.264201389   2.356173e-02
## 413  0.0321484520 -6.750271e-05 5.575087e-03  0.431464609   6.661306e-01
## 414 -0.0373633963 -5.262462e-05 3.613156e-03 -0.620713079   5.347884e-01
## 415  0.4871708854 -3.526810e-03 1.596936e-01  1.227920544   2.194768e-01
## 416  0.2386945536 -1.122762e-04 9.272541e-03  2.479975293   1.313915e-02
## attr(,"call")
## localmoran(x = Ba_shape$IDHM, listw = vizinhanca, zero.policy = T, 
##     alternative = "two.sided")
## attr(,"class")
## [1] "localmoran" "matrix"     "array"     
## attr(,"quadr")
##          mean    median     pysal
## 1    High-Low High-High  High-Low
## 2     Low-Low   Low-Low   Low-Low
## 3     Low-Low   Low-Low   Low-Low
## 4     Low-Low   Low-Low   Low-Low
## 5     Low-Low   Low-Low   Low-Low
## 6    Low-High  Low-High  Low-High
## 7    Low-High  Low-High  Low-High
## 8   High-High High-High High-High
## 9   High-High High-High High-High
## 10    Low-Low  Low-High  Low-High
## 11  High-High High-High High-High
## 12  High-High High-High High-High
## 13    Low-Low   Low-Low   Low-Low
## 14    Low-Low   Low-Low   Low-Low
## 15    Low-Low   Low-Low   Low-Low
## 16   Low-High  Low-High  Low-High
## 17  High-High High-High High-High
## 18   Low-High  Low-High  Low-High
## 19    Low-Low  High-Low   Low-Low
## 20   Low-High  Low-High  Low-High
## 21   High-Low  High-Low  High-Low
## 22    Low-Low   Low-Low   Low-Low
## 23   Low-High  Low-High  Low-High
## 24    Low-Low   Low-Low   Low-Low
## 25   Low-High  Low-High  Low-High
## 26    Low-Low   Low-Low   Low-Low
## 27   Low-High  Low-High  Low-High
## 28    Low-Low   Low-Low   Low-Low
## 29   Low-High  Low-High  Low-High
## 30   Low-High  Low-High  Low-High
## 31    Low-Low  Low-High  Low-High
## 32    Low-Low   Low-Low   Low-Low
## 33    Low-Low   Low-Low   Low-Low
## 34    Low-Low   Low-Low   Low-Low
## 35    Low-Low   Low-Low   Low-Low
## 36    Low-Low  Low-High  Low-High
## 37  High-High High-High High-High
## 38   Low-High  Low-High  Low-High
## 39  High-High High-High High-High
## 40  High-High High-High High-High
## 41   High-Low  High-Low  High-Low
## 42  High-High High-High High-High
## 43  High-High High-High High-High
## 44    Low-Low   Low-Low   Low-Low
## 45    Low-Low   Low-Low   Low-Low
## 46    Low-Low   Low-Low   Low-Low
## 47    Low-Low   Low-Low   Low-Low
## 48   High-Low  High-Low  High-Low
## 49    Low-Low   Low-Low   Low-Low
## 50  High-High High-High High-High
## 51    Low-Low   Low-Low   Low-Low
## 52   High-Low  High-Low  High-Low
## 53   Low-High  Low-High  Low-High
## 54   High-Low  High-Low  High-Low
## 55    Low-Low  High-Low   Low-Low
## 56    Low-Low   Low-Low   Low-Low
## 57   High-Low  High-Low  High-Low
## 58  High-High High-High High-High
## 59    Low-Low   Low-Low   Low-Low
## 60    Low-Low   Low-Low   Low-Low
## 61   Low-High  Low-High  Low-High
## 62  High-High High-High High-High
## 63  High-High High-High High-High
## 64    Low-Low   Low-Low   Low-Low
## 65    Low-Low   Low-Low   Low-Low
## 66  High-High High-High High-High
## 67    Low-Low   Low-Low   Low-Low
## 68   High-Low  High-Low  High-Low
## 69    Low-Low   Low-Low   Low-Low
## 70    Low-Low   Low-Low   Low-Low
## 71  High-High High-High High-High
## 72    Low-Low   Low-Low   Low-Low
## 73    Low-Low   Low-Low   Low-Low
## 74   Low-High  Low-High  Low-High
## 75   Low-High  Low-High  Low-High
## 76    Low-Low   Low-Low   Low-Low
## 77    Low-Low  High-Low   Low-Low
## 78   Low-High  Low-High  Low-High
## 79  High-High High-High High-High
## 80   Low-High High-High  Low-High
## 81   High-Low  High-Low  High-Low
## 82    Low-Low   Low-Low   Low-Low
## 83    Low-Low   Low-Low   Low-Low
## 84   High-Low  High-Low  High-Low
## 85   High-Low  High-Low  High-Low
## 86    Low-Low   Low-Low   Low-Low
## 87  High-High High-High High-High
## 88   Low-High  Low-High  Low-High
## 89   Low-High  Low-High  Low-High
## 90   Low-High  Low-High  Low-High
## 91   High-Low High-High High-High
## 92   Low-High  Low-High  Low-High
## 93  High-High High-High High-High
## 94   Low-High  Low-High  Low-High
## 95  High-High High-High High-High
## 96   High-Low High-High  High-Low
## 97    Low-Low   Low-Low   Low-Low
## 98   High-Low  High-Low  High-Low
## 99  High-High High-High High-High
## 100 High-High High-High High-High
## 101 High-High High-High High-High
## 102 High-High High-High High-High
## 103 High-High High-High High-High
## 104 High-High High-High High-High
## 105   Low-Low   Low-Low   Low-Low
## 106   Low-Low   Low-Low   Low-Low
## 107   Low-Low   Low-Low   Low-Low
## 108  Low-High High-High  Low-High
## 109   Low-Low   Low-Low   Low-Low
## 110 High-High High-High High-High
## 111   Low-Low   Low-Low   Low-Low
## 112 High-High High-High High-High
## 113  Low-High High-High  Low-High
## 114  High-Low  High-Low  High-Low
## 115   Low-Low   Low-Low   Low-Low
## 116  High-Low High-High High-High
## 117 High-High High-High High-High
## 118  Low-High  Low-High  Low-High
## 119   Low-Low   Low-Low   Low-Low
## 120 High-High High-High High-High
## 121  Low-High High-High  Low-High
## 122 High-High High-High High-High
## 123 High-High High-High High-High
## 124  Low-High  Low-High  Low-High
## 125  High-Low High-High High-High
## 126   Low-Low   Low-Low   Low-Low
## 127   Low-Low   Low-Low   Low-Low
## 128 High-High High-High High-High
## 129   Low-Low   Low-Low   Low-Low
## 130   Low-Low   Low-Low   Low-Low
## 131 High-High High-High High-High
## 132   Low-Low  Low-High   Low-Low
## 133   Low-Low  Low-High  Low-High
## 134  Low-High  Low-High  Low-High
## 135  High-Low  High-Low  High-Low
## 136  High-Low  High-Low  High-Low
## 137 High-High High-High High-High
## 138   Low-Low   Low-Low   Low-Low
## 139  Low-High High-High  Low-High
## 140  Low-High  Low-High  Low-High
## 141 High-High High-High High-High
## 142   Low-Low   Low-Low   Low-Low
## 143 High-High High-High High-High
## 144  Low-High  Low-High  Low-High
## 145   Low-Low   Low-Low   Low-Low
## 146   Low-Low   Low-Low   Low-Low
## 147 High-High High-High High-High
## 148  High-Low  High-Low  High-Low
## 149   Low-Low  High-Low   Low-Low
## 150   Low-Low   Low-Low   Low-Low
## 151  High-Low High-High High-High
## 152  Low-High  Low-High  Low-High
## 153   Low-Low   Low-Low   Low-Low
## 154   Low-Low   Low-Low   Low-Low
## 155 High-High High-High High-High
## 156   Low-Low   Low-Low   Low-Low
## 157   Low-Low  Low-High   Low-Low
## 158 High-High High-High High-High
## 159  High-Low  High-Low  High-Low
## 160 High-High High-High High-High
## 161 High-High High-High High-High
## 162   Low-Low   Low-Low   Low-Low
## 163   Low-Low   Low-Low   Low-Low
## 164 High-High High-High High-High
## 165   Low-Low   Low-Low   Low-Low
## 166  Low-High  Low-High  Low-High
## 167  High-Low  High-Low  High-Low
## 168   Low-Low   Low-Low   Low-Low
## 169   Low-Low High-High   Low-Low
## 170   Low-Low   Low-Low   Low-Low
## 171   Low-Low   Low-Low   Low-Low
## 172 High-High High-High High-High
## 173  High-Low  High-Low  High-Low
## 174 High-High High-High High-High
## 175 High-High High-High High-High
## 176  High-Low  High-Low  High-Low
## 177 High-High High-High High-High
## 178  Low-High  Low-High  Low-High
## 179   Low-Low   Low-Low   Low-Low
## 180   Low-Low   Low-Low   Low-Low
## 181   Low-Low   Low-Low   Low-Low
## 182 High-High High-High High-High
## 183   Low-Low   Low-Low   Low-Low
## 184   Low-Low  High-Low   Low-Low
## 185 High-High High-High High-High
## 186  High-Low High-High High-High
## 187   Low-Low   Low-Low   Low-Low
## 188  Low-High  Low-High  Low-High
## 189  Low-High  Low-High  Low-High
## 190 High-High High-High High-High
## 191 High-High High-High High-High
## 192 High-High High-High High-High
## 193  Low-High  Low-High  Low-High
## 194 High-High High-High High-High
## 195   Low-Low   Low-Low   Low-Low
## 196  Low-High  Low-High  Low-High
## 197   Low-Low   Low-Low   Low-Low
## 198 High-High High-High High-High
## 199   Low-Low   Low-Low   Low-Low
## 200 High-High High-High High-High
## 201   Low-Low   Low-Low   Low-Low
## 202  High-Low  High-Low  High-Low
## 203  Low-High  Low-High  Low-High
## 204  High-Low  High-Low  High-Low
## 205   Low-Low  High-Low   Low-Low
## 206 High-High High-High High-High
## 207  Low-High High-High  Low-High
## 208  High-Low  High-Low  High-Low
## 209   Low-Low   Low-Low   Low-Low
## 210 High-High High-High High-High
## 211  Low-High  Low-High  Low-High
## 212   Low-Low   Low-Low   Low-Low
## 213  High-Low  High-Low  High-Low
## 214   Low-Low   Low-Low   Low-Low
## 215   Low-Low   Low-Low   Low-Low
## 216  Low-High  Low-High  Low-High
## 217  Low-High High-High  Low-High
## 218 High-High High-High High-High
## 219   Low-Low   Low-Low   Low-Low
## 220   Low-Low   Low-Low   Low-Low
## 221  Low-High  Low-High  Low-High
## 222  High-Low  High-Low  High-Low
## 223 High-High High-High High-High
## 224  Low-High  Low-High  Low-High
## 225  Low-High  Low-High  Low-High
## 226 High-High High-High High-High
## 227   Low-Low   Low-Low   Low-Low
## 228   Low-Low   Low-Low   Low-Low
## 229   Low-Low   Low-Low   Low-Low
## 230 High-High High-High High-High
## 231 High-High High-High High-High
## 232  High-Low  High-Low  High-Low
## 233 High-High High-High High-High
## 234 High-High High-High High-High
## 235 High-High High-High High-High
## 236   Low-Low   Low-Low   Low-Low
## 237  High-Low  High-Low  High-Low
## 238 High-High High-High High-High
## 239  High-Low  High-Low  High-Low
## 240 High-High High-High High-High
## 241   Low-Low   Low-Low   Low-Low
## 242  Low-High  Low-High  Low-High
## 243   Low-Low   Low-Low   Low-Low
## 244  Low-High  Low-High  Low-High
## 245   Low-Low   Low-Low   Low-Low
## 246   Low-Low   Low-Low   Low-Low
## 247  High-Low  High-Low  High-Low
## 248  High-Low  High-Low  High-Low
## 249 High-High High-High High-High
## 250   Low-Low  High-Low   Low-Low
## 251   Low-Low   Low-Low   Low-Low
## 252   Low-Low   Low-Low   Low-Low
## 253 High-High High-High High-High
## 254  Low-High  Low-High  Low-High
## 255 High-High High-High High-High
## 256   Low-Low   Low-Low   Low-Low
## 257  High-Low  High-Low  High-Low
## 258   Low-Low   Low-Low   Low-Low
## 259   Low-Low   Low-Low   Low-Low
## 260   Low-Low   Low-Low   Low-Low
## 261   Low-Low   Low-Low   Low-Low
## 262   Low-Low   Low-Low   Low-Low
## 263  High-Low  High-Low  High-Low
## 264 High-High High-High High-High
## 265 High-High High-High High-High
## 266   Low-Low   Low-Low   Low-Low
## 267   Low-Low  High-Low   Low-Low
## 268 High-High High-High High-High
## 269  Low-High  Low-High  Low-High
## 270 High-High High-High High-High
## 271  High-Low  High-Low  High-Low
## 272 High-High High-High High-High
## 273   Low-Low   Low-Low   Low-Low
## 274   Low-Low   Low-Low   Low-Low
## 275   Low-Low   Low-Low   Low-Low
## 276 High-High High-High High-High
## 277   Low-Low   Low-Low   Low-Low
## 278   Low-Low   Low-Low   Low-Low
## 279   Low-Low   Low-Low   Low-Low
## 280   Low-Low   Low-Low   Low-Low
## 281 High-High High-High High-High
## 282  High-Low  High-Low  High-Low
## 283   Low-Low   Low-Low   Low-Low
## 284   Low-Low   Low-Low   Low-Low
## 285   Low-Low   Low-Low   Low-Low
## 286  High-Low  High-Low  High-Low
## 287   Low-Low   Low-Low   Low-Low
## 288  Low-High  Low-High  Low-High
## 289 High-High High-High High-High
## 290  High-Low High-High High-High
## 291  Low-High High-High  Low-High
## 292   Low-Low   Low-Low   Low-Low
## 293  Low-High  Low-High  Low-High
## 294  High-Low  High-Low  High-Low
## 295   Low-Low   Low-Low   Low-Low
## 296  Low-High  Low-High  Low-High
## 297   Low-Low   Low-Low   Low-Low
## 298  Low-High  Low-High  Low-High
## 299   Low-Low   Low-Low   Low-Low
## 300 High-High High-High High-High
## 301   Low-Low   Low-Low   Low-Low
## 302  High-Low  High-Low  High-Low
## 303   Low-Low   Low-Low   Low-Low
## 304   Low-Low   Low-Low   Low-Low
## 305   Low-Low   Low-Low   Low-Low
## 306   Low-Low   Low-Low   Low-Low
## 307   Low-Low   Low-Low   Low-Low
## 308  High-Low  High-Low  High-Low
## 309 High-High High-High High-High
## 310   Low-Low   Low-Low   Low-Low
## 311 High-High High-High High-High
## 312 High-High High-High High-High
## 313 High-High High-High High-High
## 314 High-High High-High High-High
## 315   Low-Low   Low-Low   Low-Low
## 316   Low-Low   Low-Low   Low-Low
## 317   Low-Low  High-Low   Low-Low
## 318   Low-Low   Low-Low   Low-Low
## 319   Low-Low   Low-Low   Low-Low
## 320   Low-Low   Low-Low   Low-Low
## 321   Low-Low   Low-Low   Low-Low
## 322 High-High High-High High-High
## 323  Low-High  Low-High  Low-High
## 324 High-High High-High High-High
## 325 High-High High-High High-High
## 326   Low-Low   Low-Low   Low-Low
## 327  High-Low  High-Low  High-Low
## 328  Low-High  Low-High  Low-High
## 329 High-High High-High High-High
## 330  Low-High  Low-High  Low-High
## 331  High-Low  High-Low  High-Low
## 332   Low-Low   Low-Low   Low-Low
## 333 High-High High-High High-High
## 334  High-Low  High-Low  High-Low
## 335 High-High High-High High-High
## 336 High-High High-High High-High
## 337  Low-High  Low-High  Low-High
## 338   Low-Low   Low-Low   Low-Low
## 339 High-High High-High High-High
## 340  High-Low  High-Low  High-Low
## 341   Low-Low   Low-Low   Low-Low
## 342  High-Low  High-Low  High-Low
## 343   Low-Low   Low-Low   Low-Low
## 344 High-High High-High High-High
## 345 High-High High-High High-High
## 346  Low-High High-High  Low-High
## 347 High-High High-High High-High
## 348  Low-High  Low-High  Low-High
## 349 High-High High-High High-High
## 350 High-High High-High High-High
## 351  High-Low  High-Low  High-Low
## 352  Low-High  Low-High  Low-High
## 353 High-High High-High High-High
## 354 High-High High-High High-High
## 355 High-High High-High High-High
## 356 High-High High-High High-High
## 357 High-High High-High High-High
## 358  Low-High High-High  Low-High
## 359 High-High High-High High-High
## 360  Low-High  Low-High  Low-High
## 361   Low-Low   Low-Low   Low-Low
## 362  Low-High High-High  Low-High
## 363 High-High High-High High-High
## 364 High-High High-High High-High
## 365   Low-Low   Low-Low   Low-Low
## 366 High-High High-High High-High
## 367   Low-Low   Low-Low   Low-Low
## 368 High-High High-High High-High
## 369 High-High High-High High-High
## 370  High-Low  High-Low  High-Low
## 371 High-High High-High High-High
## 372   Low-Low   Low-Low   Low-Low
## 373  High-Low  High-Low  High-Low
## 374  Low-High  Low-High  Low-High
## 375  High-Low  High-Low  High-Low
## 376   Low-Low  High-Low   Low-Low
## 377 High-High High-High High-High
## 378  Low-High  Low-High  Low-High
## 379   Low-Low   Low-Low   Low-Low
## 380 High-High High-High High-High
## 381  Low-High High-High  Low-High
## 382  Low-High  Low-High  Low-High
## 383   Low-Low   Low-Low   Low-Low
## 384 High-High High-High High-High
## 385 High-High High-High High-High
## 386   Low-Low   Low-Low   Low-Low
## 387  High-Low  High-Low  High-Low
## 388 High-High High-High High-High
## 389 High-High High-High High-High
## 390   Low-Low   Low-Low   Low-Low
## 391   Low-Low   Low-Low   Low-Low
## 392  Low-High  Low-High  Low-High
## 393   Low-Low   Low-Low   Low-Low
## 394   Low-Low   Low-Low   Low-Low
## 395  High-Low  High-Low  High-Low
## 396   Low-Low   Low-Low   Low-Low
## 397  High-Low  High-Low  High-Low
## 398   Low-Low  High-Low   Low-Low
## 399 High-High High-High High-High
## 400   Low-Low   Low-Low   Low-Low
## 401   Low-Low   Low-Low   Low-Low
## 402 High-High High-High High-High
## 403 High-High High-High High-High
## 404   Low-Low  High-Low   Low-Low
## 405  High-Low  High-Low  High-Low
## 406 High-High High-High High-High
## 407   Low-Low   Low-Low   Low-Low
## 408   Low-Low   Low-Low   Low-Low
## 409  Low-High  Low-High  Low-High
## 410  Low-High  Low-High  Low-High
## 411 High-High High-High High-High
## 412  Low-High  Low-High  Low-High
## 413  High-Low  High-Low  High-Low
## 414   Low-Low   Low-Low   Low-Low
## 415  High-Low  High-Low  High-Low
## 416   Low-Low   Low-Low   Low-Low
## 417   Low-Low   Low-Low   Low-Low

indice de moran global para para detecar a presença de dependencias antes da regressão espacial

Mglobal1 <- moran.test(Ba_shape$IDHM, nb2listw(Ne.nb), alternative = "two.sided")
head(Ba_shape.mloc1)
##             Ii          E.Ii      Var.Ii        Z.Ii Pr(z != E(Ii))
## 0 -0.001272182 -0.0001171665 0.008044022 -0.01287808     0.98972506
## 1  0.037910379 -0.0005060820 0.105210572  0.11843707     0.90572135
## 2  0.216727888 -0.0002006788 0.020765359  1.50538308     0.13222562
## 3  0.979391381 -0.0032497872 0.267547587  1.89974117     0.05746709
## 4  0.634438250 -0.0027297299 0.139505292  1.70591977     0.08802302
## 5 -0.034595336 -0.0001389114 0.009536702 -0.35283455     0.72421248

Gráfico de espalhamento de moran para IDH

moran.plot(Indicadores$IDHM, listw=vizinhanca,zero.policy=T,
            labels=as.character(Indicadores$Município),
           xlab="IDHM",
           ylab="Spatial Lag",
           pch=16, col="black",cex=.5, quiet=TRUE)

Gráfico de espalhamento de moran para theil

moran.plot(Indicadores$THEIL, listw=vizinhanca,zero.policy=T,
           xlab="Theil",
           ylab="Spatial Lag",
           pch=16, col="black",cex=.5, quiet=TRUE)

Gráfico de espalhamento de moran para Gini

moran.plot(Indicadores$GINI, listw=vizinhanca,zero.policy=T,
           xlab="Gini",
           ylab="Spatial Lag",
           pch=16, col="black",cex=.5, quiet=TRUE)

LISA MAP Independentes para IDH

LISA1 <- classIntervals(Ba_shape.mloc1[,5], style="fixed",
                        intervalClosure = c( "right"),
                        fixedBreaks=c(0, 0.001, 0.01, 0.05, by=1))

colors <- c("red", "blue", "lightpink", "skyblue2", "white")
COL_Lisa1 <- findColours(LISA1, colors)
# window(6,4) # quando quiser salva uma imagem com boa qualidade
#par(mar=c(0,0,0,0))

plot(Ba_shape, col=COL_Lisa1,border=NA)
#title("LISA Map")

TB5 <- attr(COL_Lisa1, "table")
legtext <- paste(names(TB5))
legend("bottomright", fill=attr(COL_Lisa1, "palette"), 
       legend=c("0.1%", "1.0%", "5.0%", "N.sgf"), bty="n", cex=0.8)

plot(Ba_shape,add=TRUE,lwd=1)

scalebar(500, xy=c(-47.97892, -17.23938), 
         type="bar", below="km",
         cex=0.8, lonlat=T,divs=4)

compassRose(-48.45524, -14.00634,cex=0.8)
title("Lisa MAP para o IDH dos municípios do estado da Bahia ")

LISA MAP Independentes para theil

LISA2 <- classIntervals(Ba_shape.mloc2[,5], style="fixed",
                        intervalClosure = c( "right"),
                        fixedBreaks=c(0, 0.001, 0.01, 0.05, by=1))

colors <- c("red", "blue", "lightpink", "skyblue2", "white")
COL_Lisa2 <- findColours(LISA2, colors)
# window(6,4) # quando quiser salva uma imagem com boa qualidade
#par(mar=c(0,0,0,0))

plot(Ba_shape, col=COL_Lisa2,border=NA)
#title("LISA Map")

TB5 <- attr(COL_Lisa2, "table")
legtext <- paste(names(TB5))
legend("bottomright", fill=attr(COL_Lisa2, "palette"), 
       legend=c("0.1%", "1.0%", "5.0%", "N.sgf"), bty="n", cex=0.8)

plot(Ba_shape,add=TRUE,lwd=1)

scalebar(500, xy=c(-47.97892, -17.23938), 
         type="bar", below="km",
         cex=0.8, lonlat=T,divs=4)

compassRose(-49.45524, -14.00634,cex=0.6)
title("Lisa MAP para o indice de THEIL dos municípios do estado da Bahia ")

LISA MAP Independentes para Gini

LISA3 <- classIntervals(Ba_shape.mloc3[,5], style="fixed",
                        intervalClosure = c( "right"),
                        fixedBreaks=c(0, 0.001, 0.01, 0.05, by=1))

colors <- c("red", "blue", "lightpink", "skyblue2", "white")
COL_Lisa3 <- findColours(LISA3, colors)
# window(6,4) # quando quiser salva uma imagem com boa qualidade
#par(mar=c(0,0,0,0))

plot(Ba_shape, col=COL_Lisa3,border=NA)
#title("LISA Map")

TB5 <- attr(COL_Lisa3, "table")
legtext <- paste(names(TB5))
legend("bottomright", fill=attr(COL_Lisa3, "palette"), 
       legend=c("0.1%", "1.0%", "5.0%", "N.sgf"), bty="n", cex=0.8)

plot(Ba_shape,add=TRUE,lwd=1)

scalebar(500, xy=c(-47.97892, -17.23938), 
         type="bar", below="km",
         cex=0.8, lonlat=T,divs=4)

compassRose(-49.45524, -14.00634,cex=0.6)
title("Lisa MAP para o indice de GINI dos municípios do estado da Bahia")