Email:

Mata Kuliah: Spatial Statistics

Dosen Pengampu: Dr. I Gede Nyoman Mindra Jaya, M.Si, Ph.D

Eksplorasi Data

Import Data

Data yang digunakan adalah data Tingkat Pengangguran Terbuka di Jawa Barat tahun 2023

setwd("/Users/USER/OneDrive/Documents/STATISTIKA UNPAD/SEMESTER 5/Spasial/Uts_Spasial")
data<-read.csv("Pengangguran.csv",sep=",", dec=".") 
data
##    id         Kab.Kota   TPT   IPM PDRB   AKL   AKP
## 1   1          Bandung  6.52 73.74 4.97 84.44 49.19
## 2   2    Bandung Barat  8.11 69.61 5.00 87.72 45.55
## 3   3           Bekasi  8.87 75.76 5.32 87.51 42.05
## 4   4            Bogor  8.47 71.78 5.19 85.13 42.17
## 5   5           Ciamis  3.52 72.05 4.99 81.24 51.47
## 6   6          Cianjur  7.71 66.55 5.16 89.55 54.20
## 7   7          Cirebon  7.65 70.95 4.85 84.16 47.86
## 8   8            Garut  7.33 68.11 4.94 85.10 54.39
## 9   9        Indramayu  6.46 69.25 9.76 83.27 44.53
## 10 10         Karawang  8.95 72.35 5.40 86.17 40.28
## 11 11     Kota Bandung  8.83 83.04 5.07 83.22 50.73
## 12 12      Kota Banjar  5.43 73.08 4.63 84.21 50.74
## 13 13      Kota Bekasi  7.90 83.03 5.43 80.38 48.91
## 14 14       Kota Bogor  9.39 77.85 5.10 82.95 46.32
## 15 15      Kota Cimahi 10.52 79.46 5.19 83.65 53.07
## 16 16     Kota Cirebon  7.66 76.46 5.01 81.72 55.77
## 17 17       Kota Depok  6.97 82.38 5.05 78.46 46.99
## 18 18    Kota Sukabumi  8.53 76.32 5.12 81.38 43.80
## 19 19 Kota Tasikmalaya  6.55 74.47 5.96 80.63 49.94
## 20 20         Kuningan  9.49 70.72 5.25 81.90 41.65
## 21 21       Majalengka  4.12 69.13 6.15 84.83 52.24
## 22 22      Pangandaran  1.52 69.38 5.26 89.45 70.98
## 23 23       Purwakarta  7.72 72.09 4.97 85.62 46.68
## 24 24           Subang  7.65 70.70 4.64 86.94 53.27
## 25 25         Sukabumi  7.32 68.49 5.17 86.50 48.52
## 26 26         Sumedang  6.94 73.18 5.01 85.32 50.07
## 27 27      Tasikmalaya  3.89 67.76 4.69 84.04 52.39

Untuk menampilkan peta Jawa Barat

Jabar <- st_read("Jawa_Barat/RBI_50K_2023_Jawa Barat.shp")
## Reading layer `RBI_50K_2023_Jawa Barat' from data source 
##   `C:\Users\USER\OneDrive\Documents\STATISTIKA UNPAD\SEMESTER 5\Spasial\Uts_Spasial\Jawa_Barat\RBI_50K_2023_Jawa Barat.shp' 
##   using driver `ESRI Shapefile'
## Simple feature collection with 27 features and 25 fields
## Geometry type: MULTIPOLYGON
## Dimension:     XY, XYZ
## Bounding box:  xmin: 106.3703 ymin: -7.82099 xmax: 108.8468 ymax: -5.806538
## z_range:       zmin: 0 zmax: 0
## Geodetic CRS:  WGS 84 + EGM2008 height
Jabar<- st_zm(Jabar)
# Convert to SpatialPolygonsDataFrame
Jabar<- as_Spatial(Jabar)
# Plot the data
plot(Jabar)

Eksplor Data

Statistika Deskriptif

describe(data)
##           vars  n  mean   sd median trimmed   mad   min   max range  skew
## id           1 27 14.00 7.94  14.00   14.00 10.38  1.00 27.00 26.00  0.00
## Kab.Kota*    2 27 14.00 7.94  14.00   14.00 10.38  1.00 27.00 26.00  0.00
## TPT          3 27  7.19 2.02   7.65    7.35  1.63  1.52 10.52  9.00 -0.99
## IPM          4 27 73.25 4.69  72.09   72.93  4.21 66.55 83.04 16.49  0.74
## PDRB         5 27  5.31 0.95   5.10    5.13  0.19  4.63  9.76  5.13  3.79
## AKL          6 27 84.28 2.73  84.21   84.25  2.91 78.46 89.55 11.09  0.02
## AKP          7 27 49.40 6.06  49.19   48.92  4.74 40.28 70.98 30.70  1.38
##           kurtosis   se
## id           -1.33 1.53
## Kab.Kota*    -1.33 1.53
## TPT           0.62 0.39
## IPM          -0.50 0.90
## PDRB         14.91 0.18
## AKL          -0.58 0.53
## AKP           3.56 1.17

Membuat peta sebaran presentase tingkat pengangguran terbuka di Jawa Barat tahun 2023

Jabar$id <- 1:27  
data$x<-coordinates(Jabar)[,1]
data$y<-coordinates(Jabar)[,2]

Jabar_sf<-st_as_sf(Jabar)

Jabar_merged <- Jabar_sf %>%
  left_join(data, by = "id") 


ggplot() +
  geom_sf(data=Jabar_merged, aes(fill = TPT),color=NA) +
  theme_bw() +
  scale_fill_gradient(low = "yellow", high = "red") +
  theme(panel.grid.major = element_blank(), panel.grid.minor = element_blank())+ 
  theme(legend.position = "right",
        axis.text.x = element_blank(),  # Remove x-axis labels
        axis.text.y = element_blank())+  # Remove y-axis labels   
  labs(title = "Persebaran Tingkat Pengangguran Terbuka Jawa Barat 2023",
       fill = "TPT") 

Menuju warna kuning -> tingkat pengangguran terbuka semakin rendah

Menuju warna merah -> tingkat pengangguran terbuka semakin tinggi

Hasil plot data di atas mendjadi identifikasi awal adanya ketergantungan spasial

Melihat nilai kuartil dari data

summary(data$TPT)
##    Min. 1st Qu.  Median    Mean 3rd Qu.    Max. 
##   1.520   6.535   7.650   7.186   8.500  10.520
breaks <- c(-Inf, 6.535, 7.650, 8.500,Inf)

Sebaran spasial data berdasarkan kuartil

# Define labels for each interval
labels <- c("Very Low", "Low", "High", "Very High")

# Create a new column with discretized 
Jabar_merged$data_Discrete <- cut(Jabar_merged$TPT, breaks = breaks, labels = labels, right = TRUE)

#png("Fig.1.png", units="in", width=8, height=10, res=100)

a<- ggplot() +
  geom_sf(data=Jabar_merged, aes(fill = data_Discrete),color=NA) +
  theme_bw() +
  scale_fill_manual(values = c("Very Low" = "yellow", 
                               "Low" = "orange",
                               "High" = "red",
                               "Very High" = "red3"))+
  labs(fill = "data")+theme(legend.position = "right",
                            axis.text.x = element_blank(),  # Remove x-axis labels
                            axis.text.y = element_blank())+  # Remove y-axis labels   
  labs(title = "",
       fill = "TPT")       
a

Regresi Linear

Dalam regresi, kita mengenal istilah variabel dependen dan variabel independen, di mana variabel dependen dipengaruhi oleh variabel independen.

\[ Y_i = \beta_0 + \beta_1 X_i + \epsilon_i \]

Dimana:

  • \(Y_i\): variabel dependen
  • \(X_i\): variabel independen
  • \(\epsilon_i\): residual

Model OLS

data<-read.csv("Pengangguran.csv",sep=",", dec=".") 
reg.klasik <- lm(TPT~IPM + PDRB + AKL + AKP, data=data)
summary(reg.klasik)
## 
## Call:
## lm(formula = TPT ~ IPM + PDRB + AKL + AKP, data = data)
## 
## Residuals:
##     Min      1Q  Median      3Q     Max 
## -2.1348 -1.0775 -0.1318  0.7049  2.8974 
## 
## Coefficients:
##              Estimate Std. Error t value Pr(>|t|)    
## (Intercept) -21.26442   15.90198  -1.337 0.194814    
## IPM           0.22659    0.07712   2.938 0.007610 ** 
## PDRB         -0.17924    0.30385  -0.590 0.561269    
## AKL           0.28203    0.13449   2.097 0.047699 *  
## AKP          -0.22197    0.04770  -4.654 0.000122 ***
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1
## 
## Residual standard error: 1.4 on 22 degrees of freedom
## Multiple R-squared:  0.5947, Adjusted R-squared:  0.521 
## F-statistic:  8.07 on 4 and 22 DF,  p-value: 0.0003656

AIC OLS

AIC(reg.klasik)
## [1] 101.2597

Diagnostik Model

par(mfrow=c(2,2)) 
plot(reg.klasik)  

Uji Asumsi Klasik OLS

1. Uji Multikolinearitas

vif(reg.klasik)
##      IPM     PDRB      AKL      AKP 
## 1.734891 1.106601 1.786810 1.107161

Hasil VIF menunjukkan bahwa semua variabel (IPM, PDRB, AKL, dan AKP) memiliki nilai VIF <5. Artinya, tidak ada masalah multikolinearitas dalam model, dan setiap variabel independen tidak memiliki korelasi tinggi satu sama lain

2. Uji Heteroskedastisitas

H₀: Tidak ada heteroskedastisitas dalam model regresi (varian residual konstan)

H₁: Terdapat heteroskedastisitas dalam model regresi (varian residual tidak konstan).

bptest(reg.klasik)
## 
##  studentized Breusch-Pagan test
## 
## data:  reg.klasik
## BP = 4.727, df = 4, p-value = 0.3165

Dengan p-value sebesar 0.3165 (lebih besar dari 0.05), maka H₀ diterima. Artinya, model ini memenuhi asumsi homoskedastisitas, atau varian residualnya dianggap konstan.

3. Uji Normalitas

H₀: Residual model regresi berdistribusi normal.

H₁: Residual model regresi tidak berdistribusi normal.

shapiro.test(reg.klasik$residuals)
## 
##  Shapiro-Wilk normality test
## 
## data:  reg.klasik$residuals
## W = 0.9626, p-value = 0.4228

Dengan p-value sebesar 0.4228 (lebih besar dari 0.05), maka H₀ diterima. Artinya, asumsi normalitas residual pada model ini terpenuhi.

4. Non-autokorelasi

H₀: Tidak terdapat autokorelasi dalam data (ρ = 0).

H₁: Terdapat autokorelasi dalam data (ρ ≠ 0).

durbinWatsonTest(reg.klasik)
##  lag Autocorrelation D-W Statistic p-value
##    1       0.1620539      1.608272   0.182
##  Alternative hypothesis: rho != 0

Berdasarkan hasil uji Durbin-Watson, nilai D-W sebesar 1.608272 dan p-value sebesar 0.198. Karena p-value > 0.05, maka hipotesis nol diterima. Maka, pada tingkat signifikansi 5%, tidak ada autokorelasi yang signifikan dalam data ini.

Residual Map OLS

map.resids <- cbind(Jabar, reg.klasik$residuals)  
names(map.resids)[12] <- "resids" 
qtm(map.resids, fill = "resids", title = "Residuals Map")

Matriks Pembobot Spasial

1. Rook Contiguity

ID<-c(1:27) 
#Rook
CoordK<-coordinates(Jabar)
W <- poly2nb(Jabar, row.names=ID,queen=FALSE)
W
## Neighbour list object:
## Number of regions: 27 
## Number of nonzero links: 106 
## Percentage nonzero weights: 14.54047 
## Average number of links: 3.925926
WB <- nb2mat(W, style='B', zero.policy = TRUE)
WB[c(1:5),c(1:5)]
##   [,1] [,2] [,3] [,4] [,5]
## 1    0    1    0    0    0
## 2    1    0    0    0    0
## 3    0    0    0    1    0
## 4    0    0    1    0    0
## 5    0    0    0    0    0
WL<-nb2listw(W)
WL
## 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=TRUE, col="gray90")
points(CoordK[,1], CoordK[,2], pch=19,cex=0.7,col="blue")
plot(W, CoordK, add=TRUE, col="red")

2. Queen Contiguity

#queen
WQ <- poly2nb(Jabar, row.names=ID,queen=TRUE)
WQ
## Neighbour list object:
## Number of regions: 27 
## Number of nonzero links: 106 
## Percentage nonzero weights: 14.54047 
## Average number of links: 3.925926
WBQ <- nb2mat(WQ, style='B', zero.policy = TRUE)
WBQ[c(1:5),c(1:5)]
##   [,1] [,2] [,3] [,4] [,5]
## 1    0    1    0    0    0
## 2    1    0    0    0    0
## 3    0    0    0    1    0
## 4    0    0    1    0    0
## 5    0    0    0    0    0
WLQ<-nb2listw(WQ)
WLQ
## 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=TRUE, col="gray95")
points(CoordK[,1], CoordK[,2], pch=19,cex=0.7,col="blue")
plot(WQ, CoordK, add=TRUE, col="red")

3. K-nearest neighbor (K = 5)

#K-nearest neighboars (K = 5)
WK1 <- knn2nb(knearneigh(CoordK, k =5), row.names = ID)
WK1
## Neighbour list object:
## Number of regions: 27 
## Number of nonzero links: 135 
## Percentage nonzero weights: 18.51852 
## Average number of links: 5 
## Non-symmetric neighbours list
WBK1 <- nb2mat(WK1, style='B', zero.policy = TRUE) #menyajikan dalam bentuk matrix biner "B" 
WBK1
##    [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## 1     0    1    0    0    0    1    0    1    0     0     1     0     0     0
## 2     1    0    0    0    0    1    0    0    0     0     1     0     0     0
## 3     0    0    0    1    0    0    0    0    0     1     0     0     1     0
## 4     0    0    1    0    0    0    0    0    0     0     0     0     1     1
## 5     0    0    0    0    0    0    0    0    0     0     0     1     0     0
## 6     1    1    0    0    0    0    0    0    0     0     0     0     0     0
## 7     0    0    0    0    1    0    0    0    1     0     0     0     0     0
## 8     1    0    0    0    0    0    0    0    0     0     1     0     0     0
## 9     0    0    0    0    0    0    1    0    0     0     0     0     0     0
## 10    0    0    1    0    0    0    0    0    0     0     0     0     1     0
## 11    1    1    0    0    0    0    0    0    0     0     0     0     0     0
## 12    0    0    0    0    1    0    0    0    0     0     0     0     0     0
## 13    0    0    1    1    0    0    0    0    0     1     0     0     0     1
## 14    0    0    0    1    0    0    0    0    0     0     0     0     1     0
## 15    1    1    0    0    0    0    0    0    0     0     1     0     0     0
## 16    0    0    0    0    1    0    1    0    1     0     0     0     0     0
## 17    0    0    1    1    0    0    0    0    0     0     0     0     1     1
## 18    0    1    0    1    0    1    0    0    0     0     0     0     0     1
## 19    0    0    0    0    1    0    0    1    0     0     0     1     0     0
## 20    0    0    0    0    1    0    1    0    0     0     0     1     0     0
## 21    0    0    0    0    0    0    1    0    1     0     0     0     0     0
## 22    0    0    0    0    1    0    0    0    0     0     0     1     0     0
## 23    0    1    0    0    0    0    0    0    0     1     1     0     0     0
## 24    0    0    0    0    0    0    0    0    1     1     0     0     0     0
## 25    0    0    0    1    0    1    0    0    0     0     0     0     0     1
## 26    0    0    0    0    0    0    0    0    1     0     1     0     0     0
## 27    0    0    0    0    1    0    0    1    0     0     0     1     0     0
##    [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
## 1      1     0     0     0     0     0     0     0     0     0     0     0
## 2      1     0     0     0     0     0     0     0     1     0     0     0
## 3      0     0     1     0     0     0     0     0     1     0     0     0
## 4      0     0     1     1     0     0     0     0     0     0     0     0
## 5      0     0     0     0     1     1     0     1     0     0     0     0
## 6      1     0     0     1     0     0     0     0     0     0     1     0
## 7      0     1     0     0     0     1     1     0     0     0     0     0
## 8      1     0     0     0     1     0     0     0     0     0     0     0
## 9      0     1     0     0     0     0     1     0     0     1     0     1
## 10     0     0     1     0     0     0     0     0     1     1     0     0
## 11     1     0     0     0     0     0     0     0     1     0     0     1
## 12     0     0     0     0     1     1     0     1     0     0     0     0
## 13     0     0     1     0     0     0     0     0     0     0     0     0
## 14     0     0     1     1     0     0     0     0     0     0     1     0
## 15     0     0     0     0     0     0     0     0     1     0     0     1
## 16     0     0     0     0     0     1     1     0     0     0     0     0
## 17     0     0     0     1     0     0     0     0     0     0     0     0
## 18     0     0     0     0     0     0     0     0     0     0     1     0
## 19     0     0     0     0     0     0     0     1     0     0     0     0
## 20     0     1     0     0     0     0     1     0     0     0     0     0
## 21     0     1     0     0     0     1     0     0     0     0     0     1
## 22     0     0     0     0     1     1     0     0     0     0     0     0
## 23     1     0     0     0     0     0     0     0     0     1     0     0
## 24     1     0     0     0     0     0     0     0     1     0     0     1
## 25     0     0     1     1     0     0     0     0     0     0     0     0
## 26     1     0     0     0     0     0     1     0     0     1     0     0
## 27     0     0     0     0     1     0     0     1     0     0     0     0
##    [,27]
## 1      0
## 2      0
## 3      0
## 4      0
## 5      1
## 6      0
## 7      0
## 8      1
## 9      0
## 10     0
## 11     0
## 12     1
## 13     0
## 14     0
## 15     0
## 16     0
## 17     0
## 18     0
## 19     1
## 20     0
## 21     0
## 22     1
## 23     0
## 24     0
## 25     0
## 26     0
## 27     0
## attr(,"call")
## nb2mat(neighbours = WK1, style = "B", zero.policy = TRUE)
WLK1<-nb2listw(WK1)
WLK1
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 27 
## Number of nonzero links: 135 
## Percentage nonzero weights: 18.51852 
## Average number of links: 5 
## Non-symmetric neighbours list
## 
## Weights style: W 
## Weights constants summary:
##    n  nn S0    S1     S2
## W 27 729 27 10.28 109.36
plot(Jabar, axes=TRUE, col="gray90")
points(CoordK[,1], CoordK[,2], pch=19,cex=0.7,col="blue")
plot(WK1, CoordK, add=TRUE, col="red")

4. K-nearest neighbor (K = 10)

#K-nearest neighbors (K = 10)
WK2 <- knn2nb(knearneigh(CoordK, k =10), row.names = ID)
## Warning in knearneigh(CoordK, k = 10): k greater than one-third of the number
## of data points
WK2
## Neighbour list object:
## Number of regions: 27 
## Number of nonzero links: 270 
## Percentage nonzero weights: 37.03704 
## Average number of links: 10 
## Non-symmetric neighbours list
WBK2 <- nb2mat(WK2, style='B', zero.policy = TRUE) #menyajikan dalam bentuk matrix biner "B" 
WBK2
##    [,1] [,2] [,3] [,4] [,5] [,6] [,7] [,8] [,9] [,10] [,11] [,12] [,13] [,14]
## 1     0    1    0    0    0    1    0    1    0     0     1     0     0     0
## 2     1    0    0    0    0    1    0    1    0     1     1     0     0     0
## 3     0    1    0    1    0    0    0    0    0     1     0     0     1     1
## 4     0    1    1    0    0    1    0    0    0     1     0     0     1     1
## 5     0    0    0    0    0    0    1    1    0     0     0     1     0     0
## 6     1    1    0    1    0    0    0    1    0     0     1     0     0     1
## 7     0    0    0    0    1    0    0    0    1     0     0     1     0     0
## 8     1    1    0    0    1    1    0    0    0     0     1     0     0     0
## 9     0    0    0    0    0    0    1    0    0     1     1     0     0     0
## 10    0    1    1    1    0    0    0    0    0     0     1     0     1     1
## 11    1    1    0    0    0    1    0    1    1     0     0     0     0     0
## 12    0    0    0    0    1    0    1    1    0     0     0     0     0     0
## 13    0    1    1    1    0    0    0    0    0     1     0     0     0     1
## 14    0    1    1    1    0    1    0    0    0     1     0     0     1     0
## 15    1    1    0    0    0    1    0    1    0     1     1     0     0     0
## 16    0    0    0    0    1    0    1    0    1     0     0     1     0     0
## 17    0    1    1    1    0    1    0    0    0     1     0     0     1     1
## 18    1    1    0    1    0    1    0    0    0     0     0     0     1     1
## 19    1    0    0    0    1    0    1    1    0     0     0     1     0     0
## 20    0    0    0    0    1    0    1    0    1     0     0     1     0     0
## 21    0    0    0    0    1    0    1    0    1     0     1     1     0     0
## 22    0    0    0    0    1    0    1    1    0     0     0     1     0     0
## 23    1    1    1    0    0    1    0    0    0     1     1     0     1     0
## 24    1    1    1    0    0    0    0    0    1     1     1     0     0     0
## 25    1    1    0    1    0    1    0    0    0     0     0     0     1     1
## 26    1    1    0    0    0    0    1    1    1     0     1     0     0     0
## 27    1    0    0    0    1    0    0    1    0     0     1     1     0     0
##    [,15] [,16] [,17] [,18] [,19] [,20] [,21] [,22] [,23] [,24] [,25] [,26]
## 1      1     0     0     0     1     0     0     0     1     1     0     1
## 2      1     0     0     1     0     0     0     0     1     1     0     1
## 3      1     0     1     1     0     0     0     0     1     1     0     0
## 4      0     0     1     1     0     0     0     0     1     0     1     0
## 5      0     1     0     0     1     1     1     1     0     0     0     1
## 6      1     0     0     1     0     0     0     0     1     0     1     0
## 7      0     1     0     0     1     1     1     0     0     1     0     1
## 8      1     0     0     0     1     0     1     0     0     0     0     1
## 9      1     1     0     0     0     1     1     0     1     1     0     1
## 10     1     0     1     0     0     0     0     0     1     1     0     0
## 11     1     0     0     0     0     0     1     0     1     1     0     1
## 12     0     1     0     0     1     1     1     1     0     0     0     1
## 13     1     0     1     1     0     0     0     0     1     1     0     0
## 14     0     0     1     1     0     0     0     0     1     0     1     0
## 15     0     0     0     1     0     0     0     0     1     1     0     1
## 16     0     0     0     0     1     1     1     0     0     1     0     1
## 17     0     0     0     1     0     0     0     0     1     0     1     0
## 18     1     0     1     0     0     0     0     0     1     0     1     0
## 19     0     0     0     0     0     1     1     1     0     0     0     1
## 20     0     1     0     0     1     0     1     1     0     0     0     1
## 21     0     1     0     0     1     1     0     0     0     1     0     1
## 22     0     1     0     0     1     1     1     0     0     0     0     1
## 23     1     0     0     0     0     0     0     0     0     1     0     1
## 24     1     0     0     0     0     0     1     0     1     0     0     1
## 25     1     0     1     1     0     0     0     0     1     0     0     0
## 26     1     1     0     0     0     0     1     0     0     1     0     0
## 27     0     0     0     0     1     1     1     1     0     0     0     1
##    [,27]
## 1      1
## 2      0
## 3      0
## 4      0
## 5      1
## 6      0
## 7      1
## 8      1
## 9      0
## 10     0
## 11     0
## 12     1
## 13     0
## 14     0
## 15     0
## 16     1
## 17     0
## 18     0
## 19     1
## 20     1
## 21     0
## 22     1
## 23     0
## 24     0
## 25     0
## 26     0
## 27     0
## attr(,"call")
## nb2mat(neighbours = WK2, style = "B", zero.policy = TRUE)
WLK2<-nb2listw(WK2)
WLK2
## Characteristics of weights list object:
## Neighbour list object:
## Number of regions: 27 
## Number of nonzero links: 270 
## Percentage nonzero weights: 37.03704 
## Average number of links: 10 
## Non-symmetric neighbours list
## 
## Weights style: W 
## Weights constants summary:
##    n  nn S0   S1     S2
## W 27 729 27 4.96 110.56
plot(Jabar, axes=TRUE, col="gray90")
points(CoordK[,1], CoordK[,2], pch=19,cex=0.7,col="blue")
plot(WK2, CoordK, add=TRUE, col="red")

Pemilihan Matriks Bobot

Uji Moran’s I

moran.test(data$TPT, WL) #cari moran's I statistics yg terbesar
## 
##  Moran I test under randomisation
## 
## data:  data$TPT  
## weights: WL    
## 
## Moran I statistic standard deviate = 4.1063, p-value = 2.01e-05
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##        0.52018962       -0.03846154        0.01850845
moran.test(data$TPT, WLQ)
## 
##  Moran I test under randomisation
## 
## data:  data$TPT  
## weights: WLQ    
## 
## Moran I statistic standard deviate = 4.1063, p-value = 2.01e-05
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##        0.52018962       -0.03846154        0.01850845
moran.test(data$TPT, WLK1) 
## 
##  Moran I test under randomisation
## 
## data:  data$TPT  
## weights: WLK1    
## 
## Moran I statistic standard deviate = 3.5272, p-value = 0.00021
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##        0.32538566       -0.03846154        0.01064076
moran.test(data$TPT, WLK2) 
## 
##  Moran I test under randomisation
## 
## data:  data$TPT  
## weights: WLK2    
## 
## Moran I statistic standard deviate = 4.5234, p-value = 3.043e-06
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##       0.234629952      -0.038461538       0.003644945

Nilai Moran’s Index terbesar menunjukkan matriks bobot optimum yaitu Rook Contiguity dan Queen Contiguity dengan nilai 0.52019. Pada taraf signifikansi 5% dapat disimpulkan bahwa terdapat autokorelasi spasial dan dipilih menggunakan bobot Queen Contiguity.

Moran Plot

moran.plot(data$TPT, WLQ)

Local Moran

locm<-localmoran(data$TPT,WLQ)
locm
##             Ii          E.Ii      Var.Ii        Z.Ii Pr(z != E(Ii))
## 1  -0.16391500 -0.0043290671 0.012635413 -1.41971079   0.1556918942
## 2   0.22807142 -0.0083359680 0.029759327  1.37040674   0.1705599686
## 3   0.53604370 -0.0276862953 0.222895649  1.19404404   0.2324607402
## 4   0.29913370 -0.0160961726 0.038484119  1.60689163   0.1080781432
## 5   1.87884772 -0.1311927503 0.410332365  3.13788422   0.0017017208
## 6   0.05219702 -0.0026811914 0.009626409  0.55932955   0.5759368329
## 7  -0.02985068 -0.0021024084 0.012462050 -0.24856565   0.8036967801
## 8  -0.03367645 -0.0002026349 0.001203407 -0.96493703   0.3345763519
## 9   0.10979951 -0.0051443094 0.030400002  0.65924799   0.5097365328
## 10  0.44397426 -0.0303791838 0.174970356  1.13401767   0.2567871357
## 11  0.49966524 -0.0263867090 0.212716931  1.14058486   0.2540427209
## 12  1.63382558 -0.0300991928 0.788217247  1.87417750   0.0609059640
## 13  0.16627284 -0.0049777032 0.041010224  0.84564073   0.3977531977
## 14  0.71834335 -0.0474236349 1.219715111  0.69337382   0.4880749891
## 15  0.53657577 -0.1085157946 0.801008168  0.72078027   0.4710447182
## 16  0.05584050 -0.0021939912 0.059107795  0.23870627   0.8113333531
## 17 -0.05475431 -0.0004551474 0.005896025 -0.70715310   0.4794713426
## 18  0.04573870 -0.0176355445 0.467762367  0.09266168   0.9261723423
## 19  0.56184578 -0.0039478035 0.050961550  2.50632109   0.0121994781
## 20 -1.22181256 -0.0518245262 0.406868806 -1.83423182   0.0666195893
## 21  0.66995134 -0.0917626151 0.300032055  1.39061875   0.1643410662
## 22  5.00589214 -0.3133893625 2.788687051  3.18532012   0.0014459396
## 23  0.13448115 -0.0027844887 0.012595271  1.22308902   0.2212960759
## 24  0.03110491 -0.0021024084 0.007552758  0.38210346   0.7023846256
## 25  0.03575660 -0.0001754818 0.001452734  0.94273419   0.3458168820
## 26  0.07433697 -0.0005904065 0.002124208  1.62570595   0.1040122244
## 27  1.83143054 -0.1060467471 0.341283004  3.31649456   0.0009115436
## attr(,"call")
## localmoran(x = data$TPT, listw = WLQ)
## attr(,"class")
## [1] "localmoran" "matrix"     "array"     
## attr(,"quadr")
##         mean    median     pysal
## 1   Low-High  Low-High  Low-High
## 2  High-High High-High High-High
## 3  High-High High-High High-High
## 4  High-High High-High High-High
## 5    Low-Low   Low-Low   Low-Low
## 6  High-High  High-Low High-High
## 7  High-High   Low-Low  High-Low
## 8   High-Low   Low-Low  High-Low
## 9    Low-Low   Low-Low   Low-Low
## 10 High-High High-High High-High
## 11 High-High High-High High-High
## 12   Low-Low   Low-Low   Low-Low
## 13 High-High High-High High-High
## 14 High-High High-High High-High
## 15 High-High High-High High-High
## 16 High-High High-High High-High
## 17  Low-High  Low-High  Low-High
## 18 High-High  High-Low High-High
## 19   Low-Low   Low-Low   Low-Low
## 20  High-Low  High-Low  High-Low
## 21   Low-Low   Low-Low   Low-Low
## 22   Low-Low   Low-Low   Low-Low
## 23 High-High High-High High-High
## 24 High-High   Low-Low High-High
## 25 High-High  Low-High High-High
## 26   Low-Low   Low-Low   Low-Low
## 27   Low-Low   Low-Low   Low-Low

Geographically Weighted Regression (GWR)

Model GWR dapat dituliskan sebagai berikut:

\[ y_i = \beta_0(u_i, v_i) + \sum_{k=1}^{p} \beta_k(u_i, v_i) x_{ik} + \varepsilon_i \]

dimana:

  • \(y_i\): nilai pengamatan variabel respon untuk lokasi ke-\(i\)
  • \(i\): 1, 2, 3, …, n
  • \(\beta_0(u_i, v_i)\): nilai intersep untuk lokasi pengamatan ke-\(i\)
  • \(\beta_k(u_i, v_i)\): nilai koefisien regresi variabel prediktor ke-\(k\) untuk lokasi pengamatan ke-\(i\)
  • \(x_{ik}\): variabel prediktor pengamatan ke-\(k\) untuk lokasi pengamatan ke-\(i\)
  • \(\varepsilon_i\): residual ke-\(i\) dengan asumsi IIDN \((0, \sigma^2)\)

Input data dan Koordinat

data
##    id         Kab.Kota   TPT   IPM PDRB   AKL   AKP
## 1   1          Bandung  6.52 73.74 4.97 84.44 49.19
## 2   2    Bandung Barat  8.11 69.61 5.00 87.72 45.55
## 3   3           Bekasi  8.87 75.76 5.32 87.51 42.05
## 4   4            Bogor  8.47 71.78 5.19 85.13 42.17
## 5   5           Ciamis  3.52 72.05 4.99 81.24 51.47
## 6   6          Cianjur  7.71 66.55 5.16 89.55 54.20
## 7   7          Cirebon  7.65 70.95 4.85 84.16 47.86
## 8   8            Garut  7.33 68.11 4.94 85.10 54.39
## 9   9        Indramayu  6.46 69.25 9.76 83.27 44.53
## 10 10         Karawang  8.95 72.35 5.40 86.17 40.28
## 11 11     Kota Bandung  8.83 83.04 5.07 83.22 50.73
## 12 12      Kota Banjar  5.43 73.08 4.63 84.21 50.74
## 13 13      Kota Bekasi  7.90 83.03 5.43 80.38 48.91
## 14 14       Kota Bogor  9.39 77.85 5.10 82.95 46.32
## 15 15      Kota Cimahi 10.52 79.46 5.19 83.65 53.07
## 16 16     Kota Cirebon  7.66 76.46 5.01 81.72 55.77
## 17 17       Kota Depok  6.97 82.38 5.05 78.46 46.99
## 18 18    Kota Sukabumi  8.53 76.32 5.12 81.38 43.80
## 19 19 Kota Tasikmalaya  6.55 74.47 5.96 80.63 49.94
## 20 20         Kuningan  9.49 70.72 5.25 81.90 41.65
## 21 21       Majalengka  4.12 69.13 6.15 84.83 52.24
## 22 22      Pangandaran  1.52 69.38 5.26 89.45 70.98
## 23 23       Purwakarta  7.72 72.09 4.97 85.62 46.68
## 24 24           Subang  7.65 70.70 4.64 86.94 53.27
## 25 25         Sukabumi  7.32 68.49 5.17 86.50 48.52
## 26 26         Sumedang  6.94 73.18 5.01 85.32 50.07
## 27 27      Tasikmalaya  3.89 67.76 4.69 84.04 52.39
coords <-coordinates(Jabar)
IDs <- data$Kab.Kota

Adaptive kernel model

adapt_bandwidth <- gwr.sel(
  TPT ~ IPM + PDRB + AKL +AKP,
  data = data,
  coords = coords,
  adapt = TRUE
)
## Adaptive q: 0.381966 CV score: 69.86987 
## Adaptive q: 0.618034 CV score: 70.606 
## Adaptive q: 0.236068 CV score: 75.41301 
## Adaptive q: 0.485514 CV score: 71.75225 
## Adaptive q: 0.3262379 CV score: 70.91737 
## Adaptive q: 0.4215178 CV score: 70.93739 
## Adaptive q: 0.3606798 CV score: 69.76789 
## Adaptive q: 0.3475242 CV score: 70.14534 
## Adaptive q: 0.3688588 CV score: 69.58027 
## Adaptive q: 0.3701906 CV score: 69.55275 
## Adaptive q: 0.3746884 CV score: 69.66537 
## Adaptive q: 0.3708427 CV score: 69.56158 
## Adaptive q: 0.3701241 CV score: 69.55411 
## Adaptive q: 0.3703732 CV score: 69.54917 
## Adaptive q: 0.3705525 CV score: 69.5539 
## Adaptive q: 0.3703325 CV score: 69.54987 
## Adaptive q: 0.3704417 CV score: 69.55098 
## Adaptive q: 0.3703732 CV score: 69.54917
adapt_bandwidth
## [1] 0.3703732
gwr.model1 <- gwr(
  TPT ~ IPM + PDRB + AKL +AKP,
  data = data,
  adapt=adapt_bandwidth,
  coords = coords,
  hatmatrix=TRUE,
  se.fit=TRUE); gwr.model1
## Call:
## gwr(formula = TPT ~ IPM + PDRB + AKL + AKP, data = data, coords = coords, 
##     adapt = adapt_bandwidth, hatmatrix = TRUE, se.fit = TRUE)
## Kernel function: gwr.Gauss 
## Adaptive quantile: 0.3703732 (about 10 of 27 data points)
## Summary of GWR coefficient estimates at data points:
##                    Min.    1st Qu.     Median    3rd Qu.       Max.   Global
## X.Intercept. -34.560939 -30.391386 -28.677660 -27.056699 -20.735722 -21.2644
## IPM            0.200885   0.230543   0.256964   0.282130   0.318295   0.2266
## PDRB          -0.192684  -0.140005  -0.125886  -0.118173  -0.087122  -0.1792
## AKL            0.250369   0.306008   0.317058   0.341156   0.362244   0.2820
## AKP           -0.283145  -0.246768  -0.176172  -0.107930  -0.085052  -0.2220
## Number of data points: 27 
## Effective number of parameters (residual: 2traceS - traceS'S): 9.61676 
## Effective degrees of freedom (residual: 2traceS - traceS'S): 17.38324 
## Sigma (residual: 2traceS - traceS'S): 1.321621 
## Effective number of parameters (model: traceS): 7.9297 
## Effective degrees of freedom (model: traceS): 19.0703 
## Sigma (model: traceS): 1.261809 
## Sigma (ML): 1.060451 
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 108.0403 
## AIC (GWR p. 96, eq. 4.22): 87.72185 
## Residual sum of squares: 30.36299 
## Quasi-global R2: 0.714572

Fixed kernel model

Gaussian

bw1 <- gwr.sel(
  TPT ~ IPM + PDRB + AKL +AKP,
  data = data,
  coords = coords
)
## Bandwidth: 0.8934582 CV score: 67.53115 
## Bandwidth: 1.444202 CV score: 69.64634 
## Bandwidth: 0.5530796 CV score: 83.57212 
## Bandwidth: 1.135256 CV score: 68.14304 
## Bandwidth: 0.7634451 CV score: 69.10512 
## Bandwidth: 0.9822153 CV score: 67.51423 
## Bandwidth: 0.9431972 CV score: 67.46217 
## Bandwidth: 0.9409457 CV score: 67.4616 
## Bandwidth: 0.9372478 CV score: 67.46133 
## Bandwidth: 0.9378687 CV score: 67.46131 
## Bandwidth: 0.9379094 CV score: 67.46131 
## Bandwidth: 0.937828 CV score: 67.46131 
## Bandwidth: 0.9378687 CV score: 67.46131
bw1
## [1] 0.9378687
gwr.model2 <- gwr(
  TPT ~ IPM + PDRB + AKL +AKP,
  data = data,
  coords = coords,
  bandwidth = bw1,
  hatmatrix=TRUE,
  se.fit=TRUE); gwr.model2
## Call:
## gwr(formula = TPT ~ IPM + PDRB + AKL + AKP, data = data, coords = coords, 
##     bandwidth = bw1, hatmatrix = TRUE, se.fit = TRUE)
## Kernel function: gwr.Gauss 
## Fixed bandwidth: 0.9378687 
## Summary of GWR coefficient estimates at data points:
##                   Min.   1st Qu.    Median   3rd Qu.      Max.   Global
## X.Intercept. -30.47557 -27.41833 -26.59378 -24.57539 -20.94901 -21.2644
## IPM            0.21334   0.23127   0.24406   0.26951   0.28887   0.2266
## PDRB          -0.18881  -0.16276  -0.15057  -0.14289  -0.11896  -0.1792
## AKL            0.25607   0.29369   0.31109   0.32248   0.34098   0.2820
## AKP           -0.27155  -0.24284  -0.19781  -0.14900  -0.12382  -0.2220
## Number of data points: 27 
## Effective number of parameters (residual: 2traceS - traceS'S): 8.09745 
## Effective degrees of freedom (residual: 2traceS - traceS'S): 18.90255 
## Sigma (residual: 2traceS - traceS'S): 1.339202 
## Effective number of parameters (model: traceS): 6.875782 
## Effective degrees of freedom (model: traceS): 20.12422 
## Sigma (model: traceS): 1.297917 
## Sigma (ML): 1.120532 
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 106.2335 
## AIC (GWR p. 96, eq. 4.22): 89.64388 
## Residual sum of squares: 33.90101 
## Quasi-global R2: 0.6813127

Bi-Square

bw2 <- gwr.sel(
  TPT ~ IPM + PDRB + AKL +AKP,
  data = data,
  coords = coords, gweight=gwr.bisquare)
## Bandwidth: 0.8934582 CV score: 184.0023 
## Bandwidth: 1.444202 CV score: 78.39867 
## Bandwidth: 1.784581 CV score: 67.27599 
## Bandwidth: 1.705922 CV score: 68.47788 
## Bandwidth: 1.860181 CV score: 66.48881 
## Bandwidth: 2.04167 CV score: 65.47784 
## Bandwidth: 2.098811 CV score: 65.38911 
## Bandwidth: 2.116352 CV score: 65.37876 
## Bandwidth: 2.130473 CV score: 65.37904 
## Bandwidth: 2.122896 CV score: 65.37794 
## Bandwidth: 2.122855 CV score: 65.37794 
## Bandwidth: 2.122814 CV score: 65.37794 
## Bandwidth: 2.122855 CV score: 65.37794
bw2
## [1] 2.122855
gwr.model3<- gwr(
  TPT ~ IPM + PDRB + AKL +AKP,
  data = data,
  coords = coords,
  bandwidth = bw2,
  gweight=gwr.bisquare,
  hatmatrix=TRUE,
  se.fit=TRUE); gwr.model3
## Call:
## gwr(formula = TPT ~ IPM + PDRB + AKL + AKP, data = data, coords = coords, 
##     bandwidth = bw2, gweight = gwr.bisquare, hatmatrix = TRUE, 
##     se.fit = TRUE)
## Kernel function: gwr.bisquare 
## Fixed bandwidth: 2.122855 
## Summary of GWR coefficient estimates at data points:
##                    Min.    1st Qu.     Median    3rd Qu.       Max.   Global
## X.Intercept. -35.107283 -30.682531 -27.083049 -25.024748 -21.026742 -21.2644
## IPM            0.216558   0.233045   0.242948   0.280346   0.313386   0.2266
## PDRB          -0.186080  -0.162974  -0.149171  -0.117960  -0.083340  -0.1792
## AKL            0.253690   0.296901   0.315653   0.334371   0.362301   0.2820
## AKP           -0.281829  -0.244398  -0.199758  -0.126626  -0.077945  -0.2220
## Number of data points: 27 
## Effective number of parameters (residual: 2traceS - traceS'S): 8.001356 
## Effective degrees of freedom (residual: 2traceS - traceS'S): 18.99864 
## Sigma (residual: 2traceS - traceS'S): 1.337321 
## Effective number of parameters (model: traceS): 6.922427 
## Effective degrees of freedom (model: traceS): 20.07757 
## Sigma (model: traceS): 1.300892 
## Sigma (ML): 1.121799 
## AICc (GWR p. 61, eq 2.33; p. 96, eq. 4.21): 106.4944 
## AIC (GWR p. 96, eq. 4.22): 89.75152 
## Residual sum of squares: 33.97768 
## Quasi-global R2: 0.680592
#Model 1
results1<- as.data.frame(gwr.model1$SDF)
head(results1)
##      sum.w X.Intercept.       IPM        PDRB       AKL         AKP
## 1 14.91370    -31.79006 0.2652275 -0.11932873 0.3472575 -0.18110885
## 2 14.70551    -34.12849 0.2544298 -0.09572155 0.3524440 -0.12782430
## 3 13.09797    -28.19920 0.2089554 -0.13517839 0.3116981 -0.10580063
## 4 11.66202    -28.81941 0.2024857 -0.13842613 0.3170584 -0.09009021
## 5 11.45842    -28.90345 0.3162243 -0.11469093 0.3279024 -0.28314499
## 6 13.06453    -34.56094 0.2504171 -0.08712250 0.3622436 -0.12994557
##   X.Intercept._se     IPM_se   PDRB_se    AKL_se     AKP_se       gwr.e
## 1        15.42016 0.07595524 0.2790604 0.1300923 0.04719420 -1.06842090
## 2        16.63531 0.07686523 0.2867093 0.1352138 0.05490646 -0.08775675
## 3        19.60242 0.08585216 0.3019557 0.1583302 0.06314502 -0.86990094
## 4        22.16402 0.09544886 0.3294658 0.1750651 0.07003825  0.28134868
## 5        17.25039 0.08685466 0.2914309 0.1648662 0.05673062 -1.85351337
## 6        17.44515 0.07797736 0.2940394 0.1420937 0.05632995  0.65936382
##       pred   pred.se   localR2 X.Intercept._se_EDF IPM_se_EDF PDRB_se_EDF
## 1 7.588421 0.2822817 0.6293130            16.15110 0.07955567   0.2922884
## 2 8.197757 0.5047529 0.5650151            17.42386 0.08050880   0.3002999
## 3 9.739901 0.7840267 0.5328313            20.53161 0.08992172   0.3162690
## 4 8.188651 0.5589340 0.4356227            23.21464 0.09997333   0.3450832
## 5 5.373513 0.6355264 0.7031706            18.06809 0.09097175   0.3052453
## 6 7.050636 0.6610117 0.5494478            18.27209 0.08167364   0.3079774
##   AKL_se_EDF AKP_se_EDF pred.se.1  coord.x   coord.y
## 1  0.1362589 0.04943130 0.2956624 107.6087 -7.097588
## 2  0.1416232 0.05750914 0.5286792 107.4150 -6.890438
## 3  0.1658354 0.06613822 0.8211912 107.1217 -6.219747
## 4  0.1833635 0.07335820 0.5854286 106.7682 -6.561007
## 5  0.1726812 0.05941976 0.6656516 108.4286 -7.290250
## 6  0.1488292 0.05900011 0.6923450 107.1592 -7.130889

Map the local R2

gwr.map <- cbind(Jabar, as.matrix(results1))
qtm(gwr.map, fill = "localR2") 

Peta Sebaran Residual GWR

resid_gwr1 <- results1$gwr.e 
Jabar$resid_gwr1 <- resid_gwr1
spplot(Jabar,zcol="resid_gwr1",main="Peta Sebaran Residual Model GWR") 

Uji Asumsi Residual Spasial

1. Uji Normalitas

H₀: Residual model GWR berdistribusi normal.

H₁: Residual model GWR tidak berdistribusi normal.

shapiro.test(resid_gwr1)
## 
##  Shapiro-Wilk normality test
## 
## data:  resid_gwr1
## W = 0.9747, p-value = 0.7283

Dengan p-value sebesar 0.7283 (lebih besar dari 0.05), maka H₀ diterima. Artinya, asumsi normalitas residual pada model ini terpenuhi.

2. Uji Heteroskedastisitas

H₀: Tidak ada heteroskedastisitas dalam model GWR (varian residual konstan)

H₁: Terdapat heteroskedastisitas dalam model GWR (varian residual tidak konstan).

bptest(gwr.model1$lm, weights = gwr.model1$gweight)
## 
##  studentized Breusch-Pagan test
## 
## data:  gwr.model1$lm
## BP = 4.727, df = 4, p-value = 0.3165

Dengan p-value sebesar 0.3165 (lebih besar dari 0.05), maka H₀ diterima. Artinya, model ini memenuhi asumsi homoskedastisitas, atau varian residualnya dianggap konstan.

3. Uji Autokorelasi Spasial

H₀: Tidak ada autokorelasi spasial pada residual (Moran’s I = 0).

H₁: Terdapat autokorelasi spasial positif pada residual (Moran’s I > 0).

moran.test(resid_gwr1, WLQ)
## 
##  Moran I test under randomisation
## 
## data:  resid_gwr1  
## weights: WLQ    
## 
## Moran I statistic standard deviate = 0.68171, p-value = 0.2477
## alternative hypothesis: greater
## sample estimates:
## Moran I statistic       Expectation          Variance 
##        0.05694306       -0.03846154        0.01958593

Dengan p-value sebesar 0.2477 > 0.05 maka hipotesis nol diterima. Aertinya, tidak terdapat autokorelasi spasial yang signifikan pada residual.

Uji Signifikansi Parameter Model GWR

LMZ.F3GWR.test(gwr.model1) 
## 
## Leung et al. (2000) F(3) test
## 
##             F statistic Numerator d.f. Denominator d.f.    Pr(>)   
## (Intercept)    0.166935       9.355354            19.96 0.996088   
## IPM            0.885376       8.986335            19.96 0.554166   
## PDRB           0.091613      15.846289            19.96 0.999993   
## AKL            0.163171       8.898762            19.96 0.995648   
## AKP            4.429248      12.592863            19.96 0.001583 **
## ---
## Signif. codes:  0 '***' 0.001 '**' 0.01 '*' 0.05 '.' 0.1 ' ' 1

Mengekstrak koefisien ke data frame

data$coefx1<-results1$IPM
data$coefx2<-results1$PDRB
data$coefx3<-results1$AKL
data$coefx4<-results1$AKP

Peta sebaran spasial untuk masing-masing variabel

Indeks Pembangunan Manusia (x1)

PDRB (x2)

map2 <- tm_shape(gwr.map) +  
  tm_fill("PDRB", 
          n = 5, 
          style = "quantile", 
          title = "PDRB Coefficient")  + 
  tm_borders(col = "black", lwd = 0.5)+ 
  tm_layout(frame = FALSE, 
            legend.text.size = 0.5, 
            legend.title.size = 0.6) 
map2

Partisipasi Angkatan Kerja Laki-laki (x3)

map3 <- tm_shape(gwr.map) +  
  tm_fill("AKL", 
          n = 5, 
          style = "quantile", 
          title = "AKL Coefficient")  + 
  tm_borders(col = "black", lwd = 0.5)+ 
  tm_layout(frame = FALSE, 
            legend.text.size = 0.5, 
            legend.title.size = 0.6) 
map3

Partisipasi Angkatan Kerja Perempuan (x4)

map4 <- tm_shape(gwr.map) +  
  tm_fill("AKP", 
          n = 5, 
          style = "quantile", 
          title = "AKP Coefficient")  + 
  tm_borders(col = "black", lwd = 0.5)+ 
  tm_layout(frame = FALSE, 
            legend.text.size = 0.5, 
            legend.title.size = 0.6) 
map4

Uji Parsial Signifikansi Model

t1 = gwr.model1$SDF$IPM / gwr.model1$SDF$IPM_se 
t2 = gwr.model1$SDF$PDRB / gwr.model1$SDF$PDRB_se 
t3 = gwr.model1$SDF$AKL/ gwr.model1$SDF$AKL_se 
t4 = gwr.model1$SDF$AKP / gwr.model1$SDF$AKP_se
pvalue1 = 2*pt(q=t1, df=26, lower.tail=FALSE) 
pvalue2 = 2*pt(q=t2, df=26, lower.tail=FALSE) 
pvalue3 = 2*pt(q=t3, df=26, lower.tail=FALSE) 
pvalue4 = 2*pt(q=t4, df=26, lower.tail=FALSE) 
#Variabel x1: Indeks Pembangunan Manusia
data.frame(IDs, t1, pvalue1) %>% mutate(ket=ifelse(pvalue1<0.05,"Reject", "Not 
Reject")) 
##                 IDs       t1      pvalue1    ket
## 1           Bandung 3.491891 0.0017315042 Reject
## 2     Bandung Barat 3.310077 0.0027386562 Reject
## 3            Bekasi 2.433898 0.0221136982 Reject
## 4             Bogor 2.121405 0.0435812852 Reject
## 5            Ciamis 3.640844 0.0011840297 Reject
## 6           Cianjur 3.211408 0.0035022422 Reject
## 7           Cirebon 3.662318 0.0011205714 Reject
## 8             Garut 3.525322 0.0015904454 Reject
## 9         Indramayu 3.429173 0.0020296624 Reject
## 10         Karawang 2.637890 0.0138994952 Reject
## 11     Kota Bandung 3.485236 0.0017610036 Reject
## 12      Kota Banjar 3.680159 0.0010703872 Reject
## 13      Kota Bekasi 2.427916 0.0224114853 Reject
## 14       Kota Bogor 2.056758 0.0498729743 Reject
## 15      Kota Cimahi 3.421785 0.0020679065 Reject
## 16     Kota Cirebon 3.661408 0.0011231918 Reject
## 17       Kota Depok 2.287900 0.0305216621 Reject
## 18    Kota Sukabumi 2.737219 0.0110264838 Reject
## 19 Kota Tasikmalaya 3.620774 0.0012465046 Reject
## 20         Kuningan 3.756747 0.0008788125 Reject
## 21       Majalengka 3.681010 0.0010680487 Reject
## 22      Pangandaran 3.645116 0.0011711298 Reject
## 23       Purwakarta 2.993447 0.0059798055 Reject
## 24           Subang 3.273518 0.0030006922 Reject
## 25         Sukabumi 2.943664 0.0067450668 Reject
## 26         Sumedang 3.560112 0.0014555394 Reject
## 27      Tasikmalaya 3.585444 0.0013643890 Reject

Berdasarkan hasil di atas, variabel IPM mempengaruhi tingkat pengangguran terbuka di semua Kabupaten/Kota di Provinsi Jawa Barat.

#Variabel x2: PDRB
data.frame(IDs, t2, pvalue2) %>% mutate(ket=ifelse(pvalue2<0.05,"Reject", "Not Reject"))
##                 IDs         t2  pvalue2        ket
## 1           Bandung -0.4276089 1.327543 Not Reject
## 2     Bandung Barat -0.3338627 1.258839 Not Reject
## 3            Bekasi -0.4476762 1.341905 Not Reject
## 4             Bogor -0.4201532 1.322174 Not Reject
## 5            Ciamis -0.3935442 1.302874 Not Reject
## 6           Cianjur -0.2962953 1.230642 Not Reject
## 7           Cirebon -0.6822338 1.498876 Not Reject
## 8             Garut -0.4451152 1.340080 Not Reject
## 9         Indramayu -0.6863225 1.501415 Not Reject
## 10         Karawang -0.4217554 1.323330 Not Reject
## 11     Kota Bandung -0.4858999 1.368892 Not Reject
## 12      Kota Banjar -0.4390476 1.335746 Not Reject
## 13      Kota Bekasi -0.4595293 1.350327 Not Reject
## 14       Kota Bogor -0.4027320 1.309562 Not Reject
## 15      Kota Cimahi -0.4063599 1.312196 Not Reject
## 16     Kota Cirebon -0.6831806 1.499464 Not Reject
## 17       Kota Depok -0.4509020 1.344202 Not Reject
## 18    Kota Sukabumi -0.3326264 1.257917 Not Reject
## 19 Kota Tasikmalaya -0.4321599 1.330812 Not Reject
## 20         Kuningan -0.5919994 1.441036 Not Reject
## 21       Majalengka -0.6889064 1.503016 Not Reject
## 22      Pangandaran -0.4386705 1.335476 Not Reject
## 23       Purwakarta -0.3042425 1.236635 Not Reject
## 24           Subang -0.4803055 1.364973 Not Reject
## 25         Sukabumi -0.4240286 1.324967 Not Reject
## 26         Sumedang -0.6069925 1.450880 Not Reject
## 27      Tasikmalaya -0.4052617 1.311399 Not Reject

Berdasarkan hasil di atas, variabel PDRB tidak mempengaruhi tingkat pengangguran terbuka di semua Kabupaten/Kota di Provinsi Jawa Barat.

#Variabel x3: Angka Partisipasi Kerja Laki-Laki
data.frame(IDs, t3, pvalue3) %>% mutate(ket=ifelse(pvalue3<0.05,"Reject", "Not Reject")) 
##                 IDs       t3    pvalue3        ket
## 1           Bandung 2.669317 0.01292235     Reject
## 2     Bandung Barat 2.606569 0.01494165     Reject
## 3            Bekasi 1.968658 0.05973923 Not Reject
## 4             Bogor 1.811088 0.08169709 Not Reject
## 5            Ciamis 1.988900 0.05733178 Not Reject
## 6           Cianjur 2.549329 0.01703658     Reject
## 7           Cirebon 1.855665 0.07487163 Not Reject
## 8             Garut 2.580551 0.01586226     Reject
## 9         Indramayu 1.984312 0.05786982 Not Reject
## 10         Karawang 2.072526 0.04826818     Reject
## 11     Kota Bandung 2.609409 0.01484421     Reject
## 12      Kota Banjar 2.085011 0.04703014     Reject
## 13      Kota Bekasi 1.981347 0.05821992 Not Reject
## 14       Kota Bogor 1.763752 0.08952317 Not Reject
## 15      Kota Cimahi 2.645644 0.01365217     Reject
## 16     Kota Cirebon 1.852094 0.07539974 Not Reject
## 17       Kota Depok 1.911711 0.06699403 Not Reject
## 18    Kota Sukabumi 2.206843 0.03635770     Reject
## 19 Kota Tasikmalaya 2.252736 0.03294034     Reject
## 20         Kuningan 1.756884 0.09071016 Not Reject
## 21       Majalengka 1.832126 0.07841198 Not Reject
## 22      Pangandaran 2.284436 0.03075251     Reject
## 23       Purwakarta 2.351892 0.02653036     Reject
## 24           Subang 2.347990 0.02675937     Reject
## 25         Sukabumi 2.401916 0.02374898     Reject
## 26         Sumedang 2.146264 0.04135724     Reject
## 27      Tasikmalaya 2.386576 0.02457209     Reject

Berdasarkan hasil di atas, variabel AKL mempengaruhi tingkat pengangguran terbuka di Bandung, Bandung Barat, Cianjur, Garut, Karawang, Kota Bandung, Kota Banjar, Kota Cimahi, Kota Sukabumi, Kota Tasilmalaya, Pangandaran, Purwakarta, Subang, Sukabumi Sumedang, Tasikmalaya.

#Variabel x4: Angka Partisipasi Kerja Perempuan
data.frame(IDs, t4, pvalue4) %>% mutate(ket=ifelse(pvalue4<0.05,"Reject", "Not Reject")) 
##                 IDs        t4  pvalue4        ket
## 1           Bandung -3.837524 1.999287 Not Reject
## 2     Bandung Barat -2.328037 1.972041 Not Reject
## 3            Bekasi -1.675518 1.894180 Not Reject
## 4             Bogor -1.286300 1.790325 Not Reject
## 5            Ciamis -4.991043 1.999966 Not Reject
## 6           Cianjur -2.306864 1.970715 Not Reject
## 7           Cirebon -5.153395 1.999978 Not Reject
## 8             Garut -5.000268 1.999966 Not Reject
## 9         Indramayu -4.523519 1.999882 Not Reject
## 10         Karawang -1.723525 1.903332 Not Reject
## 11     Kota Bandung -3.768316 1.999147 Not Reject
## 12      Kota Banjar -5.215819 1.999981 Not Reject
## 13      Kota Bekasi -1.732170 1.904907 Not Reject
## 14       Kota Bogor -1.184781 1.753179 Not Reject
## 15      Kota Cimahi -2.987144 1.993928 Not Reject
## 16     Kota Cirebon -5.150024 1.999977 Not Reject
## 17       Kota Depok -1.554959 1.867954 Not Reject
## 18    Kota Sukabumi -1.613200 1.881226 Not Reject
## 19 Kota Tasikmalaya -5.241524 1.999982 Not Reject
## 20         Kuningan -4.946245 1.999961 Not Reject
## 21       Majalengka -4.889773 1.999955 Not Reject
## 22      Pangandaran -5.423160 1.999989 Not Reject
## 23       Purwakarta -1.572978 1.872185 Not Reject
## 24           Subang -2.716701 1.988430 Not Reject
## 25         Sukabumi -2.441026 1.978236 Not Reject
## 26         Sumedang -4.291907 1.999782 Not Reject
## 27      Tasikmalaya -5.332270 1.999986 Not Reject

Berdasarkan hasil di atas, variabel AKP tidak mempengaruhi tingkat pengangguran terbuka di semua Kabupaten/Kota di Provinsi Jawa Barat.

Evaluasi Model

data.frame("MODEL" = c("GWR","OLS"), 
          "AIC" = c(gwr.model1$results$AICh,AIC(reg.klasik)), 
          "R2" = c(0.7145,0.521))%>% arrange(AIC) 
##   MODEL       AIC     R2
## 1   GWR  87.72185 0.7145
## 2   OLS 101.25967 0.5210

Berdasarkan nilai AIC dan R2 dapat disimpulkan bahwa model GWR lebih baik memodelkan data daripada dengan OLS karena model GWR memiliki nilai AIC yang lebih kecil dan R2 yang lebih besar.