Data yang digunakan dalam penelitian ini merupakan data sekunder yang bersumber dari BPS Jawa Barat, Dinas Kesehatan Provinsi Jawa Barat dan Open Data Jawa Barat pada tahun 2023, dengan rincian sebagai berikut:
library(maptools)
library(spdep)
library(sp)
library(RColorBrewer)
library(lattice)
library(gstat)
library(raster)
library(ggplot2)
library(dplyr)
library(tidyr)
library(tmap)
library(sarima)
library(extrafont)
library(lmtest)
library(spgwr)
library(spatialreg)
require(splancs)
library(readxl)
library(car)
setwd("C:/Users/Nabila Aprilia F/OneDrive/Documents/spaspaper")
jabar <- readShapePoly("Jabar.shp")
## Warning: shapelib support is provided by GDAL through the sf and terra packages
## among others
plot(jabar)
KAB <- factor(c("Kab Bogor", "Kab Sukabumi", "Kab Cianjur", "Kab Bandung", "Kab Garut", "Kab Tasikmalaya", "Kab Ciamis", "Kab Kuningan", "Kab Cirebon", "Kab Majalengka", "Kab Sumedang", "Kan Indramayu", "Kab Subang", "Kab Purwakarta", "Kab Karawang", "Kab Bekasi", "Kab Bandung Barat", "Kab Pangandaran", "Kota Bogor", "Kota Sukabumi", "Kota Bandung", "Kota Cirebon", "Kab Bekasi", "Kota Depok", "Kota Cimahi", "Kota Tasikmalaya", "Kota Banjar"))
jabar$KAB <- KAB
ID <- c(1:27)
CoordK = coordinates(jabar)
W1 <- poly2nb(jabar, row.names = ID, queen = FALSE) ;W1
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 106
## Percentage nonzero weights: 14.54047
## Average number of links: 3.925926
WB1 <- nb2mat(W1, style = "B", zero.policy = TRUE)
WB1[c(1:5),c(1:5)]
## [,1] [,2] [,3] [,4] [,5]
## 1 0 1 1 0 0
## 2 1 0 1 0 0
## 3 1 1 0 1 1
## 4 0 0 1 0 1
## 5 0 0 1 1 0
WL1 <- nb2listw(W1) ;WL1
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 106
## Percentage nonzero weights: 14.54047
## Average number of links: 3.925926
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 27 729 27 16.73552 121.5371
plot(jabar, axes=T, col="lightgreen")
plot(W1, coordinates(jabar), add=T, col='red')
text(CoordK[,1], CoordK[,2], jabar$KAB, col="black",cex=0.35, pos=1.5)
points(CoordK[,1], CoordK[,2], pch=19, cex=0.7, col="blue")
W2 <- poly2nb(jabar, row.names = ID, queen = TRUE) ;W2
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 106
## Percentage nonzero weights: 14.54047
## Average number of links: 3.925926
WB2 <- nb2mat(W2, style = "B", zero.policy = TRUE)
WB2[c(1:5),c(1:5)]
## [,1] [,2] [,3] [,4] [,5]
## 1 0 1 1 0 0
## 2 1 0 1 0 0
## 3 1 1 0 1 1
## 4 0 0 1 0 1
## 5 0 0 1 1 0
WL2 <- nb2listw(W2) ;WL2
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 106
## Percentage nonzero weights: 14.54047
## Average number of links: 3.925926
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 27 729 27 16.73552 121.5371
plot(jabar, axes=T, col="lightgreen")
plot(W2, coordinates(jabar), add=T, col='red')
text(CoordK[,1], CoordK[,2], jabar$KAB, col="black", cex=0.35, pos=1.5)
points(CoordK[,1], CoordK[,2], pch=19, cex=0.7, col="blue")
W3 <- knn2nb(knearneigh(CoordK, k = 3), row.names = ID) ;W3
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 81
## Percentage nonzero weights: 11.11111
## Average number of links: 3
## Non-symmetric neighbours list
WB3 <- nb2mat(W3, style='B', zero.policy = TRUE)
WB3[1:5,1:5]
## [,1] [,2] [,3] [,4] [,5]
## 1 0 0 0 0 0
## 2 0 0 1 0 0
## 3 0 0 0 1 0
## 4 0 0 0 0 0
## 5 0 0 0 1 0
WL3 <- nb2listw(W3) ;WL3
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 81
## Percentage nonzero weights: 11.11111
## Average number of links: 3
## Non-symmetric neighbours list
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 27 729 27 15.88889 112.8889
plot(jabar, axes=T, col="lightgreen")
plot(W3, coordinates(jabar), add=T, col='red')
text(CoordK[,1], CoordK[,2], jabar$KAB, col="black",cex=0.35, pos=1.5)
points(CoordK[,1], CoordK[,2], pch=19, cex=0.7, col="blue")
W4 <- knn2nb(knearneigh(CoordK, k = 6), row.names = ID) ;W4
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 162
## Percentage nonzero weights: 22.22222
## Average number of links: 6
## Non-symmetric neighbours list
WB4 <- nb2mat(W4, style='B', zero.policy = TRUE)
WB4[1:5,1:5]
## [,1] [,2] [,3] [,4] [,5]
## 1 0 1 0 0 0
## 2 1 0 1 0 0
## 3 0 1 0 1 0
## 4 0 0 1 0 1
## 5 0 0 0 1 0
WL4 <- nb2listw(W4) ;WL4
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 27
## Number of nonzero links: 162
## Percentage nonzero weights: 22.22222
## Average number of links: 6
## Non-symmetric neighbours list
##
## Weights style: W
## Weights constants summary:
## n nn S0 S1 S2
## W 27 729 27 8.5 109.7222
plot(jabar, axes=T, col="lightgreen")
plot(W4, coordinates(jabar), add=T, col='red')
text(CoordK[,1], CoordK[,2], jabar$KAB, col="black",cex=0.35, pos=1.5)
points(CoordK[,1], CoordK[,2], pch=19, cex=0.7, col="blue")
setwd("C:/Users/Nabila Aprilia F/OneDrive/Documents/spaspaper")
dbd = read_excel("datasp3.xlsx")
head(dbd)
## # A tibble: 6 × 9
## Distrik y x1 x2 x3 x4 x5 x6 x7
## <chr> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl> <dbl>
## 1 Bogor 31 50.4 7.27 90.1 63.1 1881 44.6 45.9
## 2 Sukabumi 4 61.5 7.01 100 59.3 673 30.5 34.5
## 3 Cianjur 35 75.2 10.2 91.1 85.2 704 31.5 42.2
## 4 Bandung 20 63.1 6.4 92.9 37.9 2138 49.5 38.2
## 5 Garut 27 60.9 9.77 100 39.0 865 36.7 38.1
## 6 Tasikmalaya 5 44.5 10.3 86.6 90.2 705 37.0 38.0
jabar$y <- dbd$y
jabar$x1 <- dbd$x1
jabar$x2 <- dbd$x2
jabar$x3 <- dbd$x3
jabar$x4 <- dbd$x4
jabar$x5 <- dbd$x5
jabar$x6 <- dbd$x6
jabar$x7 <- dbd$x7
summary(dbd)
## Distrik y x1 x2
## Length:27 Min. : 4.00 Min. :41.00 Min. : 2.380
## Class :character 1st Qu.: 23.50 1st Qu.:57.45 1st Qu.: 6.535
## Mode :character Median : 39.00 Median :63.07 Median : 8.460
## Mean : 47.19 Mean :63.89 Mean : 8.177
## 3rd Qu.: 59.50 3rd Qu.:72.38 3rd Qu.:10.250
## Max. :132.00 Max. :83.24 Max. :12.130
## x3 x4 x5 x6
## Min. : 68.07 Min. :37.88 Min. : 382.0 Min. :30.51
## 1st Qu.: 91.03 1st Qu.:68.87 1st Qu.: 824.5 1st Qu.:42.87
## Median : 95.45 Median :77.23 Median : 1449.0 Median :54.98
## Mean : 93.88 Mean :74.64 Mean : 3873.3 Mean :56.19
## 3rd Qu.:100.00 3rd Qu.:85.43 3rd Qu.: 5749.0 3rd Qu.:71.08
## Max. :100.00 Max. :95.92 Max. :15047.0 Max. :86.35
## x7
## Min. :25.94
## 1st Qu.:34.14
## Median :38.06
## Mean :38.69
## 3rd Qu.:44.79
## Max. :50.57
boxplot(dbd$y,main="Sebaran Peubah Y")
boxplot(dbd$x1,main="Sebaran Peubah X1")
boxplot(dbd$x2,main="Sebaran Peubah X2")
boxplot(dbd$x3,main="Sebaran Peubah X3")
boxplot(dbd$x4,main="Sebaran Peubah X4")
boxplot(dbd$x5,main="Sebaran Peubah X5")
boxplot(dbd$x6,main="Sebaran Peubah X6")
boxplot(dbd$x7,main="Sebaran Peubah X7")
plot(dbd$x1, dbd$y, xlab="X1", ylab="Y",
main="Scatter Plot of X1 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x1, data = dbd)
abline(regresi_clas, col=2, add=T)
plot(dbd$x2, dbd$y, xlab="X2", ylab="Y",
main="Scatter Plot of X2 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x2, data = dbd)
abline(regresi_clas, col=2, add=T)
plot(dbd$x3, dbd$y, xlab="X3", ylab="Y",
main="Scatter Plot of X3 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x3, data = dbd)
abline(regresi_clas, col=2, add=T)
plot(dbd$x4, dbd$y, xlab="X4", ylab="Y",
main="Scatter Plot of X4 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x4, data = dbd)
abline(regresi_clas, col=2, add=T)
plot(dbd$x5, dbd$y, xlab="X5", ylab="Y",
main="Scatter Plot of X5 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x5, data = dbd)
abline(regresi_clas, col=2, add=T)
plot(dbd$x6, dbd$y, xlab="X6", ylab="Y",
main="Scatter Plot of X6 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x6, data = dbd)
abline(regresi_clas, col=2, add=T)
plot(dbd$x7, dbd$y, xlab="X7", ylab="Y",
main="Scatter Plot of X7 and Y", pch=20, col="purple", cex=2)
regresi_clas = lm(y ~ x7, data = dbd)
abline(regresi_clas, col=2, add=T)
tmap_options(check.and.fix = TRUE)
par(mfrow=c(2,2))
names(jabar)
## [1] "KABKOTNO" "PROVNO" "PROVINSI" "KABKOT" "PROV12_2"
## [6] "KABKOT12_2" "Kota" "Fasilitato" "Pencacah" "Pengawas"
## [11] "Kabupaten" "Kasus" "Penduduk" "E" "SMR"
## [16] "x" "y" "KAB" "x1" "x2"
## [21] "x3" "x4" "x5" "x6" "x7"
tm_shape(jabar) + tm_polygons("x1",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
tm_shape(jabar) + tm_polygons("x2",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
tm_shape(jabar) + tm_polygons("x3",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
tm_shape(jabar) + tm_polygons("x4",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
tm_shape(jabar) + tm_polygons("x5",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
tm_shape(jabar) + tm_polygons("x6",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
tm_shape(jabar) + tm_polygons("x7",style="cont")+ tm_borders(lwd=1,col="black") + tm_text("KAB",size=0.6)
k = 16
colfunc <- colorRampPalette(c("green", "yellow","red"))
color <- colfunc(k)
jabar$y <- dbd$y
spplot(jabar, "y", col.regions=color, main="Sebaran Spasial Peubah Y")
jabar$x1 <- dbd$x1
spplot(jabar, "x1", col.regions=color, main="Sebaran Spasial Peubah X1")
jabar$x2 <- dbd$x2
spplot(jabar, "x2", col.regions=color, main="Sebaran Spasial Peubah X2")
jabar$x3 <- dbd$x3
spplot(jabar, "x3", col.regions=color, main="Sebaran Spasial Peubah X3")
jabar$x4 <- dbd$x4
spplot(jabar, "x4", col.regions=color, main="Sebaran Spasial Peubah X4")
jabar$x5 <- dbd$x5
spplot(jabar, "x5", col.regions=color, main="Sebaran Spasial Peubah X5")
jabar$x6 <- dbd$x6
spplot(jabar, "x6", col.regions=color, main="Sebaran Spasial Peubah X6")
jabar$x7 <- dbd$x7
spplot(jabar, "x7", col.regions=color, main="Sebaran Spasial Peubah X7")
moran_test_WL1 <- moran.test(dbd$y, WL1)
moran_test_WL2 <- moran.test(dbd$y, WL2)
moran_test_WL3 <- moran.test(dbd$y, WL3)
moran_test_WL4 <- moran.test(dbd$y, WL4)
moran_statistics <- data.frame(
Spatial_Weight_Matrix = c("Rook", "Queen", "KNN, k=3", "KNN, k=6"),
Moran_I_Statistic = c(moran_test_WL1$estimate[1],
moran_test_WL2$estimate[1],
moran_test_WL3$estimate[1],
moran_test_WL4$estimate[1]),
Expectation = c(moran_test_WL1$estimate[2],
moran_test_WL2$estimate[2],
moran_test_WL3$estimate[2],
moran_test_WL4$estimate[2]),
Variance = c(moran_test_WL1$estimate[3],
moran_test_WL2$estimate[3],
moran_test_WL3$estimate[3],
moran_test_WL4$estimate[3]),
p_value = c(moran_test_WL1$p.value,
moran_test_WL2$p.value,
moran_test_WL3$p.value,
moran_test_WL4$p.value)) ;moran_statistics
## Spatial_Weight_Matrix Moran_I_Statistic Expectation Variance p_value
## 1 Rook -0.22388815 -0.03846154 0.018796361 0.9118912
## 2 Queen -0.22388815 -0.03846154 0.018796361 0.9118912
## 3 KNN, k=3 -0.15260977 -0.03846154 0.018082053 0.8020254
## 4 KNN, k=6 -0.07959707 -0.03846154 0.008434848 0.6728864
Tidak ada bukti autokorelasi spasial yang signifikan pada kasus demam berdarah di data ini, berdasarkan semua matriks pembobotan yang diuji. Kasus DBD cenderung terdistribusi secara acak, tanpa pengelompokan yang jelas di antara wilayah berdekatan.
moran.test(dbd$y, WL1)
##
## Moran I test under randomisation
##
## data: dbd$y
## weights: WL1
##
## Moran I statistic standard deviate = -1.3525, p-value = 0.9119
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.22388815 -0.03846154 0.01879636
moran.plot(dbd$y, WL1)
locm1 <- localmoran(dbd$y, WL1) ;locm1
## Ii E.Ii Var.Ii Z.Ii Pr(z != E(Ii))
## 1 0.039631957 -0.0091878861 0.0221214293 0.32823870 0.74273119
## 2 -0.635932641 -0.0654108556 0.5061752419 -0.80190290 0.42260913
## 3 0.144659615 -0.0052076828 0.0186500263 1.09740555 0.27246415
## 4 -0.324769127 -0.0259205880 0.0740147932 -1.09847929 0.27199526
## 5 0.086240865 -0.0142904444 0.0836721918 0.34754478 0.72818208
## 6 -0.024933764 -0.0624166100 0.2106747965 0.08166318 0.93491456
## 7 0.266067939 -0.0278626258 0.0975106797 0.94127963 0.34656158
## 8 -0.213480307 -0.0033786599 0.0278807849 -1.25827903 0.20829086
## 9 0.099412948 -0.0070574901 0.0416256306 0.52185353 0.60177231
## 10 0.208972027 -0.0298748108 0.1043363035 0.73943801 0.45964107
## 11 -1.547665927 -0.1383899094 0.4292573126 -2.15098415 0.03147745
## 12 -0.090315705 -0.0434210119 0.2467216279 -0.09441045 0.92478311
## 13 -0.029718495 -0.0023498345 0.0084395260 -0.29791647 0.76576692
## 14 0.004354418 -0.0001674776 0.0007595512 0.16407484 0.86967223
## 15 0.065891686 -0.0009429937 0.0055961006 0.89342709 0.37162850
## 16 0.262200751 -0.0298748108 0.2399734980 0.59622966 0.55102181
## 17 -0.052037858 -0.0333042288 0.1159022058 -0.05502703 0.95611693
## 18 -0.475345814 -0.0076979079 0.0989969057 -1.48630584 0.13719824
## 19 -1.251823201 -0.2523037433 5.0934572390 -0.44287883 0.65785338
## 20 -3.025055728 -0.2069522886 4.4313220481 -1.33872161 0.18066132
## 21 0.107197987 -0.0333042288 0.2665750734 0.27212811 0.78552352
## 22 -0.308060364 -0.0198918271 0.5263958418 -0.39718271 0.69123273
## 23 0.128273319 -0.0023498345 0.0194109098 0.93755600 0.34847263
## 24 0.068728750 -0.0013417935 0.0173663100 0.53171843 0.59492103
## 25 0.081822026 -0.0021419910 0.0176976957 0.63115328 0.52794031
## 26 -0.122401547 -0.0005104194 0.0066116591 -1.49905259 0.13385999
## 27 0.493106235 -0.0129095840 0.3440590201 0.86267581 0.38831574
## attr(,"call")
## localmoran(x = dbd$y, listw = WL1)
## attr(,"class")
## [1] "localmoran" "matrix" "array"
## attr(,"quadr")
## mean median pysal
## 1 Low-High Low-High Low-Low
## 2 Low-High Low-High Low-High
## 3 Low-Low Low-Low Low-Low
## 4 Low-High Low-High Low-High
## 5 Low-High Low-High Low-Low
## 6 Low-High Low-High Low-High
## 7 Low-Low Low-Low Low-Low
## 8 High-Low High-Low High-Low
## 9 Low-High Low-High Low-Low
## 10 Low-High Low-High Low-Low
## 11 High-Low High-Low High-Low
## 12 Low-High Low-High Low-High
## 13 Low-High Low-High Low-High
## 14 Low-High High-High Low-Low
## 15 Low-Low High-Low Low-Low
## 16 Low-High Low-Low Low-Low
## 17 High-High High-High High-Low
## 18 High-Low High-Low High-Low
## 19 High-Low High-Low High-Low
## 20 High-Low High-Low High-Low
## 21 High-High High-High High-High
## 22 High-Low High-Low High-Low
## 23 Low-Low Low-Low Low-Low
## 24 Low-Low High-Low Low-Low
## 25 High-High High-High High-High
## 26 High-Low High-Low High-Low
## 27 Low-Low Low-Low Low-Low
moran.test(dbd$y, WL2)
##
## Moran I test under randomisation
##
## data: dbd$y
## weights: WL2
##
## Moran I statistic standard deviate = -1.3525, p-value = 0.9119
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.22388815 -0.03846154 0.01879636
moran.plot(dbd$y, WL2)
locm2 <- localmoran(dbd$y, WL2) ;locm2
## Ii E.Ii Var.Ii Z.Ii Pr(z != E(Ii))
## 1 0.039631957 -0.0091878861 0.0221214293 0.32823870 0.74273119
## 2 -0.635932641 -0.0654108556 0.5061752419 -0.80190290 0.42260913
## 3 0.144659615 -0.0052076828 0.0186500263 1.09740555 0.27246415
## 4 -0.324769127 -0.0259205880 0.0740147932 -1.09847929 0.27199526
## 5 0.086240865 -0.0142904444 0.0836721918 0.34754478 0.72818208
## 6 -0.024933764 -0.0624166100 0.2106747965 0.08166318 0.93491456
## 7 0.266067939 -0.0278626258 0.0975106797 0.94127963 0.34656158
## 8 -0.213480307 -0.0033786599 0.0278807849 -1.25827903 0.20829086
## 9 0.099412948 -0.0070574901 0.0416256306 0.52185353 0.60177231
## 10 0.208972027 -0.0298748108 0.1043363035 0.73943801 0.45964107
## 11 -1.547665927 -0.1383899094 0.4292573126 -2.15098415 0.03147745
## 12 -0.090315705 -0.0434210119 0.2467216279 -0.09441045 0.92478311
## 13 -0.029718495 -0.0023498345 0.0084395260 -0.29791647 0.76576692
## 14 0.004354418 -0.0001674776 0.0007595512 0.16407484 0.86967223
## 15 0.065891686 -0.0009429937 0.0055961006 0.89342709 0.37162850
## 16 0.262200751 -0.0298748108 0.2399734980 0.59622966 0.55102181
## 17 -0.052037858 -0.0333042288 0.1159022058 -0.05502703 0.95611693
## 18 -0.475345814 -0.0076979079 0.0989969057 -1.48630584 0.13719824
## 19 -1.251823201 -0.2523037433 5.0934572390 -0.44287883 0.65785338
## 20 -3.025055728 -0.2069522886 4.4313220481 -1.33872161 0.18066132
## 21 0.107197987 -0.0333042288 0.2665750734 0.27212811 0.78552352
## 22 -0.308060364 -0.0198918271 0.5263958418 -0.39718271 0.69123273
## 23 0.128273319 -0.0023498345 0.0194109098 0.93755600 0.34847263
## 24 0.068728750 -0.0013417935 0.0173663100 0.53171843 0.59492103
## 25 0.081822026 -0.0021419910 0.0176976957 0.63115328 0.52794031
## 26 -0.122401547 -0.0005104194 0.0066116591 -1.49905259 0.13385999
## 27 0.493106235 -0.0129095840 0.3440590201 0.86267581 0.38831574
## attr(,"call")
## localmoran(x = dbd$y, listw = WL2)
## attr(,"class")
## [1] "localmoran" "matrix" "array"
## attr(,"quadr")
## mean median pysal
## 1 Low-High Low-High Low-Low
## 2 Low-High Low-High Low-High
## 3 Low-Low Low-Low Low-Low
## 4 Low-High Low-High Low-High
## 5 Low-High Low-High Low-Low
## 6 Low-High Low-High Low-High
## 7 Low-Low Low-Low Low-Low
## 8 High-Low High-Low High-Low
## 9 Low-High Low-High Low-Low
## 10 Low-High Low-High Low-Low
## 11 High-Low High-Low High-Low
## 12 Low-High Low-High Low-High
## 13 Low-High Low-High Low-High
## 14 Low-High High-High Low-Low
## 15 Low-Low High-Low Low-Low
## 16 Low-High Low-Low Low-Low
## 17 High-High High-High High-Low
## 18 High-Low High-Low High-Low
## 19 High-Low High-Low High-Low
## 20 High-Low High-Low High-Low
## 21 High-High High-High High-High
## 22 High-Low High-Low High-Low
## 23 Low-Low Low-Low Low-Low
## 24 Low-Low High-Low Low-Low
## 25 High-High High-High High-High
## 26 High-Low High-Low High-Low
## 27 Low-Low Low-Low Low-Low
moran.test(dbd$y, WL3)
##
## Moran I test under randomisation
##
## data: dbd$y
## weights: WL3
##
## Moran I statistic standard deviate = -0.84888, p-value = 0.802
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.15260977 -0.03846154 0.01808205
moran.plot(dbd$y, WL3)
locm3 <- localmoran(dbd$y, WL3) ;locm3
## Ii E.Ii Var.Ii Z.Ii Pr(z != E(Ii))
## 1 -0.34657463 -0.0091878861 0.075376722 -1.22887977 0.219116887
## 2 -1.96176468 -0.0654108556 0.506175242 -2.66544008 0.007688763
## 3 -0.29796177 -0.0052076828 0.042895060 -1.41351142 0.157505407
## 4 -0.57385498 -0.0259205880 0.209059328 -1.19837788 0.230769939
## 5 0.40223012 -0.0142904444 0.116633964 1.21961830 0.222609606
## 6 0.57133940 -0.0624166100 0.484552032 0.91044115 0.362589902
## 7 0.04759713 -0.0278626258 0.224274563 0.15934020 0.873400847
## 8 -0.05535902 -0.0033786599 0.027880785 -0.31130552 0.755568374
## 9 -0.01916394 -0.0070574901 0.058023606 -0.05025908 0.959915934
## 10 -0.64268756 -0.0298748108 0.239973498 -1.25096785 0.210946208
## 11 -0.64070611 -0.1383899094 0.987291819 -0.50553871 0.613180514
## 12 -0.27213548 -0.0434210119 0.343914996 -0.39000312 0.696534242
## 13 -0.06330731 -0.0023498345 0.019410910 -0.43752613 0.661729828
## 14 -0.02022221 -0.0001674776 0.001386482 -0.53859179 0.590168551
## 15 0.06234536 -0.0009429937 0.007800625 0.71657074 0.473639005
## 16 0.17348621 -0.0298748108 0.239973498 0.41513187 0.678045371
## 17 0.10719799 -0.0333042288 0.266575073 0.27212811 0.785523517
## 18 -0.40329340 -0.0076979079 0.063248023 -1.57299685 0.115719549
## 19 -0.78776060 -0.2523037433 1.561993553 -0.42843492 0.668334505
## 20 0.68751267 -0.2069522886 1.358938761 0.76729680 0.442905072
## 21 0.10719799 -0.0333042288 0.266575073 0.27212811 0.785523517
## 22 -0.24290922 -0.0198918271 0.161428058 -0.55507187 0.578845505
## 23 0.12827332 -0.0023498345 0.019410910 0.93755600 0.348472632
## 24 -0.11364268 -0.0013417935 0.011095142 -1.06614610 0.286357602
## 25 0.08182203 -0.0021419910 0.017697696 0.63115328 0.527940307
## 26 -0.10384805 -0.0005104194 0.004224116 -1.58997613 0.111840186
## 27 0.05572554 -0.0129095840 0.105511433 0.21129862 0.832654258
## attr(,"call")
## localmoran(x = dbd$y, listw = WL3)
## attr(,"class")
## [1] "localmoran" "matrix" "array"
## attr(,"quadr")
## mean median pysal
## 1 Low-High Low-High Low-High
## 2 Low-High Low-High Low-High
## 3 Low-High Low-High Low-High
## 4 Low-High Low-High Low-High
## 5 Low-Low Low-Low Low-Low
## 6 Low-Low Low-Low Low-Low
## 7 Low-Low Low-Low Low-Low
## 8 High-Low High-Low High-Low
## 9 Low-Low Low-Low Low-High
## 10 Low-High Low-High Low-High
## 11 High-Low High-Low High-Low
## 12 Low-High Low-High Low-High
## 13 Low-High Low-High Low-High
## 14 Low-High High-High Low-High
## 15 Low-Low High-Low Low-Low
## 16 Low-Low Low-Low Low-Low
## 17 High-High High-High High-High
## 18 High-Low High-Low High-Low
## 19 High-Low High-Low High-Low
## 20 High-High High-High High-High
## 21 High-High High-High High-High
## 22 High-Low High-Low High-Low
## 23 Low-Low Low-Low Low-Low
## 24 Low-High High-High Low-High
## 25 High-High High-High High-High
## 26 High-Low High-Low High-Low
## 27 Low-Low Low-Low Low-Low
moran.test(dbd$y, WL4)
##
## Moran I test under randomisation
##
## data: dbd$y
## weights: WL4
##
## Moran I statistic standard deviate = -0.4479, p-value = 0.6729
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.079597074 -0.038461538 0.008434848
moran.plot(dbd$y, WL4)
locm4 <- localmoran(dbd$y, WL4) ;locm4
## Ii E.Ii Var.Ii Z.Ii Pr(z != E(Ii))
## 1 -0.184220270 -0.0091878861 0.0327724879 -0.966860243 0.33361390
## 2 -1.036307664 -0.0654108556 0.2200761921 -2.069600601 0.03848976
## 3 -0.140544121 -0.0052076828 0.0186500263 -0.991003111 0.32168406
## 4 -0.412716501 -0.0259205880 0.0908953600 -1.282953807 0.19950826
## 5 -0.110101974 -0.0142904444 0.0507104193 -0.425470226 0.67049392
## 6 0.250762430 -0.0624166100 0.2106747965 0.682317321 0.49503832
## 7 0.266067939 -0.0278626258 0.0975106797 0.941279625 0.34656158
## 8 -0.094143489 -0.0033786599 0.0121220804 -0.824382978 0.40972198
## 9 -0.008384225 -0.0070574901 0.0252276549 -0.008353059 0.99333530
## 10 -0.083785954 -0.0298748108 0.1043363035 -0.166901723 0.86744738
## 11 -0.583424441 -0.1383899094 0.4292573126 -0.679258153 0.49697431
## 12 -0.240049636 -0.0434210119 0.1495282593 -0.508493144 0.61110755
## 13 -0.073259546 -0.0023498345 0.0084395260 -0.771874497 0.44018876
## 14 -0.008930247 -0.0001674776 0.0006028184 -0.356901287 0.72116571
## 15 0.018213250 -0.0009429937 0.0033915761 0.328934610 0.74220511
## 16 -0.207986310 -0.0298748108 0.1043363035 -0.551409490 0.58135300
## 17 0.346051753 -0.0333042288 0.1159022058 1.114297319 0.26515166
## 18 -0.216407436 -0.0076979079 0.0274991405 -1.258585480 0.20818009
## 19 -0.336588618 -0.2523037433 0.6791276319 -0.102276050 0.91853757
## 20 0.442343055 -0.2069522886 0.5908429397 0.844707330 0.39827427
## 21 0.299217681 -0.0333042288 0.1159022058 0.976729748 0.32870296
## 22 -0.123465446 -0.0198918271 0.0701861122 -0.390952107 0.69583264
## 23 -0.032206555 -0.0023498345 0.0084395260 -0.324999788 0.74518123
## 24 -0.096721615 -0.0013417935 0.0048239750 -1.373263831 0.16967034
## 25 0.103201329 -0.0021419910 0.0076946503 1.200915796 0.22978387
## 26 -0.049347150 -0.0005104194 0.0018365720 -1.139574198 0.25446374
## 27 0.163612778 -0.0129095840 0.0458745360 0.824164471 0.40984611
## attr(,"call")
## localmoran(x = dbd$y, listw = WL4)
## attr(,"class")
## [1] "localmoran" "matrix" "array"
## attr(,"quadr")
## mean median pysal
## 1 Low-High Low-High Low-High
## 2 Low-High Low-High Low-High
## 3 Low-High Low-High Low-High
## 4 Low-High Low-High Low-High
## 5 Low-High Low-High Low-High
## 6 Low-Low Low-Low Low-Low
## 7 Low-Low Low-Low Low-Low
## 8 High-Low High-Low High-Low
## 9 Low-Low Low-Low Low-High
## 10 Low-High Low-Low Low-High
## 11 High-Low High-Low High-Low
## 12 Low-High Low-High Low-High
## 13 Low-High Low-High Low-High
## 14 Low-High High-Low Low-High
## 15 Low-Low High-Low Low-Low
## 16 Low-High Low-High Low-High
## 17 High-High High-High High-High
## 18 High-Low High-Low High-Low
## 19 High-Low High-Low High-Low
## 20 High-High High-High High-High
## 21 High-High High-High High-High
## 22 High-Low High-Low High-Low
## 23 Low-High Low-Low Low-High
## 24 Low-High High-High Low-High
## 25 High-High High-High High-High
## 26 High-Low High-Low High-Low
## 27 Low-Low Low-Low Low-Low
model_ols <- lm(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd)
summary(model_ols)
##
## Call:
## lm(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd)
##
## Residuals:
## Min 1Q Median 3Q Max
## -44.77 -18.03 -8.46 16.11 52.88
##
## Coefficients:
## Estimate Std. Error t value Pr(>|t|)
## (Intercept) -1.704e+02 1.034e+02 -1.648 0.1158
## x1 2.177e-01 6.328e-01 0.344 0.7347
## x2 8.170e+00 3.474e+00 2.352 0.0296 *
## x3 5.045e-01 8.446e-01 0.597 0.5574
## x4 1.981e-01 4.099e-01 0.483 0.6345
## x5 4.676e-03 1.741e-03 2.686 0.0146 *
## x6 -3.271e-01 4.216e-01 -0.776 0.4473
## x7 1.940e+00 9.466e-01 2.049 0.0545 .
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
##
## Residual standard error: 29.67 on 19 degrees of freedom
## Multiple R-squared: 0.435, Adjusted R-squared: 0.2268
## F-statistic: 2.09 on 7 and 19 DF, p-value: 0.09552
AIC(model_ols)
## [1] 268.2074
Dari tujuh variabel, hanya terdapat 2 variabel yang signifikan pada tingkat signifikansi 0.05, menunjukkan bahwa x2 dan x5 memiliki pengaruh terhadap variabel dependen. Sementara variabel lainnya tidak signifikan dan tidak memberikan kontribusi yang berarti dalam model ini. Hanya menjelaskan sedikit variasi dalam data, yaitu hanya sekitar 43.5% dari variasi dalam variabel dependen (y) dapat dijelaskan oleh variabel-variabel independen. Selain itu, AIC sebesar 268.2074.
vif(model_ols)
## x1 x2 x3 x4 x5 x6 x7
## 1.410619 2.550397 1.404437 1.256797 1.914100 1.410431 1.389405
Nilai VIF di bawah 5 menunjukkan bahwa tidak ada masalah serius terkait multikolinieritas antar variabel independen. Artinya, variabel-variabel tersebut tidak saling berkorelasi secara kuat, sehingga model OLS bisa diinterpretasikan dengan baik tanpa bias multikolinieritas.
bptest(model_ols)
##
## studentized Breusch-Pagan test
##
## data: model_ols
## BP = 14.793, df = 7, p-value = 0.03875
Dengan nilai p-value = 0.03875, yang lebih kecil dari 0.05, ini berarti ada bukti heterokedastisitas dalam model, sehingga asumsi homokedastisitas tidak terpenuhi, sehingga dilanjutkan ke GWR.
shapiro.test(model_ols$residuals)
##
## Shapiro-Wilk normality test
##
## data: model_ols$residuals
## W = 0.9568, p-value = 0.3117
Dengan p-value = 0.3117 (lebih besar dari 0.05), kita tidak menolak H0, yang berarti residual model berdistribusi normal. Ini menunjukkan bahwa asumsi normalitas residual telah terpenuhi.
durbinWatsonTest(model_ols)
## lag Autocorrelation D-W Statistic p-value
## 1 0.142524 1.690449 0.296
## Alternative hypothesis: rho != 0
Untuk mendeteksi ada atau tidaknya autokorelasi makadilakukan pengujian Durbin-Watson (DW). Uji Durbin-Watson menghasilkan nilai DW sebesar 0.142524, yang menunjukkan adanya autokorelasi positif yang kuat pada residual model. Namun, nilai p-value sebesar 0,26 lebih besar dari 0,05, sehingga tidak ada bukti yang signifikan secara statistik untuk menolak hipotesis nol yang menyatakan bahwa tidak ada autokorelasi dalam residual.
nb <- knn2nb(knearneigh(CoordK, k=6))
listw <- nb2listw(nb, style="W")
moran.test(model_ols$residuals, listw)
##
## Moran I test under randomisation
##
## data: model_ols$residuals
## weights: listw
##
## Moran I statistic standard deviate = -1.0831, p-value = 0.8606
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.140748991 -0.038461538 0.008918633
gwr.b1 = gwr.sel(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK) ;gwr.b1
## Bandwidth: 0.894596 CV score: 34533.62
## Bandwidth: 1.446042 CV score: 34821
## Bandwidth: 0.5537839 CV score: 35174.7
## Bandwidth: 1.073532 CV score: 34592.83
## Bandwidth: 0.7644173 CV score: 34564.75
## Bandwidth: 0.8943506 CV score: 34533.6
## Bandwidth: 0.8779308 CV score: 34532.77
## Bandwidth: 0.8345725 CV score: 34536.11
## Bandwidth: 0.8728752 CV score: 34532.73
## Bandwidth: 0.8733942 CV score: 34532.73
## Bandwidth: 0.8734711 CV score: 34532.73
## Bandwidth: 0.8735118 CV score: 34532.73
## Bandwidth: 0.8734711 CV score: 34532.73
## [1] 0.8734711
gwr.fit1 = gwr(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, bandwidth=gwr.b1, se.fit=TRUE, hatmatrix=TRUE);gwr.fit1
## Call:
## gwr(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd,
## coords = CoordK, bandwidth = gwr.b1, hatmatrix = TRUE, se.fit = TRUE)
## Kernel function: gwr.Gauss
## Fixed bandwidth: 0.8734711
## Summary of GWR coefficient estimates at data points:
## Min. 1st Qu. Median 3rd Qu. Max.
## X.Intercept. -2.9265e+02 -2.3246e+02 -1.6831e+02 -1.2007e+02 -1.0519e+02
## x1 -4.6163e-01 -2.9648e-01 4.3878e-02 6.0791e-01 9.9741e-01
## x2 5.7372e+00 6.2407e+00 7.6491e+00 1.0202e+01 1.2320e+01
## x3 8.0656e-02 2.0324e-01 4.7490e-01 8.2483e-01 1.1102e+00
## x4 2.6342e-02 5.5914e-02 9.0777e-02 1.3495e-01 1.9870e-01
## x5 3.4466e-03 3.9751e-03 4.4739e-03 5.2206e-03 6.0196e-03
## x6 -4.1972e-01 -3.4020e-01 -1.4991e-01 -8.4229e-02 1.1142e-01
## x7 8.3117e-01 1.4905e+00 2.3373e+00 2.9157e+00 3.2772e+00
## Global
## X.Intercept. -170.4352
## x1 0.2177
## x2 8.1697
## x3 0.5045
## x4 0.1981
## x5 0.0047
## x6 -0.3271
## x7 1.9396
## Number of data points: 27
## Effective number of parameters (residual: 2traceS - traceS'S): 13.75564
## Effective degrees of freedom (residual: 2traceS - traceS'S): 13.24436
## Sigma (residual: 2traceS - traceS'S): 27.95943
## Effective number of parameters (model: traceS): 11.71268
## Effective degrees of freedom (model: traceS): 15.28732
## Sigma (model: traceS): 26.02424
## Sigma (ML): 19.58222
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 288.9169
## AIC (GWR p. 96, eq. 4.22): 248.965
## Residual sum of squares: 10353.51
## Quasi-global R2: 0.6503146
Model GWR memberikan Quasi-global R² sebesar 0.6503146 yang berarti model ini hanya mampu menjelaskan sekitar 65.03% variasi dari data dependen (y). Selain itu, AICc (Akaike Information Criterion with correction) sebesar 288.9169 dan AIC sebesar 248.965
gwr.b2 <- gwr.sel(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, adapt = TRUE) ;gwr.b2
## Adaptive q: 0.381966 CV score: 35355.95
## Adaptive q: 0.618034 CV score: 34880.91
## Adaptive q: 0.763932 CV score: 35049.24
## Adaptive q: 0.6213862 CV score: 34873.39
## Adaptive q: 0.6667862 CV score: 35094.56
## Adaptive q: 0.6387275 CV score: 34926.66
## Adaptive q: 0.6240783 CV score: 34867.71
## Adaptive q: 0.6296738 CV score: 34857.31
## Adaptive q: 0.633132 CV score: 34884.67
## Adaptive q: 0.6275365 CV score: 34860.87
## Adaptive q: 0.6309947 CV score: 34867.89
## Adaptive q: 0.6288574 CV score: 34858.38
## Adaptive q: 0.6301783 CV score: 34861.37
## Adaptive q: 0.629362 CV score: 34857.45
## Adaptive q: 0.6296331 CV score: 34856.98
## Adaptive q: 0.6295247 CV score: 34857.15
## Adaptive q: 0.6295917 CV score: 34857.03
## Adaptive q: 0.6296331 CV score: 34856.98
## [1] 0.6296331
gwr.fit2 <- gwr(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, adapt=gwr.b2, se.fit=TRUE, hatmatrix=TRUE) ;gwr.fit2
## Call:
## gwr(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd,
## coords = CoordK, adapt = gwr.b2, hatmatrix = TRUE, se.fit = TRUE)
## Kernel function: gwr.Gauss
## Adaptive quantile: 0.6296331 (about 17 of 27 data points)
## Summary of GWR coefficient estimates at data points:
## Min. 1st Qu. Median 3rd Qu. Max.
## X.Intercept. -2.2766e+02 -2.1565e+02 -1.6830e+02 -1.3061e+02 -1.1799e+02
## x1 -2.2495e-01 -1.7838e-01 4.4255e-02 4.7650e-01 5.9513e-01
## x2 5.9741e+00 6.5265e+00 7.6752e+00 9.6004e+00 1.0033e+01
## x3 2.3938e-01 2.7557e-01 4.7496e-01 6.9849e-01 7.6589e-01
## x4 5.8292e-02 8.7990e-02 9.9952e-02 1.5180e-01 1.8209e-01
## x5 3.6362e-03 4.1289e-03 4.4955e-03 5.0002e-03 5.3402e-03
## x6 -3.8445e-01 -3.3326e-01 -1.8008e-01 -1.3422e-01 -1.2243e-02
## x7 1.3937e+00 1.5870e+00 2.3363e+00 2.7086e+00 2.8103e+00
## Global
## X.Intercept. -170.4352
## x1 0.2177
## x2 8.1697
## x3 0.5045
## x4 0.1981
## x5 0.0047
## x6 -0.3271
## x7 1.9396
## Number of data points: 27
## Effective number of parameters (residual: 2traceS - traceS'S): 12.23743
## Effective degrees of freedom (residual: 2traceS - traceS'S): 14.76257
## Sigma (residual: 2traceS - traceS'S): 28.61854
## Effective number of parameters (model: traceS): 10.50979
## Effective degrees of freedom (model: traceS): 16.49021
## Sigma (model: traceS): 27.07792
## Sigma (ML): 21.16151
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 284.3336
## AIC (GWR p. 96, eq. 4.22): 251.9504
## Residual sum of squares: 12090.85
## Quasi-global R2: 0.5916366
Model GWR memberikan Quasi-global R² sebesar 0.5916366, yang berarti model ini hanya mampu menjelaskan sekitar 59.16% variasi dari data dependen (y). Selain itu, AICc (Akaike Information Criterion with correction) sebesar 284.3336 dan AIC sebesar 251.9504
gwr.b3 <- gwr.sel(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, gweight=gwr.bisquare) ;gwr.b3
## Bandwidth: 0.894596 CV score: 206970.7
## Bandwidth: 1.446042 CV score: 36404.92
## Bandwidth: 1.786854 CV score: 35607.07
## Bandwidth: 1.61985 CV score: 36047.11
## Bandwidth: 1.997487 CV score: 35646.78
## Bandwidth: 1.879563 CV score: 35645.3
## Bandwidth: 1.723064 CV score: 35816.87
## Bandwidth: 1.822265 CV score: 35580.7
## Bandwidth: 1.822994 CV score: 35580.84
## Bandwidth: 1.818983 CV score: 35580.41
## Bandwidth: 1.818825 CV score: 35580.41
## Bandwidth: 1.818865 CV score: 35580.41
## Bandwidth: 1.818784 CV score: 35580.41
## Bandwidth: 1.818825 CV score: 35580.41
## [1] 1.818825
gwr.fit3 <- gwr(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, bandwidth=gwr.b3, se.fit=TRUE, hatmatrix=TRUE) ;gwr.fit3
## Call:
## gwr(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd,
## coords = CoordK, bandwidth = gwr.b3, hatmatrix = TRUE, se.fit = TRUE)
## Kernel function: gwr.Gauss
## Fixed bandwidth: 1.818825
## Summary of GWR coefficient estimates at data points:
## Min. 1st Qu. Median 3rd Qu. Max.
## X.Intercept. -1.9526e+02 -1.8380e+02 -1.6929e+02 -1.5411e+02 -1.4620e+02
## x1 -5.1564e-03 6.1821e-02 1.7487e-01 3.2034e-01 4.0319e-01
## x2 7.2485e+00 7.5129e+00 8.0437e+00 8.5815e+00 9.0007e+00
## x3 3.7651e-01 4.1864e-01 4.9732e-01 5.7138e-01 6.2236e-01
## x4 1.4746e-01 1.5577e-01 1.6999e-01 1.8143e-01 1.8889e-01
## x5 4.3048e-03 4.4244e-03 4.6178e-03 4.7763e-03 4.9784e-03
## x6 -3.5208e-01 -3.3051e-01 -2.8558e-01 -2.6146e-01 -2.1461e-01
## x7 1.6406e+00 1.7781e+00 2.0269e+00 2.2275e+00 2.3522e+00
## Global
## X.Intercept. -170.4352
## x1 0.2177
## x2 8.1697
## x3 0.5045
## x4 0.1981
## x5 0.0047
## x6 -0.3271
## x7 1.9396
## Number of data points: 27
## Effective number of parameters (residual: 2traceS - traceS'S): 9.675366
## Effective degrees of freedom (residual: 2traceS - traceS'S): 17.32463
## Sigma (residual: 2traceS - traceS'S): 29.19055
## Effective number of parameters (model: traceS): 8.904885
## Effective degrees of freedom (model: traceS): 18.09511
## Sigma (model: traceS): 28.56233
## Sigma (ML): 23.38258
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 280.0617
## AIC (GWR p. 96, eq. 4.22): 255.7351
## Residual sum of squares: 14762.12
## Quasi-global R2: 0.5014158
Model GWR memberikan Quasi-global R² sebesar 0.5014158, yang berarti model ini hanya mampu menjelaskan sekitar 50.14% variasi dari data dependen (y). Selain itu, AICc (Akaike Information Criterion with correction) sebesar 280.0617 dan AIC sebesar 255.7351
gwr.b4 = gwr.sel(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, gweight = gwr.tricube) ;gwr.b4
## Bandwidth: 0.894596 CV score: 273486.1
## Bandwidth: 1.446042 CV score: 37948.31
## Bandwidth: 1.786854 CV score: 36267.7
## Bandwidth: 1.621658 CV score: 36647.83
## Bandwidth: 1.781083 CV score: 36286.71
## Bandwidth: 1.997487 CV score: 35975.31
## Bandwidth: 1.970935 CV score: 35989.5
## Bandwidth: 2.041812 CV score: 35956.15
## Bandwidth: 2.15506 CV score: 35906.67
## Bandwidth: 2.225051 CV score: 35848.92
## Bandwidth: 2.268308 CV score: 35803.21
## Bandwidth: 2.295042 CV score: 35772.45
## Bandwidth: 2.311565 CV score: 35752.82
## Bandwidth: 2.321777 CV score: 35740.52
## Bandwidth: 2.328088 CV score: 35732.88
## Bandwidth: 2.331988 CV score: 35728.15
## Bandwidth: 2.334399 CV score: 35725.22
## Bandwidth: 2.335889 CV score: 35723.4
## Bandwidth: 2.336809 CV score: 35722.28
## Bandwidth: 2.337378 CV score: 35721.59
## Bandwidth: 2.33773 CV score: 35721.16
## Bandwidth: 2.337947 CV score: 35720.9
## Bandwidth: 2.338082 CV score: 35720.73
## Bandwidth: 2.338165 CV score: 35720.63
## Bandwidth: 2.338216 CV score: 35720.57
## Bandwidth: 2.338257 CV score: 35720.52
## Bandwidth: 2.338257 CV score: 35720.52
## Warning in gwr.sel(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords =
## CoordK, : Bandwidth converged to upper bound:2.33829918297788
## [1] 2.338257
gwr.fit4 = gwr(y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd, coords = CoordK, bandwidth=gwr.b4, se.fit=TRUE, hatmatrix=TRUE) ;gwr.fit4
## Call:
## gwr(formula = y ~ x1 + x2 + x3 + x4 + x5 + x6 + x7, data = dbd,
## coords = CoordK, bandwidth = gwr.b4, hatmatrix = TRUE, se.fit = TRUE)
## Kernel function: gwr.Gauss
## Fixed bandwidth: 2.338257
## Summary of GWR coefficient estimates at data points:
## Min. 1st Qu. Median 3rd Qu. Max.
## X.Intercept. -1.8505e+02 -1.7839e+02 -1.6970e+02 -1.6018e+02 -1.5495e+02
## x1 7.8636e-02 1.2172e-01 1.9165e-01 2.7917e-01 3.2878e-01
## x2 7.5774e+00 7.7566e+00 8.0936e+00 8.4111e+00 8.6519e+00
## x3 4.2418e-01 4.5119e-01 5.0015e-01 5.4456e-01 5.7446e-01
## x4 1.6681e-01 1.7196e-01 1.8086e-01 1.8812e-01 1.9276e-01
## x5 4.4454e-03 4.5146e-03 4.6406e-03 4.7303e-03 4.8539e-03
## x6 -3.4280e-01 -3.2936e-01 -3.0198e-01 -2.8682e-01 -2.5928e-01
## x7 1.7570e+00 1.8409e+00 1.9921e+00 2.1157e+00 2.1939e+00
## Global
## X.Intercept. -170.4352
## x1 0.2177
## x2 8.1697
## x3 0.5045
## x4 0.1981
## x5 0.0047
## x6 -0.3271
## x7 1.9396
## Number of data points: 27
## Effective number of parameters (residual: 2traceS - traceS'S): 9.044003
## Effective degrees of freedom (residual: 2traceS - traceS'S): 17.956
## Sigma (residual: 2traceS - traceS'S): 29.38033
## Effective number of parameters (model: traceS): 8.547631
## Effective degrees of freedom (model: traceS): 18.45237
## Sigma (model: traceS): 28.98247
## Sigma (ML): 23.9596
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 279.4839
## AIC (GWR p. 96, eq. 4.22): 256.6942
## Residual sum of squares: 15499.69
## Quasi-global R2: 0.4765047
Model GWR memberikan Quasi-global R² sebesar 0.4765047, yang berarti model ini hanya mampu menjelaskan sekitar 47.65% variasi dari data dependen (y). Selain itu, AICc (Akaike Information Criterion with correction) sebesar 279.4839 dan AIC sebesar 256.6942
residual_gwr <- gwr.fit1$SDF$gwr.e
nb <- knn2nb(knearneigh(CoordK, k=3))
listw <- nb2listw(nb, style="W")
moran.test(residual_gwr, listw)
##
## Moran I test under randomisation
##
## data: residual_gwr
## weights: listw
##
## Moran I statistic standard deviate = -0.82862, p-value = 0.7963
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic Expectation Variance
## -0.15192861 -0.03846154 0.01875119
Hasil uji Moran’s I untuk residual GWR menunjukkan bahwa tidak ada autokorelasi spasial yang signifikan dalam residual model. Dengan demikian, model GWR yang digunakan sudah cukup baik dalam menangkap variasi spasial.
shapiro.test(residual_gwr)
##
## Shapiro-Wilk normality test
##
## data: residual_gwr
## W = 0.94983, p-value = 0.2124
Nilai p-value yang tinggi (0.3875) lebih besar dari tingkat signifikansi 0.05, ini menunjukkan bahwa residual dari model GWR berdistribusi normal.
bptest(gwr.fit1$lm, weights = gwr.fit1$gweight)
##
## studentized Breusch-Pagan test
##
## data: gwr.fit1$lm
## BP = 14.793, df = 7, p-value = 0.03875
Nilai p-value sebesar 0.03875 lebih besar dari 0.05, sehingga kita menolak hipotesis nol. Ini menunjukkan bahwa tidak ada bukti heteroskedastisitas dalam residual model GWR.
b.x1 <- gwr.fit1$SDF$x1
b.x2 <- gwr.fit1$SDF$x2
b.x3 <- gwr.fit1$SDF$x3
b.x4 <- gwr.fit1$SDF$x4
b.x5 <- gwr.fit1$SDF$x5
b.x6 <- gwr.fit1$SDF$x6
b.x7 <- gwr.fit1$SDF$x7
jabar@data$b1<- b.x1
spplot(jabar, "b1", main = "Peta Sebaran Penduga Parameter beta (x1)")
jabar@data$b2<- b.x2
spplot(jabar, "b2", main = "Peta Sebaran Penduga Parameter beta (x2)")
jabar@data$b3<- b.x3
spplot(jabar, "b3", main = "Peta Sebaran Penduga Parameter beta (x3)")
jabar@data$b4<- b.x4
spplot(jabar, "b4", main = "Peta Sebaran Penduga Parameter beta (x4)")
jabar@data$b5<- b.x5
spplot(jabar, "b5", main = "Peta Sebaran Penduga Parameter beta (x5)")
jabar@data$b6<- b.x6
spplot(jabar, "b6", main = "Peta Sebaran Penduga Parameter beta (x6)")
jabar@data$b7<- b.x7
spplot(jabar, "b7", main = "Peta Sebaran Penduga Parameter beta (x7)")
BFC02.gwr.test(gwr.fit1)
##
## Brunsdon, Fotheringham & Charlton (2002, pp. 91-2) ANOVA
##
## data: gwr.fit1
## F = 1.6158, df1 = 19.000, df2 = 13.244, p-value = 0.1879
## alternative hypothesis: greater
## sample estimates:
## SS OLS residuals SS GWR residuals
## 16729.02 10353.51
anova(gwr.fit1)
## Analysis of Variance Table
## Df Sum Sq Mean Sq F value
## OLS Residuals 8.0000 16729.0
## GWR Improvement 5.7556 6375.5 1107.70
## GWR Residuals 13.2444 10353.5 781.73 1.417
Nilai F sebesar 1.417 menunjukkan bahwa perbedaan antara model OLS dan GWR dengan pembobot kernel fixed gaussian tidak signifikan.
LMZ.F3GWR.test(gwr.fit1)
##
## Leung et al. (2000) F(3) test
##
## F statistic Numerator d.f. Denominator d.f. Pr(>)
## (Intercept) 2.23936 8.27107 16.289 0.07852 .
## x1 2.71798 8.38599 16.289 0.04008 *
## x2 2.13179 9.82887 16.289 0.08489 .
## x3 1.10429 13.84318 16.289 0.41955
## x4 0.12698 11.48436 16.289 0.99946
## x5 1.07542 10.80792 16.289 0.43380
## x6 0.77971 8.21031 16.289 0.62903
## x7 2.89005 11.33283 16.289 0.02531 *
## ---
## Signif. codes: 0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
Variabel X1 dan X7 p-valuenya lebih kecil dari 0.05. Ini menunjukkan bahwa hanya ada 2 variabel yang signifikan secara statistik dalam model GWR.
results <- as.data.frame(gwr.fit1$SDF)
head(results)
## sum.w X.Intercept. x1 x2 x3 x4 x5
## 1 13.81378 -292.6518 -0.43872635 12.320020 1.1101735 0.18458737 0.005870219
## 2 12.67706 -282.8275 -0.46162619 11.842968 1.0381810 0.13975880 0.006019586
## 3 16.39886 -219.3303 -0.21646244 9.581534 0.6796120 0.10409245 0.005296152
## 4 18.69296 -168.4688 0.08902894 7.649112 0.4534666 0.08570216 0.004559572
## 5 17.03101 -149.2162 0.33640310 6.974930 0.3427871 0.06888314 0.004473851
## 6 15.11090 -124.7690 0.67884812 6.394535 0.2088164 0.04452980 0.004281752
## x6 x7 X.Intercept._se x1_se x2_se x3_se x4_se
## 1 0.02376136 3.277226 116.17909 0.6744287 3.683867 0.9474880 0.4306334
## 2 0.11142226 3.276288 108.01516 0.6745835 3.698328 0.8940467 0.4143504
## 3 0.01577591 2.844017 96.09282 0.6079145 3.286653 0.7827301 0.3828153
## 4 -0.11988191 2.278169 92.68357 0.5657248 3.125377 0.7505059 0.3662869
## 5 -0.14991217 1.857581 93.98072 0.5699569 3.218763 0.7563083 0.3668228
## 6 -0.25042409 1.290336 97.21863 0.6032036 3.456935 0.7724249 0.3750686
## x5_se x6_se x7_se gwr.e pred pred.se localR2
## 1 0.001843157 0.4476640 1.0758678 -17.9754441 48.975444 14.48392 0.7291267
## 2 0.001804341 0.4472184 1.0523944 -0.4261113 4.426111 17.38246 0.7433435
## 3 0.001635025 0.3974317 0.9140385 -22.3209478 57.320948 18.11568 0.6907610
## 4 0.001568870 0.3765967 0.8453878 -2.3440829 22.344083 15.18366 0.6281956
## 5 0.001607096 0.3811650 0.8473627 -18.4375565 45.437557 14.68635 0.6025978
## 6 0.001692548 0.3995129 0.9052092 -31.1092592 36.109259 16.12620 0.5533596
## X.Intercept._se_EDF x1_se_EDF x2_se_EDF x3_se_EDF x4_se_EDF x5_se_EDF
## 1 124.81828 0.7245798 3.957803 1.0179441 0.4626557 0.001980216
## 2 116.04727 0.7247462 3.973339 0.9605288 0.4451619 0.001938513
## 3 103.23837 0.6531196 3.531052 0.8409347 0.4112819 0.001756607
## 4 99.57561 0.6077927 3.357783 0.8063142 0.3935243 0.001685532
## 5 100.96922 0.6123394 3.458114 0.8125481 0.3941001 0.001726601
## 6 104.44790 0.6480584 3.713996 0.8298631 0.4029590 0.001818407
## x6_se_EDF x7_se_EDF pred.se.1 coord.x coord.y
## 1 0.4809527 1.1558704 15.56095 106.7684 -6.561213
## 2 0.4804740 1.1306514 18.67504 106.7101 -7.074610
## 3 0.4269851 0.9820073 19.46278 107.1595 -7.128689
## 4 0.4046008 0.9082516 16.31273 107.6104 -7.099844
## 5 0.4095088 0.9103734 15.77844 107.7887 -7.359583
## 6 0.4292211 0.9725215 17.32536 108.1412 -7.496875
df = gwr.fit1$results$edf
jabar$x1 = gwr.fit1$SDF$x1/gwr.fit1$SDF$'x1_se'
jabar$x2 = gwr.fit1$SDF$x2/gwr.fit1$SDF$'x2_se'
jabar$x3 = gwr.fit1$SDF$x3/gwr.fit1$SDF$'x3_se'
jabar$x4 = gwr.fit1$SDF$x4/gwr.fit1$SDF$'x4_se'
jabar$x5 = gwr.fit1$SDF$x5/gwr.fit1$SDF$'x5_se'
jabar$x6 = gwr.fit1$SDF$x6/gwr.fit1$SDF$'x6_se'
jabar$x7 = gwr.fit1$SDF$x7/gwr.fit1$SDF$'x7_se'
jabar$x1.p = 2*pt(-abs(jabar$x1), df)
jabar$x2.p = 2*pt(-abs(jabar$x2), df)
jabar$x3.p = 2*pt(-abs(jabar$x3), df)
jabar$x4.p = 2*pt(-abs(jabar$x4), df)
jabar$x5.p = 2*pt(-abs(jabar$x5), df)
jabar$x6.p = 2*pt(-abs(jabar$x6), df)
jabar$x7.p = 2*pt(-abs(jabar$x7), df)
data.frame(dbd$Distrik, jabar$x1, jabar$x1.p) %>% mutate(Ket = ifelse(jabar$x1.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x1 jabar.x1.p Ket
## 1 Bogor -0.65051558 0.5264837 Not Reject
## 2 Sukabumi -0.68431287 0.5055762 Not Reject
## 3 Cianjur -0.35607383 0.7273931 Not Reject
## 4 Bandung 0.15737147 0.8773260 Not Reject
## 5 Garut 0.59022551 0.5649747 Not Reject
## 6 Tasikmalaya 1.12540461 0.2803988 Not Reject
## 7 Ciamis 1.25282003 0.2319400 Not Reject
## 8 Kuningan 1.15894625 0.2669477 Not Reject
## 9 Cirebon 0.96775334 0.3505084 Not Reject
## 10 Majalengka 0.75880959 0.4612580 Not Reject
## 11 Sumedang 0.45228722 0.6583812 Not Reject
## 12 Indramayu 0.40251418 0.6937269 Not Reject
## 13 Subang -0.05189427 0.9593875 Not Reject
## 14 Purwakarta -0.29516573 0.7724436 Not Reject
## 15 Karawang -0.42216227 0.6796791 Not Reject
## 16 Bekasi -0.51932917 0.6121003 Not Reject
## 17 Bandung Barat -0.19357990 0.8494421 Not Reject
## 18 Pangandaran 1.50433097 0.1559651 Not Reject
## 19 Kota Bogor -0.64259522 0.5314539 Not Reject
## 20 Kota Sukabumi -0.57740357 0.5733520 Not Reject
## 21 Kota Bandung 0.07758502 0.9393180 Not Reject
## 22 Kota Cirebon 0.96674244 0.3509952 Not Reject
## 23 Kota Bekasi -0.56514943 0.5814195 Not Reject
## 24 Kota Depok -0.61923444 0.5462668 Not Reject
## 25 Kota Cimahi -0.05498740 0.9569693 Not Reject
## 26 Kota Tasikmalaya 1.11552929 0.2844556 Not Reject
## 27 Kota Banjar 1.40153531 0.1840511 Not Reject
data.frame(dbd$Distrik, jabar$x2, jabar$x2.p) %>% mutate(Ket = ifelse(jabar$x2.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x2 jabar.x2.p Ket
## 1 Bogor 3.344317 0.005157238 Reject
## 2 Sukabumi 3.202249 0.006794515 Reject
## 3 Cianjur 2.915286 0.011852517 Reject
## 4 Bandung 2.447421 0.029051025 Reject
## 5 Garut 2.166960 0.049032087 Reject
## 6 Tasikmalaya 1.849770 0.086781500 Not Reject
## 7 Ciamis 1.706716 0.111197626 Not Reject
## 8 Kuningan 1.656337 0.121141550 Not Reject
## 9 Cirebon 1.664805 0.119417693 Not Reject
## 10 Majalengka 1.848468 0.086980201 Not Reject
## 11 Sumedang 2.099389 0.055491738 Not Reject
## 12 Indramayu 1.956283 0.071856561 Not Reject
## 13 Subang 2.438803 0.029527957 Reject
## 14 Purwakarta 2.799641 0.014818767 Reject
## 15 Karawang 2.921281 0.011715845 Reject
## 16 Bekasi 3.166339 0.007285036 Reject
## 17 Bandung Barat 2.745112 0.016459527 Reject
## 18 Pangandaran 1.658240 0.120752205 Not Reject
## 19 Kota Bogor 3.325327 0.005350774 Reject
## 20 Kota Sukabumi 3.161814 0.007349314 Reject
## 21 Kota Bandung 2.473396 0.027657833 Reject
## 22 Kota Cirebon 1.663769 0.119627281 Not Reject
## 23 Kota Bekasi 3.277371 0.005872612 Reject
## 24 Kota Depok 3.352905 0.005072039 Reject
## 25 Kota Cimahi 2.595965 0.021906910 Reject
## 26 Kota Tasikmalaya 1.815998 0.092067435 Not Reject
## 27 Kota Banjar 1.646374 0.123197530 Not Reject
data.frame(dbd$Distrik, jabar$x3, jabar$x3.p) %>% mutate(Ket = ifelse(jabar$x3.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x3 jabar.x3.p Ket
## 1 Bogor 1.1717019 0.2619642 Not Reject
## 2 Sukabumi 1.1612156 0.2660558 Not Reject
## 3 Cianjur 0.8682584 0.4007125 Not Reject
## 4 Bandung 0.6042146 0.5559102 Not Reject
## 5 Garut 0.4532372 0.6577144 Not Reject
## 6 Tasikmalaya 0.2703388 0.7910665 Not Reject
## 7 Ciamis 0.1815135 0.8587130 Not Reject
## 8 Kuningan 0.1694241 0.8680235 Not Reject
## 9 Cirebon 0.2065066 0.8395360 Not Reject
## 10 Majalengka 0.3255748 0.7498325 Not Reject
## 11 Sumedang 0.4630340 0.6508564 Not Reject
## 12 Indramayu 0.4368615 0.6692498 Not Reject
## 13 Subang 0.6812486 0.5074515 Not Reject
## 14 Purwakarta 0.8340896 0.4190205 Not Reject
## 15 Karawang 0.9269921 0.3705156 Not Reject
## 16 Bekasi 1.0239707 0.3241890 Not Reject
## 17 Bandung Barat 0.7714833 0.4539657 Not Reject
## 18 Pangandaran 0.1011812 0.9209223 Not Reject
## 19 Kota Bogor 1.1591061 0.2668848 Not Reject
## 20 Kota Sukabumi 1.0596411 0.3082509 Not Reject
## 21 Kota Bandung 0.6336846 0.5370771 Not Reject
## 22 Kota Cirebon 0.2060999 0.8398473 Not Reject
## 23 Kota Bekasi 1.0788749 0.2999005 Not Reject
## 24 Kota Depok 1.1436710 0.2730109 Not Reject
## 25 Kota Cimahi 0.6968150 0.4979673 Not Reject
## 26 Kota Tasikmalaya 0.2566494 0.8013932 Not Reject
## 27 Kota Banjar 0.1169037 0.9086905 Not Reject
data.frame(dbd$Distrik, jabar$x4, jabar$x4.p) %>% mutate(Ket = ifelse(jabar$x4.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x4 jabar.x4.p Ket
## 1 Bogor 0.42864155 0.6750734 Not Reject
## 2 Sukabumi 0.33729615 0.7411793 Not Reject
## 3 Cianjur 0.27191296 0.7898816 Not Reject
## 4 Bandung 0.23397551 0.8185819 Not Reject
## 5 Garut 0.18778315 0.8538931 Not Reject
## 6 Tasikmalaya 0.11872443 0.9072755 Not Reject
## 7 Ciamis 0.11009399 0.9139856 Not Reject
## 8 Kuningan 0.12954520 0.8988730 Not Reject
## 9 Cirebon 0.14515704 0.8867727 Not Reject
## 10 Majalengka 0.16819273 0.8689730 Not Reject
## 11 Sumedang 0.20769083 0.8386299 Not Reject
## 12 Indramayu 0.20520700 0.8405307 Not Reject
## 13 Subang 0.28068989 0.7832851 Not Reject
## 14 Purwakarta 0.31237241 0.7596213 Not Reject
## 15 Karawang 0.38410346 0.7069978 Not Reject
## 16 Bekasi 0.43728758 0.6689485 Not Reject
## 17 Bandung Barat 0.27479256 0.7877155 Not Reject
## 18 Pangandaran 0.06720145 0.9474252 Not Reject
## 19 Kota Bogor 0.41433785 0.6852588 Not Reject
## 20 Kota Sukabumi 0.32325229 0.7515513 Not Reject
## 21 Kota Bandung 0.24784434 0.8080559 Not Reject
## 22 Kota Cirebon 0.14521261 0.8867297 Not Reject
## 23 Kota Bekasi 0.45116600 0.6591685 Not Reject
## 24 Kota Depok 0.45715229 0.6549699 Not Reject
## 25 Kota Cimahi 0.26214281 0.7972444 Not Reject
## 26 Kota Tasikmalaya 0.12306000 0.9039074 Not Reject
## 27 Kota Banjar 0.09556878 0.9252940 Not Reject
data.frame(dbd$Distrik, jabar$x5, jabar$x5.p) %>% mutate(Ket = ifelse(jabar$x5.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x5 jabar.x5.p Ket
## 1 Bogor 3.184872 0.007027617 Reject
## 2 Sukabumi 3.336169 0.005239402 Reject
## 3 Cianjur 3.239187 0.006324384 Reject
## 4 Bandung 2.906279 0.012060838 Reject
## 5 Garut 2.783811 0.015277825 Reject
## 6 Tasikmalaya 2.529767 0.024851958 Reject
## 7 Ciamis 2.281563 0.039659775 Reject
## 8 Kuningan 2.102061 0.055221967 Not Reject
## 9 Cirebon 2.010761 0.065164339 Not Reject
## 10 Majalengka 2.242996 0.042607156 Reject
## 11 Sumedang 2.488069 0.026899488 Reject
## 12 Indramayu 2.196853 0.046404683 Reject
## 13 Subang 2.620625 0.020898636 Reject
## 14 Purwakarta 2.928724 0.011548323 Reject
## 15 Karawang 2.820253 0.014241261 Reject
## 16 Bekasi 2.923077 0.011675206 Reject
## 17 Bandung Barat 3.034494 0.009408732 Reject
## 18 Pangandaran 2.348500 0.034997185 Reject
## 19 Kota Bogor 3.195317 0.006886567 Reject
## 20 Kota Sukabumi 3.285775 0.005777599 Reject
## 21 Kota Bandung 2.845920 0.013553003 Reject
## 22 Kota Cirebon 2.008070 0.065481003 Not Reject
## 23 Kota Bekasi 3.010370 0.009859197 Reject
## 24 Kota Depok 3.103381 0.008231860 Reject
## 25 Kota Cimahi 2.924289 0.011647863 Reject
## 26 Kota Tasikmalaya 2.437770 0.029585581 Reject
## 27 Kota Banjar 2.234737 0.043264652 Reject
data.frame(dbd$Distrik, jabar$x6, jabar$x6.p) %>% mutate(Ket = ifelse(jabar$x6.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x6 jabar.x6.p Ket
## 1 Bogor 0.05307856 0.9584616 Not Reject
## 2 Sukabumi 0.24914504 0.8070707 Not Reject
## 3 Cianjur 0.03969465 0.9689287 Not Reject
## 4 Bandung -0.31832971 0.7551989 Not Reject
## 5 Garut -0.39329992 0.7003560 Not Reject
## 6 Tasikmalaya -0.62682349 0.5414297 Not Reject
## 7 Ciamis -0.84822130 0.4113828 Not Reject
## 8 Kuningan -0.97923798 0.3450117 Not Reject
## 9 Cirebon -1.02620208 0.3231747 Not Reject
## 10 Majalengka -0.85638455 0.4070131 Not Reject
## 11 Sumedang -0.68050933 0.5079045 Not Reject
## 12 Indramayu -0.89689258 0.3857892 Not Reject
## 13 Subang -0.62759987 0.5409362 Not Reject
## 14 Purwakarta -0.36643088 0.7198308 Not Reject
## 15 Karawang -0.46670637 0.6482941 Not Reject
## 16 Bekasi -0.31406027 0.7583674 Not Reject
## 17 Bandung Barat -0.23295538 0.8193576 Not Reject
## 18 Pangandaran -0.80822140 0.4332410 Not Reject
## 19 Kota Bogor 0.04904893 0.9616123 Not Reject
## 20 Kota Sukabumi 0.11154228 0.9128591 Not Reject
## 21 Kota Bandung -0.39811667 0.6968874 Not Reject
## 22 Kota Cirebon -1.02791092 0.3223995 Not Reject
## 23 Kota Bekasi -0.18294744 0.8576101 Not Reject
## 24 Kota Depok -0.03571327 0.9720437 Not Reject
## 25 Kota Cimahi -0.33660774 0.7416865 Not Reject
## 26 Kota Tasikmalaya -0.70962301 0.4902433 Not Reject
## 27 Kota Banjar -0.89772805 0.3853595 Not Reject
data.frame(dbd$Distrik, jabar$x7, jabar$x7.p) %>% mutate(Ket = ifelse(jabar$x7.p<0.05,
"Reject", "Not Reject"))
## dbd.Distrik jabar.x7 jabar.x7.p Ket
## 1 Bogor 3.0461229 0.009198935 Reject
## 2 Sukabumi 3.1131755 0.008076885 Reject
## 3 Cianjur 3.1114853 0.008103421 Reject
## 4 Bandung 2.6948214 0.018129500 Reject
## 5 Garut 2.1921916 0.046805506 Reject
## 6 Tasikmalaya 1.4254565 0.177165469 Not Reject
## 7 Ciamis 1.2490497 0.233272620 Not Reject
## 8 Kuningan 1.3672923 0.194291164 Not Reject
## 9 Cirebon 1.5898879 0.135437642 Not Reject
## 10 Majalengka 1.8984451 0.079643623 Not Reject
## 11 Sumedang 2.2962451 0.038589253 Reject
## 12 Indramayu 2.2290325 0.043724325 Reject
## 13 Subang 2.7090057 0.017642428 Reject
## 14 Purwakarta 2.9596618 0.010876981 Reject
## 15 Karawang 2.8962797 0.012296323 Reject
## 16 Bekasi 2.9410734 0.011275565 Reject
## 17 Bandung Barat 2.9786330 0.010484566 Reject
## 18 Pangandaran 0.8419069 0.414784082 Not Reject
## 19 Kota Bogor 3.0610780 0.008935953 Reject
## 20 Kota Sukabumi 3.1428510 0.007624855 Reject
## 21 Kota Bandung 2.7407348 0.016598691 Reject
## 22 Kota Cirebon 1.5903780 0.135327090 Not Reject
## 23 Kota Bekasi 2.9790922 0.010475242 Reject
## 24 Kota Depok 3.0075463 0.009913311 Reject
## 25 Kota Cimahi 2.8594464 0.013203542 Reject
## 26 Kota Tasikmalaya 1.4507082 0.170130525 Not Reject
## 27 Kota Banjar 1.0269251 0.322846564 Not Reject
Hasil analisis menunjukkan pengaruh bahwa variabel x2, x5, dan x7 signifikan di beberapa Kabupaten/Kota di Jawa Barat, dengan p-value di bawah 0.05 dan status “Reject”.
Selain itu, variabel x1, x3, x4 dan x6 semuanya menunjukkan hasil “Not Reject”, yang berarti tidak ada bukti cukup untuk menyatakan pengaruh signifikan dari ketiga variabel tersebut terhadap variabel dependen.
Namun, meskipun tidak semua variabel independen signifikan, model GWR telah menunjukkan performa yang lebih baik dibandingkan model OLS, jika dilihat dari nilai AIC dan R².
my_palette <- brewer.pal(8, "Spectral")
gwr.prediksi <- gwr.fit1$SDF$pred
jabar@data$pred <- gwr.prediksi
jabar@data$y <- dbd$y
spplot(jabar,
c("y", "pred"),
names.attr = c("Peta Sebaran Peubah Y pada Data",
"Peta Sebaran Dugaan Peubah Respon Y Model GWR"),
as.table = TRUE,
main = "Nilai Peubah Y VS Dugaan Y GWR",
col.regions = my_palette,
cuts = 7 # cuts disesuaikan dengan jumlah warna yang digunakan
)
Dari visualisasi peta, tampak bahwa pola warna pada kedua peta cukup mirip, terutama di wilayah-wilayah dengan warna yang dominan seperti merah tua dan oranye. Ini menunjukkan bahwa model GWR berhasil menduga sebaran nilai variabel Y dengan cukup baik, meskipun mungkin ada sedikit perbedaan di beberapa area, seperti di wilayah dengan warna hijau kebiruan yang tidak terlihat jelas pada peta dugaan.