library(sf)
## Warning: package 'sf' was built under R version 4.5.3
## Linking to GEOS 3.14.1, GDAL 3.12.1, PROJ 9.7.1; sf_use_s2() is TRUE
library(dplyr)
## Warning: package 'dplyr' was built under R version 4.5.3
## 
## 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
library(spdep)
## Warning: package 'spdep' was built under R version 4.5.3
## Loading required package: spData
## To access larger datasets in this package, install the spDataLarge
## package with: `install.packages('spDataLarge',
## repos='https://nowosad.github.io/drat/', type='source')`
library(readxl)
## Warning: package 'readxl' was built under R version 4.5.3
library(tmap)
## Warning: package 'tmap' was built under R version 4.5.3
library(writexl)
indo <- st_read(
  "H:/My Drive/Semester 6/Pengantar Statistika Spasial/Pengantar Statistika Spasial/gadm41_IDN_shp/gadm41_IDN_2.shp"
)
## Reading layer `gadm41_IDN_2' from data source 
##   `H:\My Drive\Semester 6\Pengantar Statistika Spasial\Pengantar Statistika Spasial\gadm41_IDN_shp\gadm41_IDN_2.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 502 features and 13 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 95.00971 ymin: -11.00761 xmax: 141.0194 ymax: 6.076941
## Geodetic CRS:  WGS 84
kalimantan55 <- indo %>%
  filter(NAME_1 %in% c(
    "Kalimantan Barat",
    "Kalimantan Selatan",
    "Kalimantan Tengah",
    "Kalimantan Timur",
    "Kalimantan Utara"
  ))

print(nrow(kalimantan55))
## [1] 55
mahulu <- st_read(
  "H:/My Drive/Semester 6/Pengantar Statistika Spasial/Pengantar Statistika Spasial/MAHAKAMHULU/MAHAKAMHULU/MAHAKAMHULU"
)
## Multiple layers are present in data source H:\My Drive\Semester 6\Pengantar Statistika Spasial\Pengantar Statistika Spasial\MAHAKAMHULU\MAHAKAMHULU\MAHAKAMHULU, reading layer `ADMINISTRASIKECAMATAN_AR_50K'.
## Use `st_layers' to list all layer names and their type in a data source.
## Set the `layer' argument in `st_read' to read a particular layer.
## Warning in CPL_read_ogr(dsn, layer, query, as.character(options), quiet, :
## automatically selected the first layer in a data source containing more than
## one.
## Reading layer `ADMINISTRASIKECAMATAN_AR_50K' from data source 
##   `H:\My Drive\Semester 6\Pengantar Statistika Spasial\Pengantar Statistika Spasial\MAHAKAMHULU\MAHAKAMHULU\MAHAKAMHULU' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 24 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 113.75 ymin: -0.5 xmax: 116 ymax: 1.522914
## Geodetic CRS:  WGS 84
mahulu_kab <- mahulu %>%
  filter(WADMKK == "MAHAKAM ULU") %>%
  summarise(geometry = st_union(geometry))

mahulu_kab$GID_2 <- NA
mahulu_kab$GID_0 <- "IDN"
mahulu_kab$COUNTRY <- "Indonesia"
mahulu_kab$GID_1 <- NA
mahulu_kab$NAME_1 <- "Kalimantan Timur"
mahulu_kab$NL_NAME_1 <- NA
mahulu_kab$NAME_2 <- "Mahakam Ulu"
mahulu_kab$VARNAME_2 <- NA
mahulu_kab$NL_NAME_2 <- NA
mahulu_kab$TYPE_2 <- "Kabupaten"
mahulu_kab$ENGTYPE_2 <- "Regency"
mahulu_kab$CC_2 <- NA
mahulu_kab$HASC_2 <- NA

mahulu_kab <- mahulu_kab %>%
  select(names(kalimantan55))
kaltim56 <- rbind(kalimantan55, mahulu_kab)

print(nrow(kaltim56))
## [1] 56
data_excel <- read_excel(
"H:/My Drive/Semester 6/Pengantar Statistika Spasial/16231017_Data UTS_Pengantar Statistika Spasial (1).xlsx"
)

head(data_excel)
## # A tibble: 6 × 5
##   `Kabupaten/Kota`    Provinsi         Latitude Longitude `Produksi Ketimun`
##   <chr>               <chr>               <dbl>     <dbl> <chr>             
## 1 Paser               Kalimantan Timur   -1.44       116. 86.97             
## 2 Kutai Barat         Kalimantan Timur   -0.594      116. 197.72499999999999
## 3 Kutai Kartanegara   Kalimantan Timur   -0.440      117. 4747.2939999999999
## 4 Kutai Timur         Kalimantan Timur    1.04       118. 696.05499999999995
## 5 Berau               Kalimantan Timur    2          117. 724.81700000000001
## 6 Penajam Paser Utara Kalimantan Timur   -1.25       117. 478.42500000000001
data_spasial <- left_join(
  kaltim56,
  data_excel,
  by = c("NAME_2" = "Kabupaten/Kota")
)

print(nrow(data_spasial))
## [1] 56
sum(is.na(data_spasial$`Produksi Ketimun`))
## [1] 0
data_spasial$NAME_1 <- factor(
  data_spasial$NAME_1,
  levels = c(
    "Kalimantan Barat",
    "Kalimantan Selatan",
    "Kalimantan Tengah",
    "Kalimantan Timur",
    "Kalimantan Utara"
  )
)

data_spasial <- data_spasial %>%
  arrange(NAME_1, NAME_2)

View(
  data.frame(
    No = 1:nrow(data_spasial),
    Provinsi = data_spasial$NAME_1,
    Kabupaten = data_spasial$NAME_2
  )
)
nb_queen <- poly2nb(
  data_spasial,
  queen = TRUE,
  snap = 0.1
)
## Warning in poly2nb(data_spasial, queen = TRUE, snap = 0.1): some observations have no neighbours;
## if this seems unexpected, try increasing the snap argument.
## Warning in poly2nb(data_spasial, queen = TRUE, snap = 0.1): neighbour object has 2 sub-graphs;
## if this sub-graph count seems unexpected, try increasing the snap argument.
lw_queen <- nb2listw(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

# matriks bobot queen (binary)
W_queen <- nb2mat(
  nb_queen,
  style = "B",
  zero.policy = TRUE
)

# row standardization queen
W_queen_std <- nb2mat(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

dim(W_queen)
## [1] 56 56
View(W_queen)
nb_queen <- poly2nb(
  data_spasial,
  queen = TRUE,
  snap = 0.1
)
## Warning in poly2nb(data_spasial, queen = TRUE, snap = 0.1): some observations have no neighbours;
## if this seems unexpected, try increasing the snap argument.
## Warning in poly2nb(data_spasial, queen = TRUE, snap = 0.1): neighbour object has 2 sub-graphs;
## if this sub-graph count seems unexpected, try increasing the snap argument.
lw_queen <- nb2listw(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

# matriks bobot queen (binary)
W_queen <- nb2mat(
  nb_queen,
  style = "B",
  zero.policy = TRUE
)

# row standardization queen
W_queen_std <- nb2mat(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

dim(W_queen)
## [1] 56 56
View(W_queen)
indo <- st_read(
"H:/My Drive/Semester 6/Pengantar Statistika Spasial/Pengantar Statistika Spasial/gadm41_IDN_shp/gadm41_IDN_2.shp"
)
## Reading layer `gadm41_IDN_2' from data source 
##   `H:\My Drive\Semester 6\Pengantar Statistika Spasial\Pengantar Statistika Spasial\gadm41_IDN_shp\gadm41_IDN_2.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 502 features and 13 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 95.00971 ymin: -11.00761 xmax: 141.0194 ymax: 6.076941
## Geodetic CRS:  WGS 84
kalimantan55 <- indo %>%
  filter(NAME_1 %in% c(
    "Kalimantan Timur",
    "Kalimantan Barat",
    "Kalimantan Tengah",
    "Kalimantan Selatan",
    "Kalimantan Utara"
  ))

print(nrow(kalimantan55))
## [1] 55
#gabungkan shp mahulu 
mahulu <- st_read(
"H:/My Drive/Semester 6/Pengantar Statistika Spasial/Pengantar Statistika Spasial/MAHAKAMHULU/MAHAKAMHULU/MAHAKAMHULU"
)
## Multiple layers are present in data source H:\My Drive\Semester 6\Pengantar Statistika Spasial\Pengantar Statistika Spasial\MAHAKAMHULU\MAHAKAMHULU\MAHAKAMHULU, reading layer `ADMINISTRASIKECAMATAN_AR_50K'.
## Use `st_layers' to list all layer names and their type in a data source.
## Set the `layer' argument in `st_read' to read a particular layer.
## Warning in CPL_read_ogr(dsn, layer, query, as.character(options), quiet, :
## automatically selected the first layer in a data source containing more than
## one.
## Reading layer `ADMINISTRASIKECAMATAN_AR_50K' from data source 
##   `H:\My Drive\Semester 6\Pengantar Statistika Spasial\Pengantar Statistika Spasial\MAHAKAMHULU\MAHAKAMHULU\MAHAKAMHULU' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 24 features and 27 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY
## Bounding box:  xmin: 113.75 ymin: -0.5 xmax: 116 ymax: 1.522914
## Geodetic CRS:  WGS 84
mahulu_kab <- mahulu %>%
  filter(WADMKK == "MAHAKAM ULU") %>%
  summarise(geometry = st_union(geometry))

mahulu_kab$GID_2 <- NA
mahulu_kab$GID_0 <- "IDN"
mahulu_kab$COUNTRY <- "Indonesia"
mahulu_kab$GID_1 <- NA
mahulu_kab$NAME_1 <- "Kalimantan Timur"
mahulu_kab$NL_NAME_1 <- NA
mahulu_kab$NAME_2 <- "Mahakam Ulu"
mahulu_kab$VARNAME_2 <- NA
mahulu_kab$NL_NAME_2 <- NA
mahulu_kab$TYPE_2 <- "Kabupaten"
mahulu_kab$ENGTYPE_2 <- "Regency"
mahulu_kab$CC_2 <- NA
mahulu_kab$HASC_2 <- NA


mahulu_kab <- mahulu_kab %>%
  select(names(kalimantan55))


kaltim56 <- rbind(kalimantan55, mahulu_kab)

print(nrow(kaltim56))
## [1] 56
coords <- st_coordinates(
  st_centroid(data_spasial)
)
## Warning: st_centroid assumes attributes are constant over geometries
knn4 <- knearneigh(
  coords,
  k = 4
)

nb_knn <- knn2nb(knn4)

lw_knn <- nb2listw(
  nb_knn,
  style = "W"
)

# matriks bobot KNN
W_knn <- nb2mat(
  nb_knn,
  style = "B"
)

# row standardization KNN
W_knn_std <- nb2mat(
  nb_knn,
  style = "W"
)

dim(W_knn)
## [1] 56 56
View(W_knn)
warna_wilayah <- heat.colors(
  nrow(data_spasial),
  alpha = 0.5
)

par(
  mar = c(1, 1, 3, 1)
)

# Plot peta utama
plot(
  st_geometry(data_spasial),
  col = warna_wilayah,
  border = "grey30",
  lwd = 0.8,
  main = "Peta Kabupaten/Kota Pulau Kalimantan",
  xlim = c(107.5, 119.5),
  ylim = c(-4.5, 4.5),
  asp = 1
)

# Titik centroid
centroid <- st_centroid(data_spasial)
## Warning: st_centroid assumes attributes are constant over geometries
# Nama kabupaten/kota
text(
  st_coordinates(centroid),
  labels = data_spasial$NAME_2,
  cex = 0.42,     
  font = 2,       
  col = "black",
  pos = 3,
  offset = 0.12
)

nb_queen <- poly2nb(
  data_spasial,
  queen = TRUE,
  snap = 0.1
)
## Warning in poly2nb(data_spasial, queen = TRUE, snap = 0.1): some observations have no neighbours;
## if this seems unexpected, try increasing the snap argument.
## Warning in poly2nb(data_spasial, queen = TRUE, snap = 0.1): neighbour object has 2 sub-graphs;
## if this sub-graph count seems unexpected, try increasing the snap argument.
# list bobot row-standardized
lw_queen <- nb2listw(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

# matriks bobot binary
W_queen <- nb2mat(
  nb_queen,
  style = "B",
  zero.policy = TRUE
)

# matriks row standardization
W_queen_std <- nb2mat(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

View(W_queen)
dim(W_queen)
## [1] 56 56
print(W_queen)
##    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
## 1  0 0 0 0 0 0 1 0 1  1  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 2  0 0 0 0 0 0 0 0 0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 3  0 0 0 1 0 1 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 4  0 0 1 0 0 1 0 1 0  0  1  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 5  0 0 0 0 0 1 0 0 1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 6  0 0 1 1 1 0 1 0 1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 7  1 0 0 0 0 1 0 0 1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 8  0 0 0 1 0 0 0 0 0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 9  1 0 0 0 1 1 1 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 10 1 0 0 0 0 0 0 0 0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 11 1 0 0 1 0 1 1 0 0  0  0  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 12 0 0 0 1 0 0 0 0 0  0  1  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 13 1 0 0 0 0 0 0 0 0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 14 0 1 0 1 0 0 0 1 0  0  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 15 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  1  1  1  1  0  0  0  0
## 16 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  1  1  1  1  0  0  1  0  1  1  1  0
## 17 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  1  0  0
## 18 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  0  0  1  0  0  0  0  0  0  0  0  0
## 19 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  0  1  0  0  0  0  0  0  0  0  1  1
## 20 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  0  0  0  0  1  1  1  0  0  0  1  0
## 21 0 0 0 0 0 0 0 0 0  0  0  0  0  0  1  0  0  0  0  1  0  1  1  0  0  0  0  0
## 22 0 0 0 0 0 0 0 0 0  0  0  0  0  0  1  0  0  0  0  1  1  0  0  1  0  0  1  1
## 23 0 0 0 0 0 0 0 0 0  0  0  0  0  0  1  1  0  0  0  1  1  0  0  0  1  0  0  0
## 24 0 0 0 0 0 0 0 0 0  0  0  0  0  0  1  0  0  0  0  0  0  1  0  0  0  0  0  1
## 25 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  0  0  0  0  0  0  1  0  0  1  0  0
## 26 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  1  0  0  0  0  0  0  0  1  0  0  0
## 27 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  1  0  0  1  1  0  1  0  0  0  0  0  1
## 28 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  1  0  0  1  0  1  0  0  1  0
## 29 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  1  0  0  0  1
## 30 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  1
## 31 0 0 0 0 0 0 0 0 0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 32 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  1
## 33 0 0 0 0 0 0 0 1 0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 34 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 35 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 36 0 0 0 1 0 0 0 1 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 37 0 1 0 0 0 0 0 0 0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 38 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 39 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 40 0 0 0 0 0 0 0 1 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 41 0 0 0 1 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 42 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 43 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 44 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 45 0 1 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 46 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 47 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 48 0 1 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 49 0 0 0 0 0 0 0 0 0  0  0  0  0  0  1  0  0  0  0  0  0  0  1  1  0  0  0  0
## 50 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 51 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 52 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 53 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 54 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 55 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 56 0 0 0 0 0 0 0 0 0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
##    29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53
## 1   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 2   0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  1  0  0  1  0  0  0  0  0
## 3   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 4   0  0  0  0  0  0  0  1  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0
## 5   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 6   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 7   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 8   0  0  0  0  1  0  0  1  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0
## 9   0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 10  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 11  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 12  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 13  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 14  0  0  1  0  1  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 15  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0
## 16  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 17  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 18  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 19  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 20  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 21  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 22  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 23  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0
## 24  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0
## 25  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 26  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 27  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 28  1  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 29  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 30  0  0  0  1  0  0  0  0  1  0  0  0  0  0  0  0  1  0  0  1  1  0  0  0  0
## 31  0  0  0  1  1  0  0  0  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 32  0  1  1  0  0  0  0  0  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 33  0  0  1  0  0  0  1  0  0  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0
## 34  0  0  0  0  0  0  0  1  0  0  0  1  1  0  0  0  0  0  0  0  0  0  0  0  0
## 35  0  0  0  0  1  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0
## 36  0  0  0  0  0  1  0  0  0  0  0  1  1  0  0  0  0  0  0  0  0  0  0  0  0
## 37  0  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  1  0  0  0  0  0
## 38  0  0  1  0  1  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 39  0  0  1  1  1  0  0  0  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 40  0  0  0  0  1  1  1  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 41  0  0  0  0  0  1  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
## 42  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  1  0  0  0
## 43  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  1  1
## 44  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1  0  0  0  0  0  0
## 45  0  1  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  1  0  1  1  1  0  0  1
## 46  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  1  1  0  1  1  0  1  1  0  1
## 47  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1  0  1  0  0  0  0  0  0  1
## 48  0  1  0  0  0  0  0  0  1  0  0  0  0  0  0  0  1  1  0  0  0  0  0  0  1
## 49  0  1  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  1  0  0  0
## 50  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  1  1  0  0  1  0  0  0  0
## 51  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0
## 52  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  0  0  0  0  0  0  0  0  1
## 53  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  0  1  1  1  1  0  0  0  1  0
## 54  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1
## 55  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  1  1
## 56  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0  0
##    54 55 56
## 1   0  0  0
## 2   0  0  0
## 3   0  0  0
## 4   0  0  0
## 5   0  0  0
## 6   0  0  0
## 7   0  0  0
## 8   0  0  0
## 9   0  0  0
## 10  0  0  0
## 11  0  0  0
## 12  0  0  0
## 13  0  0  0
## 14  0  0  0
## 15  0  0  0
## 16  0  0  0
## 17  0  0  0
## 18  0  0  0
## 19  0  0  0
## 20  0  0  0
## 21  0  0  0
## 22  0  0  0
## 23  0  0  0
## 24  0  0  0
## 25  0  0  0
## 26  0  0  0
## 27  0  0  0
## 28  0  0  0
## 29  0  0  0
## 30  0  0  0
## 31  0  0  0
## 32  0  0  0
## 33  0  0  0
## 34  0  0  0
## 35  0  0  0
## 36  0  0  0
## 37  0  0  0
## 38  0  0  0
## 39  0  0  0
## 40  0  0  0
## 41  0  0  0
## 42  0  0  0
## 43  0  0  0
## 44  0  0  0
## 45  0  0  0
## 46  0  0  0
## 47  0  0  0
## 48  0  0  0
## 49  0  0  0
## 50  0  0  0
## 51  0  0  0
## 52  0  1  0
## 53  1  1  0
## 54  0  1  0
## 55  1  0  0
## 56  0  0  0
## attr(,"call")
## nb2mat(neighbours = nb_queen, style = "B", zero.policy = TRUE)
# KNN (k = 4)
coords <- st_coordinates(
  st_centroid(data_spasial)
)
## Warning: st_centroid assumes attributes are constant over geometries
knn4 <- knearneigh(
  coords,
  k = 4
)

nb_knn <- knn2nb(knn4)

# list bobot row-standardized
lw_knn <- nb2listw(
  nb_knn,
  style = "W"
)

# matriks bobot binary
W_knn <- nb2mat(
  nb_knn,
  style = "B"
)

# matriks row standardization
W_knn_std <- nb2mat(
  nb_knn,
  style = "W"
)

View(W_knn)
dim(W_knn)
## [1] 56 56
# ROW STANDARDIZATION - QUEEN

W_queen_std <- nb2mat(
  nb_queen,
  style = "W",
  zero.policy = TRUE
)

View(W_queen_std)

dim(W_queen_std)
## [1] 56 56
print(W_queen_std)
##            1         2         3         4         5         6         7
## 1  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.2000000
## 2  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 3  0.0000000 0.0000000 0.0000000 0.5000000 0.0000000 0.5000000 0.0000000
## 4  0.0000000 0.0000000 0.1250000 0.0000000 0.0000000 0.1250000 0.0000000
## 5  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.5000000 0.0000000
## 6  0.0000000 0.0000000 0.1666667 0.1666667 0.1666667 0.0000000 0.1666667
## 7  0.2500000 0.0000000 0.0000000 0.0000000 0.0000000 0.2500000 0.0000000
## 8  0.0000000 0.0000000 0.0000000 0.2000000 0.0000000 0.0000000 0.0000000
## 9  0.2500000 0.0000000 0.0000000 0.0000000 0.2500000 0.2500000 0.2500000
## 10 0.5000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 11 0.1666667 0.0000000 0.0000000 0.1666667 0.0000000 0.1666667 0.1666667
## 12 0.0000000 0.0000000 0.0000000 0.3333333 0.0000000 0.0000000 0.0000000
## 13 0.5000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 14 0.0000000 0.1250000 0.0000000 0.1250000 0.0000000 0.0000000 0.0000000
## 15 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 16 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 17 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 18 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 19 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 20 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 21 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 22 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 23 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 24 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 25 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 26 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 27 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 28 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 29 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 30 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 31 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 32 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 33 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 34 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 35 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 36 0.0000000 0.0000000 0.0000000 0.2000000 0.0000000 0.0000000 0.0000000
## 37 0.0000000 0.1428571 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 38 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 39 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 40 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 41 0.0000000 0.0000000 0.0000000 0.3333333 0.0000000 0.0000000 0.0000000
## 42 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 43 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 44 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 45 0.0000000 0.1250000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 46 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 47 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 48 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 49 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 50 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 51 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 52 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 53 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 54 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 55 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 56 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
##            8         9  10        11        12  13        14        15
## 1  0.0000000 0.2000000 0.2 0.2000000 0.0000000 0.2 0.0000000 0.0000000
## 2  0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.2500000 0.0000000
## 3  0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 4  0.1250000 0.0000000 0.0 0.1250000 0.1250000 0.0 0.1250000 0.0000000
## 5  0.0000000 0.5000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 6  0.0000000 0.1666667 0.0 0.1666667 0.0000000 0.0 0.0000000 0.0000000
## 7  0.0000000 0.2500000 0.0 0.2500000 0.0000000 0.0 0.0000000 0.0000000
## 8  0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.2000000 0.0000000
## 9  0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 10 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.5 0.0000000 0.0000000
## 11 0.0000000 0.0000000 0.0 0.0000000 0.1666667 0.0 0.1666667 0.0000000
## 12 0.0000000 0.0000000 0.0 0.3333333 0.0000000 0.0 0.3333333 0.0000000
## 13 0.0000000 0.0000000 0.5 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 14 0.1250000 0.0000000 0.0 0.1250000 0.1250000 0.0 0.0000000 0.0000000
## 15 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 16 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 17 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 18 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 19 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 20 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 21 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.2500000
## 22 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.1428571
## 23 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.1666667
## 24 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.1666667
## 25 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 26 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 27 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 28 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 29 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 30 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 31 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.1666667 0.0000000
## 32 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 33 0.1428571 0.0000000 0.0 0.0000000 0.0000000 0.0 0.1428571 0.0000000
## 34 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 35 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 36 0.2000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 37 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.1428571 0.0000000
## 38 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 39 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 40 0.2000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 41 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 42 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 43 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 44 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 45 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 46 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 47 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 48 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 49 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.1666667
## 50 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 51 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 52 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 53 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 54 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 55 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
## 56 0.0000000 0.0000000 0.0 0.0000000 0.0000000 0.0 0.0000000 0.0000000
##           16        17    18        19        20        21        22        23
## 1  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 2  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 3  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 4  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 5  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 6  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 7  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 8  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 9  0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 10 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 11 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 12 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 13 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 14 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 15 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.2000000 0.2000000 0.2000000
## 16 0.0000000 0.1250000 0.125 0.1250000 0.1250000 0.0000000 0.0000000 0.1250000
## 17 0.5000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 18 0.5000000 0.0000000 0.000 0.5000000 0.0000000 0.0000000 0.0000000 0.0000000
## 19 0.2000000 0.0000000 0.200 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 20 0.2000000 0.0000000 0.000 0.0000000 0.0000000 0.2000000 0.2000000 0.2000000
## 21 0.0000000 0.0000000 0.000 0.0000000 0.2500000 0.0000000 0.2500000 0.2500000
## 22 0.0000000 0.0000000 0.000 0.0000000 0.1428571 0.1428571 0.0000000 0.0000000
## 23 0.1666667 0.0000000 0.000 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000
## 24 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000
## 25 0.3333333 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.3333333
## 26 0.3333333 0.3333333 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 27 0.2000000 0.0000000 0.000 0.2000000 0.2000000 0.0000000 0.2000000 0.0000000
## 28 0.0000000 0.0000000 0.000 0.1428571 0.0000000 0.0000000 0.1428571 0.0000000
## 29 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.3333333 0.0000000
## 30 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 31 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 32 0.0000000 0.0000000 0.000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000
## 33 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 34 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 35 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 36 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 37 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 38 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 39 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 40 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 41 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 42 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 43 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 44 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 45 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 46 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 47 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 48 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 49 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667
## 50 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 51 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 52 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 53 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 54 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 55 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 56 0.0000000 0.0000000 0.000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
##           24        25        26        27        28        29        30
## 1  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 2  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 3  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 4  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 5  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 6  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 7  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 8  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 9  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 10 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 11 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 12 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 13 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 14 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 15 0.2000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 16 0.0000000 0.1250000 0.1250000 0.1250000 0.0000000 0.0000000 0.0000000
## 17 0.0000000 0.0000000 0.5000000 0.0000000 0.0000000 0.0000000 0.0000000
## 18 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 19 0.0000000 0.0000000 0.0000000 0.2000000 0.2000000 0.0000000 0.0000000
## 20 0.0000000 0.0000000 0.0000000 0.2000000 0.0000000 0.0000000 0.0000000
## 21 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 22 0.1428571 0.0000000 0.0000000 0.1428571 0.1428571 0.1428571 0.0000000
## 23 0.0000000 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 24 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.1666667 0.1666667
## 25 0.0000000 0.0000000 0.3333333 0.0000000 0.0000000 0.0000000 0.0000000
## 26 0.0000000 0.3333333 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 27 0.0000000 0.0000000 0.0000000 0.0000000 0.2000000 0.0000000 0.0000000
## 28 0.1428571 0.0000000 0.0000000 0.1428571 0.0000000 0.1428571 0.1428571
## 29 0.3333333 0.0000000 0.0000000 0.0000000 0.3333333 0.0000000 0.0000000
## 30 0.1428571 0.0000000 0.0000000 0.0000000 0.1428571 0.0000000 0.0000000
## 31 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 32 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 0.1666667
## 33 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 34 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 35 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 36 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 37 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
## 38 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 39 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 40 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 41 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 42 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 43 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 44 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 45 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1250000
## 46 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 47 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 48 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667
## 49 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667
## 50 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 51 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 52 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 53 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 54 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 55 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 56 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
##           31        32        33        34        35        36        37
## 1  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 2  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.2500000
## 3  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 4  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1250000 0.0000000
## 5  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 6  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 7  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 8  0.0000000 0.0000000 0.2000000 0.0000000 0.0000000 0.2000000 0.0000000
## 9  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 10 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 11 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 12 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 13 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 14 0.1250000 0.0000000 0.1250000 0.0000000 0.0000000 0.0000000 0.1250000
## 15 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 16 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 17 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 18 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 19 0.0000000 0.2000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 20 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 21 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 22 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 23 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 24 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 25 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 26 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 27 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 28 0.0000000 0.1428571 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 29 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 30 0.0000000 0.1428571 0.0000000 0.0000000 0.0000000 0.0000000 0.1428571
## 31 0.0000000 0.1666667 0.1666667 0.0000000 0.0000000 0.0000000 0.1666667
## 32 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667
## 33 0.1428571 0.0000000 0.0000000 0.0000000 0.1428571 0.0000000 0.0000000
## 34 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.3333333 0.0000000
## 35 0.0000000 0.0000000 0.5000000 0.0000000 0.0000000 0.0000000 0.0000000
## 36 0.0000000 0.0000000 0.0000000 0.2000000 0.0000000 0.0000000 0.0000000
## 37 0.1428571 0.1428571 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 38 0.3333333 0.0000000 0.3333333 0.0000000 0.0000000 0.0000000 0.0000000
## 39 0.2500000 0.2500000 0.2500000 0.0000000 0.0000000 0.0000000 0.0000000
## 40 0.0000000 0.0000000 0.2000000 0.2000000 0.2000000 0.2000000 0.0000000
## 41 0.0000000 0.0000000 0.0000000 0.3333333 0.0000000 0.3333333 0.0000000
## 42 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 43 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 44 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 45 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1250000
## 46 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 47 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 48 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667
## 49 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 50 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 51 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 52 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 53 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 54 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 55 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
## 56 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000
##           38        39        40        41    42        43    44        45
## 1  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 2  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.2500000
## 3  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 4  0.0000000 0.0000000 0.0000000 0.1250000 0.000 0.0000000 0.000 0.0000000
## 5  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 6  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 7  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 8  0.0000000 0.0000000 0.2000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 9  0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 10 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 11 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 12 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 13 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 14 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 15 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 16 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 17 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 18 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 19 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 20 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 21 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 22 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 23 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 24 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 25 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 26 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 27 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 28 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 29 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 30 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.1428571
## 31 0.1666667 0.1666667 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 32 0.0000000 0.1666667 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 33 0.1428571 0.1428571 0.1428571 0.0000000 0.000 0.0000000 0.000 0.0000000
## 34 0.0000000 0.0000000 0.3333333 0.3333333 0.000 0.0000000 0.000 0.0000000
## 35 0.0000000 0.0000000 0.5000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 36 0.0000000 0.0000000 0.2000000 0.2000000 0.000 0.0000000 0.000 0.0000000
## 37 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.1428571
## 38 0.0000000 0.3333333 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 39 0.2500000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 40 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 41 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 42 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 43 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 44 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 45 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 46 0.0000000 0.0000000 0.0000000 0.0000000 0.125 0.0000000 0.125 0.1250000
## 47 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.2500000 0.250 0.0000000
## 48 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.1666667
## 49 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.1666667
## 50 0.0000000 0.0000000 0.0000000 0.0000000 0.250 0.0000000 0.000 0.2500000
## 51 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 52 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.3333333 0.000 0.0000000
## 53 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.1250000 0.000 0.1250000
## 54 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 55 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
## 56 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.000 0.0000000
##           46        47        48        49        50    51        52        53
## 1  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 2  0.0000000 0.0000000 0.2500000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 3  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 4  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 5  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 6  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 7  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 8  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 9  0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 10 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 11 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 12 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 13 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 14 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 15 0.0000000 0.0000000 0.0000000 0.2000000 0.0000000 0.000 0.0000000 0.0000000
## 16 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 17 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 18 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 19 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 20 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 21 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 22 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 23 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 0.000 0.0000000 0.0000000
## 24 0.0000000 0.0000000 0.0000000 0.1666667 0.0000000 0.000 0.0000000 0.0000000
## 25 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 26 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 27 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 28 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 29 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 30 0.0000000 0.0000000 0.1428571 0.1428571 0.0000000 0.000 0.0000000 0.0000000
## 31 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 32 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 33 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 34 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 35 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 36 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 37 0.0000000 0.0000000 0.1428571 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 38 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 39 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 40 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 41 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 42 0.5000000 0.0000000 0.0000000 0.0000000 0.5000000 0.000 0.0000000 0.0000000
## 43 0.0000000 0.3333333 0.0000000 0.0000000 0.0000000 0.000 0.3333333 0.3333333
## 44 0.5000000 0.5000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 45 0.1250000 0.0000000 0.1250000 0.1250000 0.1250000 0.000 0.0000000 0.1250000
## 46 0.0000000 0.1250000 0.1250000 0.0000000 0.1250000 0.125 0.0000000 0.1250000
## 47 0.2500000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.2500000
## 48 0.1666667 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.1666667
## 49 0.0000000 0.0000000 0.0000000 0.0000000 0.1666667 0.000 0.0000000 0.0000000
## 50 0.2500000 0.0000000 0.0000000 0.2500000 0.0000000 0.000 0.0000000 0.0000000
## 51 1.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
## 52 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.3333333
## 53 0.1250000 0.1250000 0.1250000 0.0000000 0.0000000 0.000 0.1250000 0.0000000
## 54 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.5000000
## 55 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.3333333 0.3333333
## 56 0.0000000 0.0000000 0.0000000 0.0000000 0.0000000 0.000 0.0000000 0.0000000
##           54        55 56
## 1  0.0000000 0.0000000  0
## 2  0.0000000 0.0000000  0
## 3  0.0000000 0.0000000  0
## 4  0.0000000 0.0000000  0
## 5  0.0000000 0.0000000  0
## 6  0.0000000 0.0000000  0
## 7  0.0000000 0.0000000  0
## 8  0.0000000 0.0000000  0
## 9  0.0000000 0.0000000  0
## 10 0.0000000 0.0000000  0
## 11 0.0000000 0.0000000  0
## 12 0.0000000 0.0000000  0
## 13 0.0000000 0.0000000  0
## 14 0.0000000 0.0000000  0
## 15 0.0000000 0.0000000  0
## 16 0.0000000 0.0000000  0
## 17 0.0000000 0.0000000  0
## 18 0.0000000 0.0000000  0
## 19 0.0000000 0.0000000  0
## 20 0.0000000 0.0000000  0
## 21 0.0000000 0.0000000  0
## 22 0.0000000 0.0000000  0
## 23 0.0000000 0.0000000  0
## 24 0.0000000 0.0000000  0
## 25 0.0000000 0.0000000  0
## 26 0.0000000 0.0000000  0
## 27 0.0000000 0.0000000  0
## 28 0.0000000 0.0000000  0
## 29 0.0000000 0.0000000  0
## 30 0.0000000 0.0000000  0
## 31 0.0000000 0.0000000  0
## 32 0.0000000 0.0000000  0
## 33 0.0000000 0.0000000  0
## 34 0.0000000 0.0000000  0
## 35 0.0000000 0.0000000  0
## 36 0.0000000 0.0000000  0
## 37 0.0000000 0.0000000  0
## 38 0.0000000 0.0000000  0
## 39 0.0000000 0.0000000  0
## 40 0.0000000 0.0000000  0
## 41 0.0000000 0.0000000  0
## 42 0.0000000 0.0000000  0
## 43 0.0000000 0.0000000  0
## 44 0.0000000 0.0000000  0
## 45 0.0000000 0.0000000  0
## 46 0.0000000 0.0000000  0
## 47 0.0000000 0.0000000  0
## 48 0.0000000 0.0000000  0
## 49 0.0000000 0.0000000  0
## 50 0.0000000 0.0000000  0
## 51 0.0000000 0.0000000  0
## 52 0.0000000 0.3333333  0
## 53 0.1250000 0.1250000  0
## 54 0.0000000 0.5000000  0
## 55 0.3333333 0.0000000  0
## 56 0.0000000 0.0000000  0
## attr(,"call")
## nb2mat(neighbours = nb_queen, style = "W", zero.policy = TRUE)
# ROW STANDARDIZATION - KNN

W_knn_std <- nb2mat(
  nb_knn,
  style = "W"
)

View(W_knn_std)

dim(W_knn_std)
## [1] 56 56
print(W_knn_std)
##       1    2    3    4    5    6    7    8    9   10   11   12   13   14   15
## 1  0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.25 0.00 0.00 0.25 0.00 0.00
## 2  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00
## 3  0.00 0.00 0.00 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00
## 4  0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 5  0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.00
## 6  0.00 0.00 0.25 0.00 0.25 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00
## 7  0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00
## 8  0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00
## 9  0.25 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00
## 10 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.00
## 11 0.00 0.00 0.00 0.00 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 12 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.25 0.00 0.00 0.25 0.00
## 13 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.00
## 14 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.25 0.25 0.00 0.00 0.00
## 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 16 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 18 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 19 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 21 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 22 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 24 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 27 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 28 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 29 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 30 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 31 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 32 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 33 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 34 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 36 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 37 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 38 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 39 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 40 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 41 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 42 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 43 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 44 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 45 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 46 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 47 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 48 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 49 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 51 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 52 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 53 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 54 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 55 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 56 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
##      16   17   18   19   20   21   22   23   24   25   26   27   28   29   30
## 1  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 2  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 3  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 4  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 5  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 6  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 7  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 8  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 9  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 11 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 12 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 13 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 15 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.25 0.00
## 16 0.00 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 17 0.25 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00
## 18 0.25 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00
## 19 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 20 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 21 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 22 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00
## 23 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 24 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00
## 25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 26 0.25 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 27 0.25 0.00 0.00 0.25 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 28 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.25 0.00
## 29 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.00
## 30 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.25 0.25 0.00
## 31 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 32 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00
## 33 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 34 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 36 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 37 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 38 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 39 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 40 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 41 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 42 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 43 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 44 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 45 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 46 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 47 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 48 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 49 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00
## 50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 51 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 52 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 53 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 54 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 55 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 56 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
##      31   32   33   34   35   36   37   38   39   40   41   42   43   44   45
## 1  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 2  0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 3  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 4  0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00
## 5  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 6  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 7  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 8  0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 9  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 11 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 12 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 13 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 16 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 18 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 19 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 21 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 22 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 24 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 27 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 28 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 29 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 30 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 31 0.00 0.25 0.25 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 32 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00
## 33 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 34 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00
## 35 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 36 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.00 0.00 0.00
## 37 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 38 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00
## 39 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 40 0.00 0.00 0.25 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 41 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 42 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 43 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 44 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 45 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 46 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25
## 47 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00
## 48 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25
## 49 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 50 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00
## 51 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00
## 52 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00
## 53 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00
## 54 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 55 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00
## 56 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.00
##      46   47   48   49   50   51   52   53   54   55   56
## 1  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 2  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 3  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 4  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 5  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 6  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 7  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 8  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 9  0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 10 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 11 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 12 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 13 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 14 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 15 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 16 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 17 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 18 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 19 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 20 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 21 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 22 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 23 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 24 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 26 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 27 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 28 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 29 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 30 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 31 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 32 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 33 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 34 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 35 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 36 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 37 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 38 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 39 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 40 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 41 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 42 0.25 0.00 0.00 0.25 0.25 0.25 0.00 0.00 0.00 0.00 0.00
## 43 0.00 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.25 0.25
## 44 0.25 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 45 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 46 0.00 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 47 0.25 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 48 0.25 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00
## 49 0.00 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00
## 50 0.25 0.00 0.00 0.25 0.00 0.25 0.00 0.00 0.00 0.00 0.00
## 51 0.25 0.00 0.00 0.00 0.25 0.00 0.00 0.00 0.00 0.00 0.00
## 52 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.25
## 53 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.25 0.00
## 54 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.25 0.00 0.25 0.25
## 55 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.00 0.25
## 56 0.00 0.00 0.00 0.00 0.00 0.00 0.25 0.00 0.25 0.25 0.00
## attr(,"call")
## nb2mat(neighbours = nb_knn, style = "W")
str(data_spasial$`Produksi Ketimun`)
##  chr [1:56] "5.1760000000000002" "88.811000000000007" "226.03299999999999" ...
data_spasial$`Produksi Ketimun` <- as.numeric(
  gsub("\\.", "", 
       gsub(",", ".", 
            data_spasial$`Produksi Ketimun`))
)
# MORAN'S I GLOBAL - QUEEN
moran_queen <- moran.test(
  data_spasial$`Produksi Ketimun`,
  lw_queen,
  zero.policy = TRUE
)

print(moran_queen)
## 
##  Moran I test under randomisation
## 
## data:  data_spasial$`Produksi Ketimun`  
## weights: lw_queen  
## n reduced by no-neighbour observations  
## 
## Moran I statistic standard deviate = 1.7505, p-value = 0.04002
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##       0.140422803      -0.018518519       0.008244378
# MORAN'S I GLOBAL - KNN

moran_knn <- moran.test(
  data_spasial$`Produksi Ketimun`,
  lw_knn
)

print(moran_knn)
## 
##  Moran I test under randomisation
## 
## data:  data_spasial$`Produksi Ketimun`  
## weights: lw_knn    
## 
## Moran I statistic standard deviate = 0.70011, p-value = 0.2419
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##       0.041134799      -0.018181818       0.007178311
# LOCAL MORAN'S I - QUEEN

lisa_queen <- localmoran(
  data_spasial$`Produksi Ketimun`,
  lw_queen,
  zero.policy = TRUE
)

# Gabungkan hasil ke data
hasil_lisa_queen <- data.frame(
  Kabupaten_Kota = data_spasial$NAME_2,
  Provinsi = data_spasial$NAME_1,
  Ii = lisa_queen[,1],          
  E.Ii = lisa_queen[,2],        
  Var.Ii = lisa_queen[,3],      
  Z.Ii = lisa_queen[,4],        
  P.Value = lisa_queen[,5]      
)

View(hasil_lisa_queen)

print(hasil_lisa_queen)
##         Kabupaten_Kota           Provinsi           Ii          E.Ii
## 1           Bengkayang   Kalimantan Barat  0.646846599 -3.150006e-02
## 2          Kapuas Hulu   Kalimantan Barat -1.573377545 -1.427768e-01
## 3         Kayong Utara   Kalimantan Barat -0.071861085 -3.920445e-04
## 4             Ketapang   Kalimantan Barat -0.014971158 -8.722962e-04
## 5       Kota Pontianak   Kalimantan Barat  0.363167014 -1.049413e-02
## 6            Kubu Raya   Kalimantan Barat -0.212403305 -1.049413e-02
## 7               Landak   Kalimantan Barat  0.020352765 -1.304681e-05
## 8               Melawi   Kalimantan Barat  0.495022902 -1.049413e-02
## 9            Pontianak   Kalimantan Barat  0.008658687 -7.008325e-04
## 10              Sambas   Kalimantan Barat  0.196867387 -9.100745e-03
## 11             Sanggau   Kalimantan Barat  0.501938049 -1.304859e-01
## 12             Sekadau   Kalimantan Barat  0.861217575 -4.198690e-02
## 13          Singkawang   Kalimantan Barat -0.768737843 -1.049413e-02
## 14             Sintang   Kalimantan Barat -0.355447355 -1.049413e-02
## 15            Balangan Kalimantan Selatan -0.116823332 -1.896915e-03
## 16              Banjar Kalimantan Selatan  0.019042413 -1.049413e-02
## 17         Banjar Baru Kalimantan Selatan  0.169170632 -1.969265e-02
## 18         Banjarmasin Kalimantan Selatan  0.577177229 -1.049413e-02
## 19        Barito Kuala Kalimantan Selatan  0.220183753 -1.049413e-02
## 20 Hulu Sungai Selatan Kalimantan Selatan -0.229963658 -7.350333e-03
## 21  Hulu Sungai Tengah Kalimantan Selatan  0.027179889 -2.819090e-03
## 22   Hulu Sungai Utara Kalimantan Selatan  0.183017029 -1.049413e-02
## 23           Kota Baru Kalimantan Selatan -0.011891441 -1.078063e-04
## 24            Tabalong Kalimantan Selatan  0.440082411 -1.049413e-02
## 25         Tanah Bumbu Kalimantan Selatan -0.101829481 -1.049413e-02
## 26          Tanah Laut Kalimantan Selatan -0.173110875 -2.139720e-02
## 27               Tapin Kalimantan Selatan  0.365132368 -1.049413e-02
## 28      Barito Selatan  Kalimantan Tengah  0.322181889 -1.049413e-02
## 29        Barito Timur  Kalimantan Tengah  0.577177229 -1.049413e-02
## 30        Barito Utara  Kalimantan Tengah  0.236113344 -1.049413e-02
## 31          Gunung Mas  Kalimantan Tengah  0.279682666 -1.049413e-02
## 32              Kapuas  Kalimantan Tengah -1.207790151 -4.595271e-02
## 33            Katingan  Kalimantan Tengah  0.577177229 -1.049413e-02
## 34  Kotawaringin Barat  Kalimantan Tengah  0.577177229 -1.049413e-02
## 35  Kotawaringin Timur  Kalimantan Tengah  0.577177229 -1.049413e-02
## 36            Lamandau  Kalimantan Tengah  0.495022902 -1.049413e-02
## 37         Murung Raya  Kalimantan Tengah -0.150475784 -1.049413e-02
## 38       Palangka Raya  Kalimantan Tengah  0.577177229 -1.049413e-02
## 39        Pulang Pisau  Kalimantan Tengah  0.130935384 -1.049413e-02
## 40             Seruyan  Kalimantan Tengah  0.577177229 -1.049413e-02
## 41            Sukamara  Kalimantan Tengah  0.440253351 -1.049413e-02
## 42          Balikpapan   Kalimantan Timur  0.181905465 -4.535654e-04
## 43               Berau   Kalimantan Timur  2.063452484 -8.383784e-02
## 44             Bontang   Kalimantan Timur -1.206547561 -1.049413e-02
## 45         Kutai Barat   Kalimantan Timur  0.010142715 -2.016777e-05
## 46   Kutai Kartanegara   Kalimantan Timur  0.321112810 -2.380778e-02
## 47         Kutai Timur   Kalimantan Timur  1.473915968 -7.507209e-02
## 48         Mahakam Ulu   Kalimantan Timur -0.358328095 -1.049413e-02
## 49               Paser   Kalimantan Timur -0.009242043 -1.049413e-02
## 50 Penajam Paser Utara   Kalimantan Timur  0.166864352 -2.442854e-02
## 51           Samarinda   Kalimantan Timur  0.014337360 -2.854264e-06
## 52            Bulungan   Kalimantan Utara  0.281905732 -4.211928e-03
## 53             Malinau   Kalimantan Utara  0.260749469 -2.482459e-03
## 54             Nunukan   Kalimantan Utara -0.258820582 -3.199535e-02
## 55         Tana Tidung   Kalimantan Utara -0.551397700 -1.049413e-02
## 56             Tarakan   Kalimantan Utara  0.000000000  0.000000e+00
##          Var.Ii         Z.Ii    P.Value
## 1  0.3163772344  1.206004912 0.22781560
## 2  1.6182888723 -1.124580163 0.26076698
## 3  0.0107697391 -0.688676656 0.49102677
## 4  0.0053099093 -0.193481967 0.84658153
## 5  0.2853678315  0.699480213 0.48425197
## 6  0.0879435455 -0.680854113 0.49596381
## 7  0.0001725056  1.550601130 0.12099730
## 8  0.1076859741  1.540480564 0.12344326
## 9  0.0092600687  0.097262731 0.92251775
## 10 0.2478258445  0.413739259 0.67906507
## 11 0.9609022660  0.645161847 0.51882231
## 12 0.7230388038  1.062197506 0.28814603
## 13 0.2853678315 -1.419404931 0.15578100
## 14 0.0632655098 -1.371439650 0.17023794
## 15 0.0196343925 -0.820183698 0.41211139
## 16 0.0632655098  0.117429219 0.90651993
## 17 0.5305259258  0.259295054 0.79540760
## 18 0.2853678315  1.100099631 0.27128871
## 19 0.1076859741  0.702953164 0.48208494
## 20 0.0756653963 -0.809286879 0.41835015
## 21 0.0371695504  0.155601153 0.87634742
## 22 0.0738418108  0.712122730 0.47638878
## 23 0.0009129280 -0.389996768 0.69653894
## 24 0.0879435456  1.519380654 0.12866671
## 25 0.1866556885 -0.211406473 0.83257011
## 26 0.3763913765 -0.247289062 0.80468452
## 27 0.1076859741  1.144660383 0.25234987
## 28 0.0738418108  1.224250609 0.22085770
## 29 0.1866556885  1.360234894 0.17375560
## 30 0.0738418108  0.907517626 0.36413313
## 31 0.0879435456  0.978499702 0.32782724
## 32 0.3712958458 -1.906712986 0.05655776
## 33 0.0738418108  2.162635648 0.03056921
## 34 0.1866556885  1.360234894 0.17375560
## 35 0.2853678315  1.100099631 0.27128871
## 36 0.1076859741  1.540480564 0.12344326
## 37 0.0738418108 -0.515133683 0.60645961
## 38 0.1866556885  1.360234894 0.17375560
## 39 0.1372996170  0.381685262 0.70269483
## 40 0.1076859741  1.790832454 0.07332019
## 41 0.1866556885  1.043308377 0.29680549
## 42 0.0124589968  1.633750514 0.10231125
## 43 1.3806665399  1.827453638 0.06763159
## 44 0.2853678315 -2.238968961 0.02515794
## 45 0.0001228715  0.916835200 0.35922900
## 46 0.1415977513  0.916623401 0.35934002
## 47 0.9181018121  1.616600271 0.10596459
## 48 0.0879435456 -1.172924346 0.24082615
## 49 0.0879435456  0.004222144 0.99663123
## 50 0.3151091460  0.340775469 0.73327262
## 51 0.0001598383  1.134266704 0.25668269
## 52 0.0753918170  1.042035607 0.29739517
## 53 0.0150870643  2.143069194 0.03210754
## 54 0.8511467599 -0.245860714 0.80579006
## 55 0.1866556885 -1.251985305 0.21057522
## 56 0.0000000000          NaN        NaN
# LOCAL MORAN'S I - KNN

lisa_knn <- localmoran(
  data_spasial$`Produksi Ketimun`,
  lw_knn
)

hasil_lisa_knn <- data.frame(
  Kabupaten_Kota = data_spasial$NAME_2,
  Provinsi = data_spasial$NAME_1,
  Ii = lisa_knn[,1],
  E.Ii = lisa_knn[,2],
  Var.Ii = lisa_knn[,3],
  Z.Ii = lisa_knn[,4],
  P.Value = lisa_knn[,5]
)

View(hasil_lisa_knn)

print(hasil_lisa_knn)
##         Kabupaten_Kota           Provinsi           Ii          E.Ii
## 1           Bengkayang   Kalimantan Barat -0.072977879 -3.150006e-02
## 2          Kapuas Hulu   Kalimantan Barat -2.128946671 -1.427768e-01
## 3         Kayong Utara   Kalimantan Barat  0.034524731 -3.920445e-04
## 4             Ketapang   Kalimantan Barat  0.116763338 -8.722962e-04
## 5       Kota Pontianak   Kalimantan Barat  0.320790036 -1.049413e-02
## 6            Kubu Raya   Kalimantan Barat  0.148606043 -1.049413e-02
## 7               Landak   Kalimantan Barat  0.020352765 -1.304681e-05
## 8               Melawi   Kalimantan Barat  0.041565742 -1.049413e-02
## 9            Pontianak   Kalimantan Barat  0.008658687 -7.008325e-04
## 10              Sambas   Kalimantan Barat  0.068446193 -9.100745e-03
## 11             Sanggau   Kalimantan Barat  0.018066319 -1.304859e-01
## 12             Sekadau   Kalimantan Barat  0.450678801 -4.198690e-02
## 13          Singkawang   Kalimantan Barat -0.352167500 -1.049413e-02
## 14             Sintang   Kalimantan Barat -1.185379030 -1.049413e-02
## 15            Balangan Kalimantan Selatan -0.152247136 -1.896915e-03
## 16              Banjar Kalimantan Selatan  0.235218706 -1.049413e-02
## 17         Banjar Baru Kalimantan Selatan -0.310743116 -1.969265e-02
## 18         Banjarmasin Kalimantan Selatan -0.115116945 -1.049413e-02
## 19        Barito Kuala Kalimantan Selatan  0.235218706 -1.049413e-02
## 20 Hulu Sungai Selatan Kalimantan Selatan -0.127589848 -7.350333e-03
## 21  Hulu Sungai Tengah Kalimantan Selatan -0.055188025 -2.819090e-03
## 22   Hulu Sungai Utara Kalimantan Selatan  0.093039107 -1.049413e-02
## 23           Kota Baru Kalimantan Selatan  0.011412987 -1.078063e-04
## 24            Tabalong Kalimantan Selatan  0.371535001 -1.049413e-02
## 25         Tanah Bumbu Kalimantan Selatan  0.076299324 -1.049413e-02
## 26          Tanah Laut Kalimantan Selatan -0.335874500 -2.139720e-02
## 27               Tapin Kalimantan Selatan  0.312121152 -1.049413e-02
## 28      Barito Selatan  Kalimantan Tengah  0.130935384 -1.049413e-02
## 29        Barito Timur  Kalimantan Tengah  0.371535001 -1.049413e-02
## 30        Barito Utara  Kalimantan Tengah  0.426557276 -1.049413e-02
## 31          Gunung Mas  Kalimantan Tengah  0.130935384 -1.049413e-02
## 32              Kapuas  Kalimantan Tengah -1.207790151 -4.595271e-02
## 33            Katingan  Kalimantan Tengah  0.577177229 -1.049413e-02
## 34  Kotawaringin Barat  Kalimantan Tengah  0.577177229 -1.049413e-02
## 35  Kotawaringin Timur  Kalimantan Tengah  0.577177229 -1.049413e-02
## 36            Lamandau  Kalimantan Tengah  0.474484320 -1.049413e-02
## 37         Murung Raya  Kalimantan Tengah  0.426557276 -1.049413e-02
## 38       Palangka Raya  Kalimantan Tengah  0.130935384 -1.049413e-02
## 39        Pulang Pisau  Kalimantan Tengah  0.130935384 -1.049413e-02
## 40             Seruyan  Kalimantan Tengah  0.577177229 -1.049413e-02
## 41            Sukamara  Kalimantan Tengah  0.474484320 -1.049413e-02
## 42          Balikpapan   Kalimantan Timur  0.061449214 -4.535654e-04
## 43               Berau   Kalimantan Timur  0.533533341 -8.383784e-02
## 44             Bontang   Kalimantan Timur -0.635651735 -1.049413e-02
## 45         Kutai Barat   Kalimantan Timur -0.009449173 -2.016777e-05
## 46   Kutai Kartanegara   Kalimantan Timur  0.377075675 -2.380778e-02
## 47         Kutai Timur   Kalimantan Timur  1.292572744 -7.507209e-02
## 48         Mahakam Ulu   Kalimantan Timur  0.064925109 -1.049413e-02
## 49               Paser   Kalimantan Timur -0.167204902 -1.049413e-02
## 50 Penajam Paser Utara   Kalimantan Timur  0.160843941 -2.442854e-02
## 51           Samarinda   Kalimantan Timur  0.005330135 -2.854264e-06
## 52            Bulungan   Kalimantan Utara  0.235172750 -4.211928e-03
## 53             Malinau   Kalimantan Utara  0.295187965 -2.482459e-03
## 54             Nunukan   Kalimantan Utara -0.221743462 -3.199535e-02
## 55         Tana Tidung   Kalimantan Utara -0.606919184 -1.049413e-02
## 56             Tarakan   Kalimantan Utara -0.606919184 -1.049413e-02
##          Var.Ii        Z.Ii     P.Value
## 1  0.4033809739 -0.06530677 0.947929750
## 2  1.6182888723 -1.56130720 0.118451286
## 3  0.0051816669  0.48506438 0.627630678
## 4  0.0115236328  1.09583253 0.273152068
## 5  0.1372996170  0.89405867 0.371290502
## 6  0.1372996170  0.42937425 0.667650892
## 7  0.0001725056  1.55060113 0.120997301
## 8  0.1372996170  0.14049745 0.888266966
## 9  0.0092600687  0.09726273 0.922517752
## 10 0.1192369629  0.22457386 0.822310803
## 11 1.5001841499  0.12128491 0.903465374
## 12 0.5318506586  0.67554997 0.499326418
## 13 0.1372996170 -0.92209670 0.356478140
## 14 0.1372996170 -3.17074020 0.001520511
## 15 0.0250338504 -0.95025518 0.341982607
## 16 0.1372996170  0.66312161 0.507252668
## 17 0.2552530398 -0.57608005 0.564561077
## 18 0.1372996170 -0.28235256 0.777673185
## 19 0.1372996170  0.66312161 0.507252668
## 20 0.0964733803 -0.38711809 0.698668786
## 21 0.0371695504 -0.27163147 0.785905396
## 22 0.1372996170  0.27941205 0.779928623
## 23 0.0014252856  0.30516269 0.760242250
## 24 0.1372996170  1.03100749 0.302537308
## 25 0.1372996170  0.23423529 0.814802323
## 26 0.2768648106 -0.59766170 0.550065684
## 27 0.1372996170  0.87066337 0.383937983
## 28 0.1372996170  0.38168526 0.702694833
## 29 0.1372996170  1.03100749 0.302537308
## 30 0.1372996170  1.17949977 0.238199229
## 31 0.1372996170  0.38168526 0.702694833
## 32 0.5796761675 -1.52599337 0.127011516
## 33 0.1372996170  1.58598788 0.112742059
## 34 0.1372996170  1.58598788 0.112742059
## 35 0.1372996170  1.58598788 0.112742059
## 36 0.1372996170  1.30884368 0.190587308
## 37 0.1372996170  1.17949977 0.238199229
## 38 0.1372996170  0.38168526 0.702694833
## 39 0.1372996170  0.38168526 0.702694833
## 40 0.1372996170  1.58598788 0.112742059
## 41 0.1372996170  1.30884368 0.190587308
## 42 0.0059944230  0.79953311 0.423981355
## 43 1.0155864452  0.61261540 0.540130676
## 44 0.1372996170 -1.68715450 0.091573648
## 45 0.0002666574 -0.57741633 0.563658249
## 46 0.3072972476  0.72316733 0.469577090
## 47 0.9181018121  1.42734155 0.153481471
## 48 0.1372996170  0.20353893 0.838713820
## 49 0.1372996170 -0.42292580 0.672349396
## 50 0.3151091460  0.33005051 0.741361797
## 51 0.0000377396  0.86810461 0.385337066
## 52 0.0554564807  1.01652999 0.309377072
## 53 0.0327421396  1.64506157 0.099957114
## 54 0.4095140071 -0.29651255 0.766838682
## 55 0.1372996170 -1.60961205 0.107482576
## 56 0.1372996170 -1.60961205 0.107482576
# Standarisasi variabel
z_prod <- scale(data_spasial$`Produksi Ketimun`)
# LISA - QUEEN
lag_queen <- lag.listw(
  lw_queen,
  data_spasial$`Produksi Ketimun`,
  zero.policy = TRUE
)

z_lag_queen <- scale(lag_queen)

cluster_queen <- ifelse(
  z_prod > 0 & z_lag_queen > 0, "High-High",
  ifelse(
    z_prod < 0 & z_lag_queen < 0, "Low-Low",
    ifelse(
      z_prod > 0 & z_lag_queen < 0, "High-Low",
      ifelse(
        z_prod < 0 & z_lag_queen > 0, "Low-High",
        "Not Significant"
      )
    )
  )
)

hasil_lisa_queen$Cluster <- cluster_queen

View(hasil_lisa_queen)

table(hasil_lisa_queen$Cluster)
## 
## High-High  High-Low  Low-High   Low-Low 
##        16         8        10        22
# LISA - KNN

lag_knn <- lag.listw(
  lw_knn,
  data_spasial$`Produksi Ketimun`
)

z_lag_knn <- scale(lag_knn)

cluster_knn <- ifelse(
  z_prod > 0 & z_lag_knn > 0, "High-High",
  ifelse(
    z_prod < 0 & z_lag_knn < 0, "Low-Low",
    ifelse(
      z_prod > 0 & z_lag_knn < 0, "High-Low",
      ifelse(
        z_prod < 0 & z_lag_knn > 0, "Low-High",
        "Not Significant"
      )
    )
  )
)

hasil_lisa_knn$Cluster <- cluster_knn

View(hasil_lisa_knn)

table(hasil_lisa_knn$Cluster)
## 
## High-High  High-Low  Low-High   Low-Low 
##        15         9         9        23
for (i in 1:length(nb_queen)) {
  
  cat("\n====================================\n")
  cat("Wilayah :", data_spasial$NAME_2[i], "\n")
  cat("Tetangga :", "\n")
  
  print(
    data_spasial$NAME_2[nb_queen[[i]]]
  )
}
## 
## ====================================
## Wilayah : Bengkayang 
## Tetangga : 
## [1] "Landak"     "Pontianak"  "Sambas"     "Sanggau"    "Singkawang"
## 
## ====================================
## Wilayah : Kapuas Hulu 
## Tetangga : 
## [1] "Sintang"     "Murung Raya" "Kutai Barat" "Mahakam Ulu"
## 
## ====================================
## Wilayah : Kayong Utara 
## Tetangga : 
## [1] "Ketapang"  "Kubu Raya"
## 
## ====================================
## Wilayah : Ketapang 
## Tetangga : 
## [1] "Kayong Utara" "Kubu Raya"    "Melawi"       "Sanggau"      "Sekadau"     
## [6] "Sintang"      "Lamandau"     "Sukamara"    
## 
## ====================================
## Wilayah : Kota Pontianak 
## Tetangga : 
## [1] "Kubu Raya" "Pontianak"
## 
## ====================================
## Wilayah : Kubu Raya 
## Tetangga : 
## [1] "Kayong Utara"   "Ketapang"       "Kota Pontianak" "Landak"        
## [5] "Pontianak"      "Sanggau"       
## 
## ====================================
## Wilayah : Landak 
## Tetangga : 
## [1] "Bengkayang" "Kubu Raya"  "Pontianak"  "Sanggau"   
## 
## ====================================
## Wilayah : Melawi 
## Tetangga : 
## [1] "Ketapang" "Sintang"  "Katingan" "Lamandau" "Seruyan" 
## 
## ====================================
## Wilayah : Pontianak 
## Tetangga : 
## [1] "Bengkayang"     "Kota Pontianak" "Kubu Raya"      "Landak"        
## 
## ====================================
## Wilayah : Sambas 
## Tetangga : 
## [1] "Bengkayang" "Singkawang"
## 
## ====================================
## Wilayah : Sanggau 
## Tetangga : 
## [1] "Bengkayang" "Ketapang"   "Kubu Raya"  "Landak"     "Sekadau"   
## [6] "Sintang"   
## 
## ====================================
## Wilayah : Sekadau 
## Tetangga : 
## [1] "Ketapang" "Sanggau"  "Sintang" 
## 
## ====================================
## Wilayah : Singkawang 
## Tetangga : 
## [1] "Bengkayang" "Sambas"    
## 
## ====================================
## Wilayah : Sintang 
## Tetangga : 
## [1] "Kapuas Hulu" "Ketapang"    "Melawi"      "Sanggau"     "Sekadau"    
## [6] "Gunung Mas"  "Katingan"    "Murung Raya"
## 
## ====================================
## Wilayah : Balangan 
## Tetangga : 
## [1] "Hulu Sungai Tengah" "Hulu Sungai Utara"  "Kota Baru"         
## [4] "Tabalong"           "Paser"             
## 
## ====================================
## Wilayah : Banjar 
## Tetangga : 
## [1] "Banjar Baru"         "Banjarmasin"         "Barito Kuala"       
## [4] "Hulu Sungai Selatan" "Kota Baru"           "Tanah Bumbu"        
## [7] "Tanah Laut"          "Tapin"              
## 
## ====================================
## Wilayah : Banjar Baru 
## Tetangga : 
## [1] "Banjar"     "Tanah Laut"
## 
## ====================================
## Wilayah : Banjarmasin 
## Tetangga : 
## [1] "Banjar"       "Barito Kuala"
## 
## ====================================
## Wilayah : Barito Kuala 
## Tetangga : 
## [1] "Banjar"         "Banjarmasin"    "Tapin"          "Barito Selatan"
## [5] "Kapuas"        
## 
## ====================================
## Wilayah : Hulu Sungai Selatan 
## Tetangga : 
## [1] "Banjar"             "Hulu Sungai Tengah" "Hulu Sungai Utara" 
## [4] "Kota Baru"          "Tapin"             
## 
## ====================================
## Wilayah : Hulu Sungai Tengah 
## Tetangga : 
## [1] "Balangan"            "Hulu Sungai Selatan" "Hulu Sungai Utara"  
## [4] "Kota Baru"          
## 
## ====================================
## Wilayah : Hulu Sungai Utara 
## Tetangga : 
## [1] "Balangan"            "Hulu Sungai Selatan" "Hulu Sungai Tengah" 
## [4] "Tabalong"            "Tapin"               "Barito Selatan"     
## [7] "Barito Timur"       
## 
## ====================================
## Wilayah : Kota Baru 
## Tetangga : 
## [1] "Balangan"            "Banjar"              "Hulu Sungai Selatan"
## [4] "Hulu Sungai Tengah"  "Tanah Bumbu"         "Paser"              
## 
## ====================================
## Wilayah : Tabalong 
## Tetangga : 
## [1] "Balangan"          "Hulu Sungai Utara" "Barito Selatan"   
## [4] "Barito Timur"      "Barito Utara"      "Paser"            
## 
## ====================================
## Wilayah : Tanah Bumbu 
## Tetangga : 
## [1] "Banjar"     "Kota Baru"  "Tanah Laut"
## 
## ====================================
## Wilayah : Tanah Laut 
## Tetangga : 
## [1] "Banjar"      "Banjar Baru" "Tanah Bumbu"
## 
## ====================================
## Wilayah : Tapin 
## Tetangga : 
## [1] "Banjar"              "Barito Kuala"        "Hulu Sungai Selatan"
## [4] "Hulu Sungai Utara"   "Barito Selatan"     
## 
## ====================================
## Wilayah : Barito Selatan 
## Tetangga : 
## [1] "Barito Kuala"      "Hulu Sungai Utara" "Tabalong"         
## [4] "Tapin"             "Barito Timur"      "Barito Utara"     
## [7] "Kapuas"           
## 
## ====================================
## Wilayah : Barito Timur 
## Tetangga : 
## [1] "Hulu Sungai Utara" "Tabalong"          "Barito Selatan"   
## 
## ====================================
## Wilayah : Barito Utara 
## Tetangga : 
## [1] "Tabalong"       "Barito Selatan" "Kapuas"         "Murung Raya"   
## [5] "Kutai Barat"    "Mahakam Ulu"    "Paser"         
## 
## ====================================
## Wilayah : Gunung Mas 
## Tetangga : 
## [1] "Sintang"       "Kapuas"        "Katingan"      "Murung Raya"  
## [5] "Palangka Raya" "Pulang Pisau" 
## 
## ====================================
## Wilayah : Kapuas 
## Tetangga : 
## [1] "Barito Kuala"   "Barito Selatan" "Barito Utara"   "Gunung Mas"    
## [5] "Murung Raya"    "Pulang Pisau"  
## 
## ====================================
## Wilayah : Katingan 
## Tetangga : 
## [1] "Melawi"             "Sintang"            "Gunung Mas"        
## [4] "Kotawaringin Timur" "Palangka Raya"      "Pulang Pisau"      
## [7] "Seruyan"           
## 
## ====================================
## Wilayah : Kotawaringin Barat 
## Tetangga : 
## [1] "Lamandau" "Seruyan"  "Sukamara"
## 
## ====================================
## Wilayah : Kotawaringin Timur 
## Tetangga : 
## [1] "Katingan" "Seruyan" 
## 
## ====================================
## Wilayah : Lamandau 
## Tetangga : 
## [1] "Ketapang"           "Melawi"             "Kotawaringin Barat"
## [4] "Seruyan"            "Sukamara"          
## 
## ====================================
## Wilayah : Murung Raya 
## Tetangga : 
## [1] "Kapuas Hulu"  "Sintang"      "Barito Utara" "Gunung Mas"   "Kapuas"      
## [6] "Kutai Barat"  "Mahakam Ulu" 
## 
## ====================================
## Wilayah : Palangka Raya 
## Tetangga : 
## [1] "Gunung Mas"   "Katingan"     "Pulang Pisau"
## 
## ====================================
## Wilayah : Pulang Pisau 
## Tetangga : 
## [1] "Gunung Mas"    "Kapuas"        "Katingan"      "Palangka Raya"
## 
## ====================================
## Wilayah : Seruyan 
## Tetangga : 
## [1] "Melawi"             "Katingan"           "Kotawaringin Barat"
## [4] "Kotawaringin Timur" "Lamandau"          
## 
## ====================================
## Wilayah : Sukamara 
## Tetangga : 
## [1] "Ketapang"           "Kotawaringin Barat" "Lamandau"          
## 
## ====================================
## Wilayah : Balikpapan 
## Tetangga : 
## [1] "Kutai Kartanegara"   "Penajam Paser Utara"
## 
## ====================================
## Wilayah : Berau 
## Tetangga : 
## [1] "Kutai Timur" "Bulungan"    "Malinau"    
## 
## ====================================
## Wilayah : Bontang 
## Tetangga : 
## [1] "Kutai Kartanegara" "Kutai Timur"      
## 
## ====================================
## Wilayah : Kutai Barat 
## Tetangga : 
## [1] "Kapuas Hulu"         "Barito Utara"        "Murung Raya"        
## [4] "Kutai Kartanegara"   "Mahakam Ulu"         "Paser"              
## [7] "Penajam Paser Utara" "Malinau"            
## 
## ====================================
## Wilayah : Kutai Kartanegara 
## Tetangga : 
## [1] "Balikpapan"          "Bontang"             "Kutai Barat"        
## [4] "Kutai Timur"         "Mahakam Ulu"         "Penajam Paser Utara"
## [7] "Samarinda"           "Malinau"            
## 
## ====================================
## Wilayah : Kutai Timur 
## Tetangga : 
## [1] "Berau"             "Bontang"           "Kutai Kartanegara"
## [4] "Malinau"          
## 
## ====================================
## Wilayah : Mahakam Ulu 
## Tetangga : 
## [1] "Kapuas Hulu"       "Barito Utara"      "Murung Raya"      
## [4] "Kutai Barat"       "Kutai Kartanegara" "Malinau"          
## 
## ====================================
## Wilayah : Paser 
## Tetangga : 
## [1] "Balangan"            "Kota Baru"           "Tabalong"           
## [4] "Barito Utara"        "Kutai Barat"         "Penajam Paser Utara"
## 
## ====================================
## Wilayah : Penajam Paser Utara 
## Tetangga : 
## [1] "Balikpapan"        "Kutai Barat"       "Kutai Kartanegara"
## [4] "Paser"            
## 
## ====================================
## Wilayah : Samarinda 
## Tetangga : 
## [1] "Kutai Kartanegara"
## 
## ====================================
## Wilayah : Bulungan 
## Tetangga : 
## [1] "Berau"       "Malinau"     "Tana Tidung"
## 
## ====================================
## Wilayah : Malinau 
## Tetangga : 
## [1] "Berau"             "Kutai Barat"       "Kutai Kartanegara"
## [4] "Kutai Timur"       "Mahakam Ulu"       "Bulungan"         
## [7] "Nunukan"           "Tana Tidung"      
## 
## ====================================
## Wilayah : Nunukan 
## Tetangga : 
## [1] "Malinau"     "Tana Tidung"
## 
## ====================================
## Wilayah : Tana Tidung 
## Tetangga : 
## [1] "Bulungan" "Malinau"  "Nunukan" 
## 
## ====================================
## Wilayah : Tarakan 
## Tetangga : 
## character(0)