Notes Theme, silakan gunakan salah satu theme berikut: - cayman (package prettydoc) - architect (package prettydoc) - united (default di RMarkdown)
Library:
> # install.packages("knitr")
> # install.packages("rmarkdown")
> # install.packages("prettydoc")
> # install.packages("equatiomatic")
Kualitas lingkungan hidup merupakan indikator krusial untuk menggambarkan situasi ekologis dan keberlanjutan pembangunan di Indonesia. Setiap provinsi memiliki ciri khas lingkungan yang unik, yang dipengaruhi oleh kegiatan industri, pemanfaatan lahan, dan dinamika pembangunan. Variasi dalam nilai Indeks Kualitas Udara (X1), Indeks Kualitas Air (X2), Indeks Kualitas Tutupan Lahan (X3), dan Indeks Kualitas Lahan (X4) menunjukkan ketidakmerataan kondisi lingkungan di antara provinsi, sehingga analisis diperlukan untuk memahami pola dan kesamaan kondisi lingkungan di berbagai daerah di Indonesia.
Metode Multidimensional Scaling (MDS) memungkinkan untuk memvisualisasikan hubungan antarprovinsi berdasarkan kesamaan keempat indeks tersebut. Dengan mentransformasikan data multivariat menjadi peta dua atau tiga dimensi, MDS memfasilitasi pengelompokan provinsi yang memiliki kondisi lingkungan serupa serta mengidentifikasi provinsi dengan perbedaan yang signifikan. Hasil dari pemetaan ini dapat memberikan pemahaman yang lebih jelas tentang provinsi-propinsi yang membutuhkan perhatian khusus dalam pengelolaan lingkungan, sehingga dapat mendukung penyusunan kebijakan yang lebih tepat dan berkelanjutan di tahun 2023.
Bagaimana pola pengelompokkan 38 Provinsi di Indonesia berdasarkan kualitas lingkungan hidup yang tersedia pada tahun 2023 dengan analisis MDS?
Memetakan pola pengelompokan 38 Provinsi di Indonesia berdasarkan kualitas lingkungan hidup menggunakan pendekatan MDS.
Multidimensional Scaling (MDS) adalah teknik analisis multivariat yang bertujuan untuk memvisualisasikan pola yang menunjukkan kemiripan atau ketidaksamaan antar objek yang terletak di ruang berdimensi rendah, seperti dua atau tiga dimensi. Dengan cara mentransformasikan informasi jarak dari data yang ada menjadi representasi ruang, MDS memberikan kesempatan bagi peneliti untuk mengenali pola, kelompok, atau perbedaan antara objek secara visual dan dengan cara yang lebih mudah dipahami (Johnson & Wichern, 2007).
Secara umum, MDS terbagi menjadi dua kategori, yaitu MDS metrik dan MDS non-metrik. MDS metrik diterapkan ketika data berskala interval atau rasio dan memberikan informasi jarak yang tepat, contohnya jarak Euclidean. Dalam jenis ini, konfigurasi titik pada ruang berdimensi rendah dioptimalkan sedemikian rupa sehingga jarak antar objek pada hasil MDS sedekat mungkin dengan jarak yang sebenarnya dalam data. Oleh karena itu, MDS metrik mengutamakan kesesuaian antara nilai jarak absolut dari data asli dan hasil pemetaan.
Sebaliknya, MDS non-metrik digunakan ketika data hanya memberikan informasi mengenai urutan atau tingkat kesamaan di antara objek, yang biasanya berukuran ordinal. Dalam pendekatan ini, yang dipertahankan bukan nilai jarak absolutnya, melainkan peringkat hubungan di antara objek. MDS non-metrik memiliki fleksibilitas yang lebih tinggi karena dapat memproses data yang tidak memiliki ukuran jarak yang jelas, dan hanya membutuhkan informasi peringkat untuk menghasilkan konfigurasi yang tetap mencerminkan struktur kesamaan di antara objek (Johnson & Wichern, 2007).
Langkah pertama dalam analisi MDS adalah menyusun matriks jarak atau matriks D. Jika data berupa variabel kuantitatif, salah satu ukuran jarak yang umum adalah Jarak Euclidean:
dist(x, y) = \[\ \sqrt{\sum_{i=1}^{n}{(x_{i\ }-\ y_i)}^2}\]
Selanjutnya hitung matriks D² dengan elemen \(\ d_{ij}^2\)  yang meliputi  \({\bar{d}}_{i.}^2\ \), \(\ {\bar{d}}_{.j}^2\ \), \(\ {\bar{d}}_{..}^2\)  :
\[ \overline{d_{i\cdot}^2} = \frac{1}{n} \sum_j d_{ij}^2 \]
\[ \overline{d_{\cdot j}^2} = \frac{1}{n} \sum_i d_{ij}^2 \]
\[ \overline{d_{\cdot\cdot}^2} = \frac{1}{n^2} \sum_i \sum_j d_{ij}^2 \]
Setelah mendapatkan seluruh komponen untuk membuat matriks D² lalu sekarang menentukan matriks B. Elemen pada matriks dapat dihitung menggunakan rumus berikut :
\[ b_{ij} = -\frac{1}{2} \left( d_{ij}^2 - \overline{d_{i\cdot}^2} - \overline{d_{\cdot j}^2} + \overline{d_{\cdot\cdot}^2} \right) \]
Keterangan:
- \(d_{ij}^2\): Elemen dari matriks
jarak kuadrat.
\(\overline{d_{i\cdot}^2}\): Rata-rata jarak kuadrat pada baris ke-\(i\).
\(\overline{d_{\cdot j}^2}\): Rata-rata jarak kuadrat pada kolom ke-\(j\).
\(\overline{d_{\cdot\cdot}^2}\): Rata-rata total jarak kuadrat.
Setelah mendapatkan matriks korelasi atau kovarian, dilakukan
perhitungan nilai eigen dan vektor eigen melalui persamaan :
\[
\det(B - \lambda I) = 0
\] Kemudian nilai eigen diurutkan dari terbesar hingga terkecil,
dan dihitung proporsi varians masing-masing dengan menggunakan rumus
berikut:
\[\frac{\lambda_i}{\sum_{j=1}^{p} \lambda_j}\]
Selanjutnya, proporsi varians tersebut dikumulatifkan untuk menentukan jumlah dimensi yang layak digunakan. Umumnya, dimensi dipilih apabila akumulasi varians nilai eigen mencapai lebih dari 80%.
Koordinat suatu objek dalam MDS diperoleh melalui langkah dekomposisi
eigen pada matriks yang menggambarkan jarak. Dalam penerapan tiga
dimensi, tiga nilai eigen terbesar beserta vektor eigen yang relevan
dipakai untuk menentukan posisi masing-masing objek. Rumus untuk
menghitung koordinat objek adalah:
\[F = \tilde{E}\,\Lambda^{1/2}\]
adalah matriks yang menunjukkan jarak antar objek berdasarkan koordinat objek pada matriks konfigurasi (F). Jarak yang digunakan umumnya adalah jarak Euclidean karena menggambarkan kedekatan antar titik secara geometris.
Nilai STRESS digunakan mengukur seberapa baik hasil pemetaan MDS (Multidimensional Scaling) dalam merepresentasikan jarak sebenarnya antar objek.
\[ STRESSY = \sqrt{ \frac{ \sum_i \sum_k \left( d^{(q)}_{ik} - \hat{d}^{(q)}_{ik} \right)^2 }{ \sum_i \sum_k \left( d^{(q)}_{ik} \right)^2 } } \]
Jika nilai stres rendah, itu menunjukkan bahwa pemetaan dilakukan dengan baik karena jarak antar elemen pada peta hampir menyerupai jarak yang sebenarnya. Di sisi lain, jika nilai stres tinggi, maka pemetaan tersebut dianggap kurang memuaskan dan tidak tepat dalam menggambarkan jarak yang sesungguhnya antara elemen-elemen.
Tabel berikut merupakan kriteria Goodness-Of-Fit berupa STRESS dapat dijelaskan:
| Nilai Stress (%) | Kriteria |
|---|---|
| > 20 | Poor (Buruk) |
| 10 – 20 | Fair (Cukup) |
| 5,1 – 10 | Good (Baik) |
| 2,5 – 5 | Excellent (Sangat Baik) |
| < 2,5 | Perfect (Sempurna) |
Hasil dari pemetaan MDS umumnya disajikan dalam format dua dimensi dengan memanfaatkan dua komponen utama dari koordinat objek (F), yaitu kolom pertama dan kedua. Komponen-komponen ini mencerminkan dimensi dengan pengaruh terbesar dalam menjelaskan perbedaan jarak antara objek. Dengan memanfaatkan dua dimensi tersebut, pengaturan objek bisa divisualisasikan dalam grafik 2D sehingga hubungan kedekatan atau perbedaan antar area menjadi lebih jelas dan mudah dimengerti.
> library(readxl)
> library(ggplot2)
> library(MASS)
> library(rgl)
> library(scatterplot3d)
> # Import Data
> data_indeks <- read_excel("C:/Users/nandi/Downloads/Komponen Penyusun Indeks Kualitas Lingkungan Hidup Menurut Provinsi, 2023.xlsx")
> data_indeks
# A tibble: 38 × 5
Provinsi Indeks Kualitas Udar…¹ `Indeks Kualitas Air` Indeks Kualitas Tutu…²
<chr> <dbl> <dbl> <dbl>
1 ACEH 90.9 61.3 76.5
2 SUMATERA… 90.9 60.3 49.8
3 SUMATERA… 90.5 57.0 67
4 RIAU 90.9 50.8 51.3
5 JAMBI 90.6 46.1 51
6 SUMATERA… 87.8 58.2 44.1
7 BENGKULU 92.5 49.0 55.7
8 LAMPUNG 88.0 55.4 37.5
9 KEP. BAN… 90.2 57.4 39.2
10 KEP. RIAU 90.1 54.9 66
# ℹ 28 more rows
# ℹ abbreviated names: ¹​`Indeks Kualitas Udara`,
# ²​`Indeks Kualitas Tutupan Lahan (IKTL)`
# ℹ 1 more variable: `Indeks Kualitas Lahan (IKL)` <dbl>
Membaca dataset dari file Excel dan menyimpannya ke dalam variabel data untuk memanfaatkan data yang termuat di dalamnya untuk tahap selanjutnya.
> data_mds <- data_indeks[, -1]
> data_mds
# A tibble: 38 × 4
`Indeks Kualitas Udara` `Indeks Kualitas Air` Indeks Kualitas Tutupan Lahan…¹
<dbl> <dbl> <dbl>
1 90.9 61.3 76.5
2 90.9 60.3 49.8
3 90.5 57.0 67
4 90.9 50.8 51.3
5 90.6 46.1 51
6 87.8 58.2 44.1
7 92.5 49.0 55.7
8 88.0 55.4 37.5
9 90.2 57.4 39.2
10 90.1 54.9 66
# ℹ 28 more rows
# ℹ abbreviated name: ¹​`Indeks Kualitas Tutupan Lahan (IKTL)`
# ℹ 1 more variable: `Indeks Kualitas Lahan (IKL)` <dbl>
Menghapus kolom pertama yang berisi nama Provinsi karena pada MDS membutuhkan data numerik, tanpa variabel kategorik
> matriks_jarak <- as.matrix(dist(data_mds))
> matriks_jarak
1 2 3 4 5 6 7
1 0.000000 37.801853 12.852296 36.952138 39.413887 45.848325 31.870504
2 37.801853 0.000000 25.987870 9.720463 14.289108 8.709409 14.183198
3 12.852296 25.987870 0.000000 24.240375 26.725243 33.741295 19.244971
4 36.952138 9.720463 24.240375 0.000000 4.899102 12.930715 6.565341
5 39.413887 14.289108 26.725243 4.899102 0.000000 15.515444 7.825529
6 45.848325 8.709409 33.741295 12.930715 15.515444 0.000000 19.277492
7 31.870504 14.183198 19.244971 6.565341 7.825529 19.277492 0.000000
8 54.913948 17.674847 42.581919 19.810144 20.584873 9.327379 26.340298
9 52.281042 14.652321 40.096894 17.962063 19.477261 6.975608 24.411723
10 15.572238 24.236099 3.113599 21.678102 23.906487 31.716997 16.487298
11 76.106291 43.654481 63.910602 42.212056 40.408114 35.454818 47.717253
12 51.781346 19.783036 39.250887 16.871897 15.499448 13.347775 22.495960
13 44.099228 11.244510 31.502451 8.563072 9.211960 7.661240 14.853070
14 44.642068 20.138776 32.101765 11.413856 6.697529 18.997550 13.692874
15 38.796569 7.584979 26.571874 8.323347 11.517973 8.610070 13.444776
16 53.145406 26.035900 42.570724 28.122377 29.243928 21.164676 32.938789
17 44.722852 8.456985 32.337031 10.007287 12.172945 3.516902 16.515220
18 19.481822 26.869408 9.584347 21.661397 22.408215 33.372523 15.559190
19 25.233840 14.639460 12.673421 11.813916 14.855093 22.018097 7.596769
20 24.130460 16.871556 11.504173 13.045589 15.441496 23.970745 7.839267
21 7.536432 37.022273 11.287679 34.259926 35.903015 44.666087 28.476524
22 35.040956 5.988781 22.693402 5.268937 10.017270 12.471908 8.442962
23 13.458012 48.624815 22.742353 45.710452 47.037047 56.150915 39.840830
24 33.788872 71.210874 45.430378 68.922033 70.348736 79.127680 62.979750
25 22.218038 19.679698 9.977850 15.649374 17.620287 26.890550 9.855019
26 9.388552 46.957283 22.145045 46.290541 48.687138 55.094114 41.095215
27 28.898550 9.383352 16.741269 9.802811 14.138044 17.163686 9.194313
28 2.975735 35.556478 10.962085 34.802444 37.363465 43.739110 29.720855
29 6.822243 43.214658 17.859454 41.597400 43.649125 51.321829 35.997300
30 5.667574 33.435542 8.310409 32.070112 34.447933 41.535051 26.767809
31 20.872810 58.071994 32.247612 55.786171 57.319722 65.934139 49.925719
32 14.482814 52.148724 26.816249 50.834305 52.887479 60.249437 45.300006
33 33.690902 71.217679 45.713427 69.418797 71.087736 79.320966 63.569918
34 32.402958 51.037296 36.095609 49.392868 50.495610 57.706289 44.953833
35 34.227181 71.403679 45.663316 68.957600 70.310959 79.346905 62.933432
36 23.419507 44.994497 28.145213 44.245499 46.067127 52.380529 39.715487
37 26.889861 52.735518 34.477246 52.476270 54.476355 60.300739 47.910423
38 27.405490 51.907847 34.235937 51.442374 53.331148 59.457016 46.826600
8 9 10 11 12 13 14
1 54.913948 52.281042 15.572238 76.10629 51.781346 44.099228 44.642068
2 17.674847 14.652321 24.236099 43.65448 19.783036 11.244510 20.138776
3 42.581919 40.096894 3.113599 63.91060 39.250887 31.502451 32.101765
4 19.810144 17.962063 21.678102 42.21206 16.871897 8.563072 11.413856
5 20.584873 19.477261 23.906487 40.40811 15.499448 9.211960 6.697529
6 9.327379 6.975608 31.716997 35.45482 13.347775 7.661240 18.997550
7 26.340298 24.411723 16.487298 47.71725 22.495960 14.853070 13.692874
8 0.000000 3.796828 40.396850 28.79564 12.218736 12.652249 21.425567
9 3.796828 0.000000 38.039779 32.54645 14.131567 11.931157 21.435023
10 40.396850 38.039779 0.000000 61.31768 36.624467 29.011468 29.149460
11 28.795640 32.546450 61.317679 0.00000 25.361179 34.087709 36.707806
12 12.218736 14.131567 36.624467 25.36118 0.000000 9.001317 13.825288
13 12.652249 11.931157 29.011468 34.08771 9.001317 0.000000 11.756432
14 21.425567 21.435023 29.149460 36.70781 13.825288 11.756432 0.000000
15 16.949469 15.311545 24.371455 38.81461 14.515847 6.849153 16.220210
16 22.868448 24.041880 40.732385 28.99801 19.095329 21.613341 30.150632
17 10.318362 8.292774 30.117432 35.76215 12.137665 4.995758 15.682286
18 41.268483 39.327677 7.185110 60.24473 35.908670 29.143776 26.442889
19 30.470875 28.019024 10.348956 53.03310 27.809295 19.530469 21.004450
20 32.231696 29.905633 8.895735 54.09040 28.914642 20.928889 21.204011
21 53.321899 50.947972 12.972101 73.37813 49.046914 41.766892 40.455378
22 20.566237 17.907099 20.562699 45.35201 20.299325 11.326328 16.546758
23 64.807114 62.533008 24.505434 83.57298 59.874972 53.026904 51.076500
24 87.938207 85.453120 47.563319 107.15354 83.474512 76.435131 74.393312
25 35.032215 32.676912 7.389709 56.79163 31.630760 23.746181 23.060967
26 64.198921 61.502869 24.847553 85.31667 61.128861 53.478532 53.792281
27 26.070859 23.444236 14.863559 49.69601 24.725602 16.083398 20.683215
28 52.769538 50.054448 13.750440 74.59620 50.013684 42.122955 42.748389
29 60.201247 57.558264 20.259215 81.37389 56.853258 49.188487 48.548495
30 50.432859 47.778370 10.926857 72.14916 47.440723 39.581487 39.722588
31 74.742632 72.280534 34.365489 94.21739 70.363655 63.252005 61.540411
32 69.245050 66.603367 29.293120 89.93496 65.750246 58.235711 57.673537
33 88.218844 85.598254 48.011843 108.28945 84.315547 77.001471 75.416140
34 65.342989 63.074557 36.377665 84.28018 62.029059 55.564487 54.475469
35 88.091158 85.591217 47.749016 107.47334 83.669649 76.589595 74.305414
36 60.694506 58.145367 28.993339 81.29572 57.983874 50.789371 50.842894
37 68.812300 66.182070 35.821748 89.44146 66.253649 58.999601 59.347996
38 67.814081 65.168639 35.425825 88.69061 65.384679 58.089302 58.140510
15 16 17 18 19 20 21
1 38.796569 53.14541 44.722852 19.481822 25.233840 24.130460 7.536432
2 7.584979 26.03590 8.456985 26.869408 14.639460 16.871556 37.022273
3 26.571874 42.57072 32.337031 9.584347 12.673421 11.504173 11.287679
4 8.323347 28.12238 10.007287 21.661397 11.813916 13.045589 34.259926
5 11.517973 29.24393 12.172945 22.408215 14.855093 15.441496 35.903015
6 8.610070 21.16468 3.516902 33.372523 22.018097 23.970745 44.666087
7 13.444776 32.93879 16.515220 15.559190 7.596769 7.839267 28.476524
8 16.949469 22.86845 10.318362 41.268483 30.470875 32.231696 53.321899
9 15.311545 24.04188 8.292774 39.327677 28.019024 29.905633 50.947972
10 24.371455 40.73239 30.117432 7.185110 10.348956 8.895735 12.972101
11 38.814608 28.99801 35.762152 60.244733 53.033098 54.090401 73.378134
12 14.515847 19.09533 12.137665 35.908670 27.809295 28.914642 49.046914
13 6.849153 21.61334 4.995758 29.143776 19.530469 20.928889 41.766892
14 16.220210 30.15063 15.682286 26.442889 21.004450 21.204011 40.455378
15 0.000000 20.55027 7.677506 25.817374 15.474447 17.186579 37.253091
16 20.550265 0.00000 22.827573 42.208352 34.438410 35.830731 52.411840
17 7.677506 22.82757 0.000000 31.163519 20.177512 21.960911 43.025919
18 25.817374 42.20835 31.163519 0.000000 12.521889 10.220024 14.141202
19 15.474447 34.43841 20.177512 12.521889 0.000000 2.392154 23.014311
20 17.186579 35.83073 21.960911 10.220024 2.392154 0.000000 21.325780
21 37.253091 52.41184 43.025919 14.141202 23.014311 21.325780 0.000000
22 8.798136 29.28001 10.478077 22.132094 10.291263 12.232044 33.280108
23 48.482905 62.18012 54.538363 24.715422 34.676416 32.926564 11.752230
24 71.724872 84.98720 77.644526 48.075280 57.589280 55.957487 34.694871
25 20.236813 38.78890 24.798901 8.155648 5.165375 3.078425 18.941146
26 48.119492 61.82789 54.040768 28.022125 34.544606 33.405134 14.221586
27 11.106350 30.25899 15.882585 17.873729 5.675606 7.993929 27.691533
28 36.919534 52.03750 42.575783 18.061894 23.009748 21.970974 7.568514
29 44.329417 59.36525 49.934506 22.540284 29.943595 28.558314 8.663233
30 34.650426 50.37936 40.186686 14.923217 20.321872 19.111151 6.144721
31 58.518105 72.15624 64.451614 35.122964 44.432309 42.817119 21.532046
32 53.147731 67.03115 59.006701 31.409790 39.166031 37.816827 17.271100
33 72.149814 85.70506 77.942824 49.041490 57.901860 56.386195 35.324305
34 51.946926 65.43038 56.252376 36.530725 41.100343 40.228003 32.054814
35 72.010808 85.68598 77.790850 48.077626 57.672389 56.007032 34.838319
36 46.393231 60.42121 51.157367 30.611637 34.638022 33.877689 24.454200
37 54.260179 67.49759 59.260342 37.825539 42.383993 41.621419 29.180188
38 53.601169 67.46388 58.308471 37.155044 41.564324 40.788726 29.174374
22 23 24 25 26 27 28
1 35.040956 13.458012 33.788872 22.218038 9.388552 28.898550 2.975735
2 5.988781 48.624815 71.210874 19.679698 46.957283 9.383352 35.556478
3 22.693402 22.742353 45.430378 9.977850 22.145045 16.741269 10.962085
4 5.268937 45.710452 68.922033 15.649374 46.290541 9.802811 34.802444
5 10.017270 47.037047 70.348736 17.620287 48.687138 14.138044 37.363465
6 12.471908 56.150915 79.127680 26.890550 55.094114 17.163686 43.739110
7 8.442962 39.840830 62.979750 9.855019 41.095215 9.194313 29.720855
8 20.566237 64.807114 87.938207 35.032215 64.198921 26.070859 52.769538
9 17.907099 62.533008 85.453120 32.676912 61.502869 23.444236 50.054448
10 20.562699 24.505434 47.563319 7.389709 24.847553 14.863559 13.750440
11 45.352008 83.572979 107.153536 56.791626 85.316667 49.696006 74.596202
12 20.299325 59.874972 83.474512 31.630760 61.128861 24.725602 50.013684
13 11.326328 53.026904 76.435131 23.746181 53.478532 16.083398 42.122955
14 16.546758 51.076500 74.393312 23.060967 53.792281 20.683215 42.748389
15 8.798136 48.482905 71.724872 20.236813 48.119492 11.106350 36.919534
16 29.280010 62.180125 84.987202 38.788898 61.827888 30.258992 52.037496
17 10.478077 54.538363 77.644526 24.798901 54.040768 15.882585 42.575783
18 22.132094 24.715422 48.075280 8.155648 28.022125 17.873729 18.061894
19 10.291263 34.676416 57.589280 5.165375 34.544606 5.675606 23.009748
20 12.232044 32.926564 55.957487 3.078425 33.405134 7.993929 21.970974
21 33.280108 11.752230 34.694871 18.941146 14.221586 27.691533 7.568514
22 0.000000 44.961345 67.763885 14.897711 44.304211 6.666228 32.719694
23 44.961345 0.000000 23.632956 30.537775 11.280363 39.291339 15.540775
24 67.763885 23.632956 0.000000 53.432079 25.470512 62.050767 35.941877
25 14.897711 30.537775 53.432079 0.000000 31.343250 10.824722 20.003565
26 44.304211 11.280363 25.470512 31.343250 0.000000 38.187607 11.623420
27 6.666228 39.291339 62.050767 10.824722 38.187607 0.000000 26.707508
28 32.719694 15.540775 35.941877 20.003565 11.623420 26.707508 0.000000
29 39.930635 9.183251 28.114781 26.178285 6.728291 34.181068 8.139459
30 30.227683 16.364623 37.821038 16.977591 14.416612 24.401045 3.362142
31 54.625816 10.772590 13.209849 40.352014 13.528758 48.878304 23.041150
32 49.132752 10.002950 19.615871 35.515066 6.022873 43.196742 16.608459
33 67.949597 24.901614 4.268981 53.873638 24.921152 62.204525 35.729810
34 48.152224 33.465400 44.454374 38.551862 33.868818 44.235480 32.320642
35 67.828349 23.929910 2.298173 53.410238 26.085747 62.237295 36.251534
36 42.386893 26.948933 40.171555 32.174345 25.256587 37.692016 23.273622
37 50.404458 28.536172 36.422698 39.843998 25.665824 45.360373 27.415109
38 49.403244 29.206773 37.720655 38.945625 26.767193 44.636807 27.637020
29 30 31 32 33 34 35
1 6.822243 5.667574 20.872810 14.482814 33.690902 32.402958 34.227181
2 43.214658 33.435542 58.071994 52.148724 71.217679 51.037296 71.403679
3 17.859454 8.310409 32.247612 26.816249 45.713427 36.095609 45.663316
4 41.597400 32.070112 55.786171 50.834305 69.418797 49.392868 68.957600
5 43.649125 34.447933 57.319722 52.887479 71.087736 50.495610 70.310959
6 51.321829 41.535051 65.934139 60.249437 79.320966 57.706289 79.346905
7 35.997300 26.767809 49.925719 45.300006 63.569918 44.953833 62.933432
8 60.201247 50.432859 74.742632 69.245050 88.218844 65.342989 88.091158
9 57.558264 47.778370 72.280534 66.603367 85.598254 63.074557 85.591217
10 20.259215 10.926857 34.365489 29.293120 48.011843 36.377665 47.749016
11 81.373886 72.149155 94.217386 89.934965 108.289446 84.280179 107.473336
12 56.853258 47.440723 70.363655 65.750246 84.315547 62.029059 83.669649
13 49.188487 39.581487 63.252005 58.235711 77.001471 55.564487 76.589595
14 48.548495 39.722588 61.540411 57.673537 75.416140 54.475469 74.305414
15 44.329417 34.650426 58.518105 53.147731 72.149814 51.946926 72.010808
16 59.365247 50.379363 72.156244 67.031149 85.705061 65.430382 85.685978
17 49.934506 40.186686 64.451614 59.006701 77.942824 56.252376 77.790850
18 22.540284 14.923217 35.122964 31.409790 49.041490 36.530725 48.077626
19 29.943595 20.321872 44.432309 39.166031 57.901860 41.100343 57.672389
20 28.558314 19.111151 42.817119 37.816827 56.386195 40.228003 56.007032
21 8.663233 6.144721 21.532046 17.271100 35.324305 32.054814 34.838319
22 39.930635 30.227683 54.625816 49.132752 67.949597 48.152224 67.828349
23 9.183251 16.364623 10.772590 10.002950 24.901614 33.465400 23.929910
24 28.114781 37.821038 13.209849 19.615871 4.268981 44.454374 2.298173
25 26.178285 16.977591 40.352014 35.515066 53.873638 38.551862 53.410238
26 6.728291 14.416612 13.528758 6.022873 24.921152 33.868818 26.085747
27 34.181068 24.401045 48.878304 43.196742 62.204525 44.235480 62.237295
28 8.139459 3.362142 23.041150 16.608459 35.729810 32.320642 36.251534
29 0.000000 9.802959 15.236161 9.432926 28.042363 31.806407 28.290141
30 9.802959 0.000000 24.767612 18.918618 37.823068 32.780047 38.012131
31 15.236161 24.767612 0.000000 7.803134 14.135342 36.530646 13.611851
32 9.432926 18.918618 7.803134 0.000000 19.224240 34.373865 20.128944
33 28.042363 37.823068 14.135342 19.224240 0.000000 44.561910 4.802770
34 31.806407 32.780047 36.530646 34.373865 44.561910 0.000000 44.400615
35 28.290141 38.012131 13.611851 20.128944 4.802770 44.400615 0.000000
36 23.553792 24.162837 30.638056 26.833803 39.880389 9.968671 40.305804
37 25.902042 29.127351 29.175901 26.075370 35.714472 12.847945 36.705641
38 26.273875 29.071328 30.253474 27.182873 37.035113 10.813408 37.825269
36 37 38
1 23.419507 26.889861 27.405490
2 44.994497 52.735518 51.907847
3 28.145213 34.477246 34.235937
4 44.245499 52.476270 51.442374
5 46.067127 54.476355 53.331148
6 52.380529 60.300739 59.457016
7 39.715487 47.910423 46.826600
8 60.694506 68.812300 67.814081
9 58.145367 66.182070 65.168639
10 28.993339 35.821748 35.425825
11 81.295725 89.441461 88.690613
12 57.983874 66.253649 65.384679
13 50.789371 58.999601 58.089302
14 50.842894 59.347996 58.140510
15 46.393231 54.260179 53.601169
16 60.421212 67.497591 67.463880
17 51.157367 59.260342 58.308471
18 30.611637 37.825539 37.155044
19 34.638022 42.383993 41.564324
20 33.877689 41.621419 40.788726
21 24.454200 29.180188 29.174374
22 42.386893 50.404458 49.403244
23 26.948933 28.536172 29.206773
24 40.171555 36.422698 37.720655
25 32.174345 39.843998 38.945625
26 25.256587 25.665824 26.767193
27 37.692016 45.360373 44.636807
28 23.273622 27.415109 27.637020
29 23.553792 25.902042 26.273875
30 24.162837 29.127351 29.071328
31 30.638056 29.175901 30.253474
32 26.833803 26.075370 27.182873
33 39.880389 35.714472 37.035113
34 9.968671 12.847945 10.813408
35 40.305804 36.705641 37.825269
36 0.000000 8.792002 7.447322
37 8.792002 0.000000 3.212896
38 7.447322 3.212896 0.000000
menghitung jarak Euclidean antar objek berdasarkan data_mds. Output dari matriks jarak D akan menghasilkan nilai diagonal = 0.
> A <- matriks_jarak^2
> n <- nrow(matriks_jarak)
> I <- diag(n)
> J <- matrix(rep(1, n), nrow=n, ncol=n)
> V <- I - (1/n) * J
>
> aa <- V %*% A
> BB <- aa %*% V
> B <- (-1/2) * BB
A : untuk Membuat matriks jarak kuadrat
n : untuk Menghitung jumlah baris matriks jarak.
I : Menghasilkan matriks dengan nilai 1 di diagonal dan 0 di luar diagonal berukuran nxn. Syntax berikut digunakan dalam proses double centering pada perhitungan MDS.
J : Untuk membuat matriks berisi angka 1 berukuran nxn.
V : untuk Membuat centering matrix yang digunakan untuk melakukan double centering pada MDS klasik.
aa : untuk perkalian dari matriks jarak kuadrat dan centering matrik untuk melakukan centering, karena dalam MDS klasik, centering perlu dilakukan dua kali.
BB : untuk proses double centering membuat matriks B.
B : Matriks B ini yang akan dieigen decompose untuk mendapatkan posisi titik dalam ruang 2D atau 3D.
> eigen_result <- eigen(B)
> eigenvalues <- eigen_result$values
> eigenvalues
[1] 2.814420e+04 2.444717e+03 8.573086e+02 7.602397e+02 3.231460e-12
[6] 2.931891e-12 2.652013e-12 1.566573e-12 7.577188e-13 7.159914e-13
[11] 6.650077e-13 5.232817e-13 5.165575e-13 4.059983e-13 3.742398e-13
[16] 3.729771e-13 2.447924e-13 1.797160e-13 1.722530e-13 1.307388e-13
[21] 1.079092e-13 8.086975e-14 -3.239895e-14 -3.604975e-14 -5.837973e-14
[26] -8.740810e-14 -1.503651e-13 -1.570332e-13 -1.921279e-13 -2.334645e-13
[31] -5.701116e-13 -8.133719e-13 -8.487472e-13 -9.329029e-13 -1.182039e-12
[36] -1.676817e-12 -1.917536e-12 -2.516217e-12
> eigenvectors <- eigen_result$vectors
> eigenvectors
[,1] [,2] [,3] [,4] [,5]
[1,] 0.098710280 -0.069218839 -0.137614073 0.118971039 0.435241456
[2,] -0.122264997 0.029964106 -0.277323469 -0.016314873 0.485341088
[3,] 0.024692590 -0.081904823 -0.073005552 0.022890544 0.108292469
[4,] -0.114670733 -0.019019397 0.011443839 -0.159150457 -0.010296361
[5,] -0.123007556 -0.027607659 0.157973238 -0.226589891 0.137799209
[6,] -0.172338414 0.028563148 -0.209795851 0.026173403 -0.135995392
[7,] -0.078800641 -0.035448284 0.073882117 -0.220800777 0.066185125
[8,] -0.225869822 0.033544429 -0.174728917 -0.056806722 0.211191613
[9,] -0.208705620 0.042546475 -0.253684278 -0.084470813 0.173786953
[10,] 0.010956721 -0.072127251 -0.007819321 -0.002953817 0.077794514
[11,] -0.341688258 -0.033236448 0.460067481 0.297240993 0.299649736
[12,] -0.203767523 -0.024755230 0.198902109 0.042908099 -0.073694714
[13,] -0.160783452 -0.008695336 0.029886563 -0.028743121 0.014732026
[14,] -0.145682665 -0.052881479 0.334758589 -0.278278522 0.111853545
[15,] -0.131472029 -0.007570935 -0.063863836 0.112620825 -0.110372636
[16,] -0.200539203 -0.027554802 0.046219240 0.715906986 -0.051655790
[17,] -0.164994958 0.020190418 -0.129714341 -0.056383670 -0.103604011
[18,] 0.007826351 -0.087975775 0.210390198 -0.117154356 0.052061381
[19,] -0.046259571 -0.026574583 -0.064992852 -0.099524069 0.088248320
[20,] -0.037503663 -0.040737370 -0.008697056 -0.121204070 0.050543444
[21,] 0.086764020 -0.095670456 0.068182488 -0.020374855 -0.025462803
[22,] -0.104387871 0.008398854 -0.151430058 -0.142714751 0.029312748
[23,] 0.151507271 -0.139661950 0.181768892 0.055278436 0.298680522
[24,] 0.291778877 -0.171894712 0.132309292 0.043205607 -0.230077623
[25,] -0.021708907 -0.043796412 0.009221983 -0.174473674 0.076445710
[26,] 0.153517447 -0.089359982 -0.182287715 0.153415223 0.180969453
[27,] -0.071073496 -0.005879586 -0.163287061 -0.014058117 -0.056711359
[28,] 0.087066844 -0.056351509 -0.172599579 0.050296835 -0.014802882
[29,] 0.130912821 -0.083380010 -0.083880378 -0.018617463 -0.058529834
[30,] 0.073004113 -0.068650281 -0.120758595 -0.013192004 -0.003395962
[31,] 0.213844272 -0.141354629 0.093869476 0.046985229 0.129659327
[32,] 0.184018579 -0.102459983 -0.095963595 0.087692450 0.154197984
[33,] 0.296185070 -0.150023974 -0.005466400 0.025629228 0.174893726
[34,] 0.127601117 0.527793174 0.251980625 -0.062298053 0.141999408
[35,] 0.292833113 -0.170526559 0.141508253 -0.039284954 0.078274937
[36,] 0.118616873 0.385834094 0.029547826 0.022132057 0.056915766
[37,] 0.166364945 0.419917862 -0.033278884 0.117469255 0.051485116
[38,] 0.159318075 0.437565693 -0.021720398 0.014572819 0.037319365
[,6] [,7] [,8] [,9] [,10]
[1,] 0.000000000 0.000000000 0.000000000 0.000000000 0.0000000000
[2,] 0.342711675 0.517375281 -0.197164695 -0.061064937 -0.0090817708
[3,] -0.051283315 -0.208171537 -0.002244281 -0.109460461 -0.3074104696
[4,] 0.430028278 -0.155034691 0.149250828 -0.025811518 -0.0576024583
[5,] -0.265528343 0.079140302 0.010451127 -0.155270702 0.1795112679
[6,] -0.070534870 0.200804738 -0.110689107 -0.129943619 -0.0716246234
[7,] 0.018657015 -0.025353608 -0.052779178 0.030288383 0.2417462539
[8,] -0.320081001 -0.493349792 -0.239668545 -0.203548676 -0.0167966790
[9,] 0.084136101 -0.151327959 -0.091332523 0.332831015 0.0523586237
[10,] -0.027156166 -0.040972425 0.099930713 0.009627957 -0.2349477057
[11,] -0.057435695 -0.035006682 0.232413022 -0.079206691 -0.0119240293
[12,] 0.270528532 -0.018324003 -0.330121579 0.156093320 -0.0864775090
[13,] -0.226784128 0.282091829 0.422164589 -0.101578001 -0.0354391160
[14,] 0.134134978 -0.049734627 -0.089379412 -0.128781297 -0.1241921142
[15,] -0.091696761 0.132710958 -0.131306315 0.101526494 0.4458909772
[16,] 0.061625178 -0.036021409 -0.150273917 -0.124189255 0.0649176648
[17,] 0.018976561 0.081336532 -0.158099812 -0.165485997 -0.0900647971
[18,] 0.013350352 -0.022660997 -0.195572798 0.001014673 -0.0879443783
[19,] -0.098484693 -0.038916739 -0.137732732 -0.128878777 0.1217802253
[20,] -0.004918815 -0.046722628 0.025945455 0.134316009 -0.0022022634
[21,] 0.086373153 -0.026948179 -0.138169122 0.173340206 -0.1514702577
[22,] 0.026150201 -0.053778137 0.286668278 0.154843255 0.1667476555
[23,] -0.365274764 0.148968117 -0.118514248 0.475427986 -0.0406725861
[24,] 0.045994929 0.031120428 -0.163372004 -0.009456711 0.0000472259
[25,] -0.009134992 -0.042611680 -0.092612831 -0.034599750 0.0647837982
[26,] 0.078815927 -0.262284136 0.087939511 -0.096403593 0.1595309921
[27,] -0.095844739 0.122470883 0.023613682 -0.196305797 0.0934399676
[28,] 0.060651066 0.001425958 0.024590122 -0.178189618 -0.0888859261
[29,] -0.174156746 0.074447227 0.038469456 -0.201383712 -0.0070089107
[30,] -0.048917682 0.063993332 0.094502488 0.055119449 -0.0941643271
[31,] 0.059376799 0.199314755 -0.006229907 -0.042933506 -0.0713549245
[32,] 0.022264914 -0.061641064 0.268232060 0.010039133 -0.2078090865
[33,] 0.107544386 -0.182141504 -0.114194953 -0.188198643 0.1151662078
[34,] 0.169239392 0.001253610 0.100321394 -0.277832376 0.0662746113
[35,] 0.033273796 0.068037031 -0.102371995 -0.221117358 0.3904763387
[36,] -0.198252522 -0.028649336 -0.161834885 0.081009982 0.0834512037
[37,] 0.151898325 -0.131356709 0.148504287 0.252537644 0.1985445085
[38,] -0.192975999 0.122352240 -0.228703814 -0.076159443 -0.3430446576
[,11] [,12] [,13] [,14] [,15]
[1,] 0.000000000 0.0000000000 0.0000000000 0.000000000 0.000000000
[2,] -0.112369287 -0.1089072002 -0.0799327311 0.055401469 0.098487415
[3,] -0.234718785 -0.0538460842 0.1377455149 0.272845570 -0.092377567
[4,] -0.209250632 0.1069991778 -0.1059876697 0.087153308 0.012750869
[5,] -0.091553404 -0.0707381991 -0.2629874915 -0.053244291 -0.083713128
[6,] 0.193132674 0.0107907888 -0.0358668579 0.017905608 -0.121821283
[7,] -0.106601895 0.0609763288 0.1032473065 -0.210476091 -0.032054523
[8,] -0.150439966 0.0232320814 -0.1199602710 -0.076346631 0.098174962
[9,] 0.020731629 -0.1118000690 -0.0367085149 -0.049220175 -0.015578718
[10,] -0.254988030 -0.0210969592 0.1350697036 0.316331739 -0.297884498
[11,] 0.091331467 0.2443410743 0.0954248747 -0.038744300 0.143338761
[12,] 0.043546337 0.1959762942 0.0465177614 -0.011788348 0.063618101
[13,] -0.210033515 0.0574078979 -0.1429587892 0.066896958 -0.139157413
[14,] 0.447687686 -0.1768944017 -0.1724811957 0.055002472 -0.234559877
[15,] 0.108066207 -0.0336276893 0.0241722968 0.297026068 -0.071271298
[16,] -0.158636216 -0.1414342042 -0.0357617939 -0.073133403 -0.162193950
[17,] -0.233815911 0.1706557512 0.2346550377 -0.279584589 0.085883829
[18,] 0.010168319 -0.1309166122 0.2998574055 0.118204149 0.063594407
[19,] -0.005506012 -0.1033623639 -0.1829929870 0.118455784 -0.005604302
[20,] -0.081417871 0.2209655515 0.0848551301 -0.369737036 0.021078394
[21,] -0.253574730 0.0171560320 0.0174669023 0.007161853 0.036087290
[22,] -0.098306062 0.2053838293 0.1604263449 0.135539962 -0.127150716
[23,] -0.081396567 -0.1549436032 0.1070492086 -0.024777579 -0.124403260
[24,] -0.190984352 -0.2150986083 -0.1188153086 -0.065518698 -0.116534516
[25,] 0.091348584 0.0014663584 0.3962581322 0.077198578 -0.229960666
[26,] 0.297930930 0.1174892408 0.1067618347 0.102800782 -0.115652578
[27,] 0.091620588 -0.1060808780 0.3788537875 -0.180442072 -0.164845514
[28,] 0.132647629 -0.0201625347 0.1542730321 -0.152237727 -0.285137229
[29,] 0.021772749 -0.0241392266 0.1544628067 0.296242878 0.572588773
[30,] 0.070927208 0.0233540550 -0.2619109583 -0.137642706 0.079042386
[31,] 0.160954040 0.3335979519 0.1257106859 0.055294777 0.125012661
[32,] 0.151192992 -0.2396609414 0.0006467123 -0.407151057 0.050879258
[33,] 0.013527486 0.1166880777 -0.1822035828 0.075240359 0.032289135
[34,] -0.172335743 -0.3444353122 0.1693972704 -0.040138479 0.036890226
[35,] -0.238546307 0.2591043795 -0.0326419307 -0.139323436 -0.178135496
[36,] 0.067849401 0.0006695421 0.1255059319 -0.081145992 0.181972722
[37,] -0.017917722 0.0565697428 -0.0533796250 0.082409165 -0.085969311
[38,] 0.064587003 0.4256847484 -0.1487999822 0.048378236 -0.263873872
[,16] [,17] [,18] [,19] [,20]
[1,] 0.000000000 0.0000000000 0.000000000 0.0000000000 0.000000000
[2,] 0.141268518 -0.0056769613 0.004069775 -0.1277314177 -0.039146359
[3,] 0.143012838 0.1534826265 0.162141224 0.1175763864 0.078097454
[4,] -0.097182036 0.0258695325 0.091288604 0.0146570346 -0.086739368
[5,] -0.158890692 -0.1126105943 0.410682551 0.0430259568 0.228188033
[6,] 0.146764625 -0.0209969162 0.105972552 0.1518899196 0.050056358
[7,] 0.004859700 0.0945253570 -0.176770913 0.1749977791 -0.251198588
[8,] -0.112005955 -0.0116802680 -0.076738395 -0.3606723204 -0.083000827
[9,] -0.353218045 0.0198549943 -0.061963408 0.1673941347 0.247210189
[10,] 0.005941578 0.1284234744 0.185035917 -0.0159573611 -0.185581634
[11,] 0.156106570 -0.0393693555 0.079426838 -0.0084272607 -0.089125031
[12,] -0.253120851 0.0004667802 0.133819076 0.1337608987 -0.109570520
[13,] -0.336844137 -0.1070859574 -0.253907137 0.1603797621 -0.074751393
[14,] -0.064924584 0.2344877133 0.035026045 0.0344964265 -0.107484470
[15,] -0.275026379 0.0492939711 0.289329516 -0.1234648538 -0.366936571
[16,] -0.160556103 0.0122158156 -0.128132884 0.1612274744 0.144891144
[17,] -0.049828064 0.3401268903 0.083839592 0.1029378137 -0.247346988
[18,] -0.082780220 -0.5561160014 -0.202801754 0.0104832200 -0.125952225
[19,] 0.047388845 -0.0850346768 -0.082220340 0.1347499488 0.071216241
[20,] -0.065412310 0.0008056434 0.004707245 0.0163440056 0.016485917
[21,] -0.154820293 -0.3719527901 0.175400955 -0.0559311845 0.074051709
[22,] -0.062215256 -0.0178174034 0.149396479 0.1899900316 0.181121428
[23,] 0.026498514 0.1688746468 -0.049253499 0.0589465589 -0.159048413
[24,] -0.192423641 0.2351596474 0.011013573 -0.0609641947 0.069635665
[25,] -0.043517960 0.1117531170 -0.277323742 -0.0005874734 0.131128662
[26,] -0.187563752 0.0909641044 -0.040187689 -0.1137374998 0.004409102
[27,] -0.007129043 -0.0645660567 -0.048949200 0.1144680956 0.061708170
[28,] -0.088398198 -0.3823152545 0.258172979 -0.0692980522 -0.228046316
[29,] -0.226896364 0.0979611163 0.012888493 0.0870842796 -0.183038383
[30,] -0.175868668 -0.0462926635 -0.241061772 0.0134061483 -0.223812416
[31,] -0.330260435 0.1178865316 0.026208722 -0.1756204908 0.380909570
[32,] -0.165501454 0.0405018200 0.285253352 0.0433861425 -0.164843448
[33,] 0.041969156 -0.0765748856 -0.052121862 0.6472250421 -0.120894730
[34,] -0.247555610 0.0684192795 -0.049662304 -0.0228852973 0.046003417
[35,] 0.113788304 -0.0206872228 0.043618516 -0.1744077670 -0.009532784
[36,] 0.082084312 -0.0151603600 0.325332926 0.2558971344 0.129134892
[37,] 0.066873550 -0.0391497536 -0.045069842 -0.0806862280 -0.227645317
[38,] -0.161279739 -0.0174028665 -0.082324457 0.0302462467 -0.083483938
[,21] [,22] [,23] [,24] [,25]
[1,] 0.000000000 0.000000000 0.000000000 0.0000000000 0.0000000000
[2,] -0.013188990 -0.043397831 0.048536969 0.0657663792 -0.1407705628
[3,] -0.192534869 0.354990366 -0.374856648 0.0288917017 -0.1985596420
[4,] -0.144094732 0.034332342 -0.100240457 -0.1467219479 -0.1238743873
[5,] 0.201833528 0.170752396 -0.003115436 0.1386157544 0.0719233457
[6,] 0.095464078 0.175376748 0.043031031 0.3762134313 0.0574233416
[7,] 0.054261881 -0.017758278 0.111965665 0.2263928516 -0.2515216324
[8,] 0.002788115 -0.146442865 0.004390952 0.1715084324 -0.0687536275
[9,] 0.137817550 0.034666502 0.024845576 -0.4542156831 0.2154814417
[10,] 0.330162171 -0.093015212 0.146693339 -0.0328152832 0.3543933831
[11,] 0.001557968 0.066468122 0.008085064 -0.2062273722 0.0227557573
[12,] -0.154066493 -0.183855973 -0.082698312 0.3171068755 0.3432946708
[13,] -0.030287997 -0.001512218 -0.022173368 0.1322193392 -0.0237745137
[14,] 0.187579439 -0.088064689 -0.037735858 -0.1449455634 -0.3482977847
[15,] -0.145223065 0.230527150 -0.074440723 -0.0670909662 -0.0430047737
[16,] 0.044491572 0.041523603 0.125386707 -0.0270787527 -0.2285855753
[17,] 0.125670216 0.115496578 -0.129032446 -0.0990577566 0.0568946621
[18,] -0.030611524 0.145109188 -0.158297284 0.0377484270 -0.0008098575
[19,] -0.287442528 0.024657281 -0.033234612 -0.1453469627 0.1029548634
[20,] -0.060502123 0.164753642 0.072012135 0.0303911501 -0.1847237743
[21,] 0.375624403 0.004872886 0.090344051 0.0639300404 -0.2671430756
[22,] -0.250804369 -0.280848652 0.041221538 0.0932355225 -0.2631904814
[23,] -0.138556954 -0.196105493 -0.110373935 0.0491804826 -0.0224070569
[24,] -0.092249593 -0.037237605 -0.008291434 -0.0004924946 -0.1929459339
[25,] -0.044795569 0.445264826 0.425724869 0.0116592743 0.0513443627
[26,] 0.054640458 -0.115696528 -0.141367420 0.2709054117 0.0168147730
[27,] 0.298929869 -0.287829586 -0.429175276 -0.1367963053 -0.0328168213
[28,] -0.253172077 -0.081039321 0.107921972 -0.1970630862 -0.0907725672
[29,] 0.122587766 -0.114386901 0.259419182 -0.1571752709 -0.1659589335
[30,] 0.005124265 0.304444813 -0.369667982 -0.0667697292 0.0644092323
[31,] 0.056042736 0.113024597 -0.174681631 0.0803055669 -0.0388975095
[32,] -0.078942367 0.135060647 0.212472951 0.1003029881 0.0953214676
[33,] 0.098899928 -0.019733995 0.033441128 0.0601249719 0.0806093585
[34,] -0.144769811 -0.057138804 -0.053979584 0.1199435788 0.1663290750
[35,] 0.013120069 0.006278173 -0.018573097 -0.2356892667 0.1674723188
[36,] -0.045875807 0.081836275 -0.077368948 -0.0728627125 -0.1226232567
[37,] 0.347718963 0.206250294 -0.081598828 0.0906380853 -0.1310028330
[38,] -0.082227646 -0.082933378 0.128974388 -0.1593319202 -0.0855553471
[,26] [,27] [,28] [,29] [,30]
[1,] 0.000000000 0.000000000 0.000000000 0.00000000 0.000000000
[2,] 0.052076246 0.152608233 -0.016969413 -0.07912288 0.040392396
[3,] 0.080739367 0.054404535 -0.032440373 0.06122018 -0.129906612
[4,] -0.029689289 0.117566630 -0.184467464 0.21760343 -0.109272818
[5,] 0.112321000 0.051249494 -0.092315516 0.11953005 0.143290803
[6,] -0.016017653 -0.165321137 -0.050372026 0.26737756 0.066992177
[7,] -0.077863542 0.112703219 0.118019362 -0.03061126 -0.072372095
[8,] 0.037939880 -0.059692949 0.097794340 -0.16674867 0.009639617
[9,] 0.013305055 0.058022390 0.112123052 0.09697323 -0.012474823
[10,] 0.155064174 0.023847310 -0.049918715 -0.19857864 0.204144306
[11,] -0.117903951 0.012375832 -0.018460626 0.03779672 -0.065172616
[12,] 0.115645870 0.105714653 -0.219279965 -0.16369030 -0.063287226
[13,] -0.050151804 0.237128312 0.010367172 -0.24782132 -0.240110079
[14,] 0.023800207 -0.058399174 0.026067235 -0.08451459 0.100575682
[15,] -0.010683728 -0.081618812 0.121069309 0.09519149 -0.150163891
[16,] 0.103575380 -0.038196244 -0.022250285 0.03255650 0.196635782
[17,] -0.225247226 -0.138516148 0.265571716 -0.01503611 0.058955532
[18,] 0.247729367 0.177303640 0.342307738 0.15842231 0.186974006
[19,] 0.011248577 -0.265813764 -0.117737748 -0.12936731 -0.344516043
[20,] 0.496348744 -0.149504247 -0.399858338 0.06920563 0.021516035
[21,] -0.478405734 -0.158854034 -0.133914046 0.09465339 -0.211258686
[22,] -0.011734249 -0.142840495 0.231945249 0.04608123 0.377439364
[23,] -0.088888812 -0.197102874 -0.146280686 0.15144426 0.009088156
[24,] 0.088216677 0.227770719 0.041185323 -0.12012721 -0.010401103
[25,] -0.164489217 0.059157617 -0.187895233 -0.10891119 -0.025810520
[26,] -0.217114374 0.305779792 -0.195773665 0.22001213 0.015308590
[27,] 0.153084816 0.029259738 -0.158754858 0.04686189 -0.256001693
[28,] -0.077618747 -0.176565412 -0.154196527 -0.32862164 0.097624985
[29,] 0.168840260 -0.007136245 -0.249306056 0.11772588 0.083896662
[30,] -0.207953632 -0.048188509 -0.226394733 -0.06563263 0.482894997
[31,] 0.076920299 -0.282221174 0.231730907 -0.26687753 -0.071666954
[32,] 0.098622346 0.106403399 0.271443073 0.14688367 -0.208422153
[33,] 0.002491222 -0.177618549 0.102138324 -0.06995562 -0.038789793
[34,] -0.115353558 -0.283481130 -0.081628370 0.14579311 0.092462086
[35,] 0.022624423 0.122511861 -0.002855417 0.15114777 0.087054126
[36,] -0.149384689 0.414827335 -0.090183996 -0.34234150 0.114401436
[37,] 0.266294512 -0.136630153 0.019878051 -0.18414515 -0.115097052
[38,] 0.051974455 0.103140009 0.073089451 0.30912722 -0.080787525
[,31] [,32] [,33] [,34] [,35]
[1,] 0.000000000 0.873463318 0.000000000 0.000000000 0.0000000000
[2,] 0.074869059 -0.267120872 -0.026161878 -0.038519003 0.0911049831
[3,] -0.054853160 -0.077862508 0.244168018 -0.080378809 -0.1082838178
[4,] -0.008541203 0.040062600 -0.285228543 -0.107980482 -0.1860905886
[5,] -0.200583441 -0.001199607 -0.298689886 -0.178306699 -0.1613243819
[6,] -0.054551689 0.052886909 0.241373785 0.121563261 -0.0333883829
[7,] -0.215888215 0.014831019 -0.201995820 0.147827351 -0.1847875832
[8,] 0.165213775 -0.096842726 0.068314872 -0.159406738 0.0286633326
[9,] -0.036716174 -0.088101954 0.193062951 0.091865554 -0.1718625634
[10,] 0.050906943 -0.046548186 -0.169740696 0.267152525 0.1664323579
[11,] 0.028759867 -0.081335690 -0.076125325 -0.006984400 0.1617225761
[12,] -0.149802732 0.083280342 0.186663283 -0.254801060 0.0848205211
[13,] 0.062520570 0.018763834 0.298421907 0.090896168 -0.0859873188
[14,] -0.012404260 0.047181444 0.268498059 0.057927116 0.0726080244
[15,] 0.345471234 0.043854340 -0.045754989 0.042252653 0.0759490822
[16,] -0.125261720 -0.044009941 -0.038087309 -0.005632529 -0.0257628871
[17,] -0.186858565 0.059114699 -0.020597992 0.131158708 0.0002749195
[18,] -0.084467293 0.015306005 -0.042915940 0.147469880 0.0451131700
[19,] -0.445272615 -0.037535570 -0.134221905 0.277502208 0.4166617599
[20,] 0.281039803 -0.009036970 0.055259707 0.370510348 0.1031882074
[21,] 0.054608631 0.008818523 0.122072513 0.049188458 0.2281362741
[22,] -0.070246675 -0.006563061 0.066392900 -0.160790899 0.3477743219
[23,] -0.083265820 -0.155911852 -0.009920710 -0.083917353 -0.2036970076
[24,] 0.028746530 0.083010695 -0.132560988 0.012759620 0.2155136789
[25,] 0.047744433 -0.013892510 -0.066408353 -0.334490166 0.1107057893
[26,] -0.144813898 -0.164221981 -0.061300419 0.336091348 0.0076777875
[27,] 0.109406645 0.012013959 -0.142521669 -0.277951207 0.1738230267
[28,] -0.129821177 -0.040972698 0.001666204 0.005050517 -0.3484818365
[29,] -0.225468022 -0.002916528 0.130088439 -0.101589776 -0.0392228419
[30,] -0.008070528 -0.029226987 -0.082802413 -0.141661933 0.2482592441
[31,] -0.033023535 -0.091587436 -0.125426180 0.055555795 -0.1335204541
[32,] -0.077530732 -0.132814787 0.054921851 -0.149994909 0.2546596137
[33,] 0.355572480 -0.136861370 -0.065721767 -0.089637271 -0.0665259148
[34,] 0.134140783 0.004832949 0.075579569 0.092881361 -0.0118432290
[35,] -0.116366850 -0.057965214 0.471138478 -0.060589418 0.0493774385
[36,] 0.063560297 -0.009548992 0.038871459 0.154381292 0.0564823582
[37,] -0.317281491 -0.032421788 0.083018952 -0.178889401 0.0171019778
[38,] -0.012643209 -0.007332023 -0.149161637 -0.073254962 0.0776256627
[,36] [,37] [,38]
[1,] 0.00000000 0.000000000 0.000000000
[2,] 0.04908889 0.069845597 -0.068254355
[3,] -0.15544008 0.293556511 -0.015717340
[4,] 0.09305493 -0.505847103 0.233541805
[5,] 0.04312052 0.098400453 -0.225882451
[6,] 0.30677304 -0.127891526 0.480646192
[7,] -0.34140596 0.301971238 0.381117271
[8,] 0.09044842 -0.134872369 0.154595915
[9,] 0.12208613 0.199103419 0.167002840
[10,] -0.13700978 -0.053554665 0.185867874
[11,] 0.29738611 0.237518833 0.189857766
[12,] -0.06715155 0.097406186 -0.040042151
[13,] 0.09164729 -0.129780609 -0.085687244
[14,] -0.07328013 -0.128009899 -0.085845819
[15,] -0.11141042 0.021294498 0.002410153
[16,] -0.21973962 -0.179536182 -0.042851385
[17,] 0.22472145 -0.114524588 -0.360761999
[18,] 0.11751507 -0.138484472 -0.043976046
[19,] -0.02887471 -0.101806904 0.015616838
[20,] 0.02412103 0.014620869 -0.135324730
[21,] -0.06768762 0.041164973 -0.018062501
[22,] 0.05196641 0.019692259 -0.013049174
[23,] 0.12633163 -0.237743589 0.001856761
[24,] 0.52812216 0.238252366 0.191657685
[25,] 0.07451977 -0.095845439 -0.065143305
[26,] 0.12210557 0.036304983 -0.216654922
[27,] -0.04011046 -0.011575053 0.106469257
[28,] 0.13673393 0.145534971 0.035847681
[29,] 0.02592175 0.036081333 0.058421706
[30,] -0.12793718 0.074962631 0.152607823
[31,] -0.09323225 -0.126818169 0.209867930
[32,] -0.15169084 -0.132079530 0.065868230
[33,] 0.13125011 0.006025224 -0.074011235
[34,] -0.01501806 0.098216096 0.067488471
[35,] -0.10712365 -0.119446515 0.130488673
[36,] -0.04099479 -0.278548074 0.133079441
[37,] 0.22571630 -0.016820819 -0.034434585
[38,] -0.06343310 0.104824976 -0.001208464
Menghitung nilai eigen dan vektor eigen dari matriks B, menyimpan nilai eigen yang dihitung ke dalam variabel nilai_eigen dan menyimpan vektor eigen yang dihitung ke dalam variabel vektor_eigen.
> # Menghitung tingkat kumulatif keragaman
> cumulative_variance <- cumsum(eigenvalues) / sum(eigenvalues)
> cumulative_variance
[1] 0.8738680 0.9497757 0.9763948 1.0000000 1.0000000 1.0000000 1.0000000
[8] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
[15] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
[22] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
[29] 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000 1.0000000
[36] 1.0000000 1.0000000 1.0000000
melakukan perhitungan persentase keragaman kumulatif yang bisa dijelaskan oleh setiap dimensi MDS. Hasil dari perhitungan ini memberikan gambaran tentang seberapa banyak informasi total (variasi data) yang dapat direpresentasikan jika kita mempertimbangkan 1 dimensi, 2 dimensi, dan seterusnya. Nilai yang semakin mendekati 1 (atau 100%) menunjukkan kualitas pemetaan MDS yang semakin baik.
> #Titik Koordinat objek
> fit <- cmdscale(matriks_jarak, k = 3)
> data_indeks$MDS1 <- fit[, 1]
> data_indeks$MDS2 <- fit[, 2]
> data_indeks$MDS3 <- if (ncol(fit) >= 3) fit[, 3] else NA
untuk menjalankan Classical Multidimensional Scaling dengan menginput matriks jarak antar provinsi dengan meminta menghasilkan 3 koordinat kedalam objek fit.
> # Hitung disparities
> disparities <- as.matrix(dist(fit))
> for (i in 1:n) {
+ for (j in 1:n) {
+ disparities[i, j] <- sqrt(sum((fit[i, ] - fit[j, ])^2))
+ }
+ }
> disparities
1 2 3 4 5 6 7
1 0.000000 37.617363 12.576302 36.147680 38.244901 45.776874 30.462489
2 37.617363 0.000000 25.965378 8.886900 13.060021 8.630259 13.014379
3 12.576302 25.965378 0.000000 23.715022 25.824812 33.741174 18.033905
4 36.147680 8.886900 23.715022 0.000000 4.532502 11.878258 6.341467
5 38.244901 13.060021 25.824812 4.532502 0.000000 13.862100 7.823901
6 45.776874 8.630259 33.741174 11.878258 13.862100 0.000000 18.034687
7 30.462489 13.014379 18.033905 6.341467 7.823901 18.034687 0.000000
8 54.699652 17.639550 42.525181 19.608133 20.045500 9.042412 25.949285
9 51.979247 14.531311 39.987473 17.843649 19.079007 6.273128 24.120582
10 15.205036 24.233299 3.030959 21.245993 23.097579 31.706828 15.354220
11 75.947397 42.789823 63.461352 40.292741 37.738665 34.658094 45.529251
12 51.738858 19.715529 39.247006 15.925517 13.602107 13.339797 21.288479
13 43.910749 11.239287 31.470265 7.771583 7.423064 7.510117 13.877009
14 43.277510 18.798906 31.009151 10.931018 6.544139 17.042287 13.600853
15 38.796174 6.700251 26.456444 3.623130 6.722168 8.273567 9.810513
16 50.532525 16.439782 38.041356 14.447599 13.412161 9.288316 20.442924
17 44.460732 8.384511 32.263074 9.597755 11.231934 2.680869 15.880836
18 18.361756 26.725167 8.772083 21.630425 22.204129 33.137710 15.294491
19 24.504138 14.458564 12.215693 11.698962 14.436038 21.743618 6.821236
20 23.203995 16.621836 10.796339 13.003565 15.165634 23.623804 7.342540
21 6.483519 37.022104 11.224465 34.045577 35.449931 44.647643 27.935160
22 34.290054 4.870236 22.229279 5.249413 9.746660 11.569962 8.163828
23 13.342938 48.584729 22.724813 45.326480 46.390548 56.145180 39.106859
24 33.724232 71.191961 45.426924 68.695825 69.954321 79.126287 62.557659
25 20.692441 19.190459 8.363262 15.643669 17.561595 26.315300 9.771887
26 9.340393 46.723497 21.850653 45.481214 47.546354 54.982295 39.778820
27 28.664829 9.383146 16.710243 8.949340 12.866408 17.127802 7.213933
28 2.295561 35.509010 10.936008 34.319962 36.575180 43.734052 28.765538
29 5.670204 43.214612 17.822746 41.416534 43.270819 51.306967 35.563021
30 4.340765 33.435432 8.250643 31.816600 33.941712 41.520867 26.148579
31 20.778226 58.045760 32.240768 55.495881 56.821225 65.931642 49.376726
32 14.457113 52.069814 26.756658 50.376623 52.172732 60.225554 44.494269
33 33.592457 71.208288 45.713365 69.231583 70.746759 79.320964 63.205750
34 32.015174 51.021546 36.019104 49.320625 50.292011 57.654707 44.740893
35 33.947897 71.400870 45.631124 68.878354 70.121034 79.326376 62.734110
36 23.266799 44.982008 28.145205 43.962259 45.553812 52.380410 39.146562
37 26.889829 52.606349 34.378482 51.919038 53.643999 60.248175 46.993797
38 27.253900 51.900860 34.235169 51.218883 52.914991 59.456156 46.374699
8 9 10 11 12 13 14
1 54.699652 51.979247 15.205036 75.94740 51.738858 43.910749 43.277510
2 17.639550 14.531311 24.233299 42.78982 19.715529 11.239287 18.798906
3 42.525181 39.987473 3.030959 63.46135 39.247006 31.470265 31.009151
4 19.608133 17.843649 21.245993 40.29274 15.925517 7.771583 10.931018
5 20.045500 19.079007 23.097579 37.73866 13.602107 7.423064 6.544139
6 9.042412 6.273128 31.706828 34.65809 13.339797 7.510117 17.042287
7 25.949285 24.120582 15.354220 45.52925 21.288479 13.877009 13.600853
8 0.000000 3.719420 40.369552 27.09046 11.905394 12.628565 20.536926
9 3.719420 0.000000 37.973319 30.79775 13.688171 11.831801 20.758240
10 40.369552 37.973319 0.000000 60.75646 36.602631 29.002753 28.143596
11 27.090460 30.797752 60.756459 0.00000 24.372384 32.881371 33.100670
12 11.905394 13.688171 36.602631 24.37238 0.000000 8.781840 10.616573
13 12.628565 11.831801 29.002753 32.88137 8.781840 0.000000 9.532846
14 20.536926 20.758240 28.143596 33.10067 10.616573 9.532846 0.000000
15 16.292983 14.314741 24.162220 38.47936 14.388021 5.631913 12.121420
16 8.308852 9.539335 35.584618 26.60129 4.505342 6.751347 12.555316
17 10.318356 8.256534 30.081380 34.40731 11.824881 4.937284 14.439596
18 41.234925 39.317351 6.458400 59.15130 35.636432 29.041647 26.067025
19 30.448102 28.015950 10.000552 51.89249 27.530601 19.432716 20.418003
20 32.182751 29.888477 8.276689 52.84559 28.558381 20.773038 20.757003
21 53.312436 50.917311 12.963205 72.85367 49.015867 41.766255 39.825504
22 20.429376 17.834943 20.198385 43.69956 19.643521 10.881661 16.119053
23 64.733384 62.414179 24.452778 83.30627 59.874001 52.976274 50.241660
24 87.894960 85.380576 47.546288 106.92436 83.474511 76.409382 73.863337
25 34.881660 32.582545 5.678227 55.28222 31.057688 23.403752 22.882663
26 63.936718 61.152115 24.470637 85.22445 61.052877 53.242158 52.458856
27 26.044201 23.363711 14.860406 48.94916 24.675662 16.078301 19.357717
28 52.686841 49.916331 13.671827 74.28481 50.013269 42.066541 41.777362
29 60.192037 57.529618 20.254611 80.90651 56.827944 49.187695 48.017685
30 50.418520 47.737931 10.923210 71.63964 47.415499 39.579164 39.044350
31 74.687825 72.189599 34.337892 93.96437 70.363566 63.217532 60.883425
32 69.130335 66.433989 29.186302 89.74918 65.738650 58.147152 56.783927
33 88.189557 85.544406 48.005375 108.03018 84.314201 76.986876 74.949172
34 65.342813 63.071594 36.340847 83.69512 61.961194 55.556784 54.148992
35 88.089834 85.582149 47.738507 107.07204 83.638951 76.589043 74.012642
36 60.655467 58.071027 28.985087 80.94107 57.981045 50.769996 50.163641
37 68.644320 65.947433 35.667532 89.30401 66.221745 58.861706 58.336255
38 67.785516 65.111395 35.422529 88.34750 65.380012 58.077023 57.577073
15 16 17 18 19 20 21
1 38.796174 50.532525 44.460732 18.361756 24.504138 23.203995 6.483519
2 6.700251 16.439782 8.384511 26.725167 14.458564 16.621836 37.022104
3 26.456444 38.041356 32.263074 8.772083 12.215693 10.796339 11.224465
4 3.623130 14.447599 9.597755 21.630425 11.698962 13.003565 34.045577
5 6.722168 13.412161 11.231934 22.204129 14.436038 15.165634 35.449931
6 8.273567 9.288316 2.680869 33.137710 21.743618 23.623804 44.647643
7 9.810513 20.442924 15.880836 15.294491 6.821236 7.342540 27.935160
8 16.292983 8.308852 10.318356 41.234925 30.448102 32.182751 53.312436
9 14.314741 9.539335 8.256534 39.317351 28.015950 29.888477 50.917311
10 24.162220 35.584618 30.081380 6.458400 10.000552 8.276689 12.963205
11 38.479362 26.601294 34.407313 59.151304 51.892491 52.845590 72.853674
12 14.388021 4.505342 11.824881 35.636432 27.530601 28.558381 49.015867
13 5.631913 6.751347 4.937284 29.041647 19.432716 20.773038 41.766255
14 12.121420 12.555316 14.439596 26.067025 20.418003 20.757003 39.825504
15 0.000000 12.067351 6.101618 25.027958 14.326324 15.931512 37.072170
16 12.067351 0.000000 8.225943 35.411090 26.086386 27.406196 48.320458
17 6.101618 8.225943 0.000000 31.118439 20.142421 21.888063 43.014462
18 25.027958 35.411090 31.118439 0.000000 12.512450 10.219414 13.887152
19 14.326324 26.086386 20.142421 12.512450 0.000000 2.316262 22.910607
20 15.931512 27.406196 21.888063 10.219414 2.316262 0.000000 21.143791
21 37.072170 48.320458 43.014462 13.887152 22.910607 21.143791 0.000000
22 5.276591 17.229233 10.204116 22.120870 10.222129 12.217656 33.108716
23 48.457118 59.452304 54.451391 24.253821 34.412724 32.565014 11.565627
24 71.699331 82.938504 77.595956 47.871523 57.454658 55.773566 34.650553
25 18.624370 30.031275 24.584218 8.001052 4.733973 2.705440 18.458440
26 48.106344 59.851066 53.730273 27.010812 33.833282 32.535657 13.389996
27 10.542818 22.594547 15.839652 17.646239 5.163272 7.427998 27.690985
28 36.879520 48.693806 42.474053 17.461814 22.635899 21.456074 7.313371
29 44.181481 55.803793 49.923648 22.375943 29.860383 28.417891 8.663097
30 34.476344 46.194674 40.169036 14.645327 20.181979 18.877677 6.141529
31 58.490114 69.759225 64.388565 34.830165 44.248295 42.565248 21.451795
32 53.143286 64.754487 58.872827 30.897792 38.824368 37.375624 17.012125
33 72.109934 83.565040 77.910014 48.883214 57.798940 56.240663 35.301523
34 51.722552 61.812065 56.252140 36.499400 41.087525 40.195202 32.033965
35 71.888898 83.117452 77.789422 48.029660 57.648466 55.961467 34.834418
36 46.326093 57.313188 51.111540 30.369773 34.475221 33.646374 24.426098
37 54.260014 65.449690 59.066149 37.268238 41.959578 41.097877 28.931610
38 53.532951 64.633090 58.275639 36.977095 41.445098 40.616559 29.158457
22 23 24 25 26 27 28
1 34.290054 13.342938 33.7242319 20.692441 9.340393 28.664829 2.295561
2 4.870236 48.584729 71.1919610 19.190459 46.723497 9.383146 35.509010
3 22.229279 22.724813 45.4269243 8.363262 21.850653 16.710243 10.936008
4 5.249413 45.326480 68.6958246 15.643669 45.481214 8.949340 34.319962
5 9.746660 46.390548 69.9543211 17.561595 47.546354 12.866408 36.575180
6 11.569962 56.145180 79.1262868 26.315300 54.982295 17.127802 43.734052
7 8.163828 39.106859 62.5576587 9.771887 39.778820 7.213933 28.765538
8 20.429376 64.733384 87.8949596 34.881660 63.936718 26.044201 52.686841
9 17.834943 62.414179 85.3805764 32.582545 61.152115 23.363711 49.916331
10 20.198385 24.452778 47.5462876 5.678227 24.470637 14.860406 13.671827
11 43.699563 83.306266 106.9243611 55.282224 85.224454 48.949161 74.284809
12 19.643521 59.874001 83.4745113 31.057688 61.052877 24.675662 50.013269
13 10.881661 52.976274 76.4093825 23.403752 53.242158 16.078301 42.066541
14 16.119053 50.241660 73.8633371 22.882663 52.458856 19.357717 41.777362
15 5.276591 48.457118 71.6993313 18.624370 48.106344 10.542818 36.879520
16 17.229233 59.452304 82.9385036 30.031275 59.851066 22.594547 48.693806
17 10.204116 54.451391 77.5959556 24.584218 53.730273 15.839652 42.474053
18 22.120870 24.253821 47.8715228 8.001052 27.010812 17.646239 17.461814
19 10.222129 34.412724 57.4546585 4.733973 33.833282 5.163272 22.635899
20 12.217656 32.565014 55.7735664 2.705440 32.535657 7.427998 21.456074
21 33.108716 11.565627 34.6505534 18.458440 13.389996 27.690985 7.313371
22 0.000000 44.628692 67.5697074 14.871953 43.545326 5.643998 32.284003
23 44.628692 0.000000 23.6306113 29.873494 10.951021 39.244801 15.540168
24 67.569707 23.630611 0.0000000 53.093914 25.288594 62.030676 35.941345
25 14.871953 29.873494 53.0939139 0.000000 30.011082 9.879840 19.019304
26 43.545326 10.951021 25.2885944 30.011082 0.000000 37.907395 11.270313
27 5.643998 39.244801 62.0306761 9.879840 37.907395 0.000000 26.648498
28 32.284003 15.540168 35.9413449 19.019304 11.270313 26.648498 0.000000
29 39.783763 8.954369 28.0630575 25.823158 4.771836 34.180837 7.914562
30 30.015978 16.255360 37.7890568 16.384853 13.665138 24.401033 2.870470
31 54.374826 10.770163 13.2094375 39.887338 13.206658 48.849317 23.040969
32 48.720305 9.962943 19.5774826 34.771652 5.743793 43.105540 16.576422
33 67.790875 24.888192 4.2413842 53.590372 24.670826 62.194899 35.723336
34 48.101147 33.308006 44.3590933 38.427591 33.342483 44.215479 32.171196
35 67.768371 23.787441 0.3292449 53.280009 25.538910 62.233408 36.167290
36 42.142491 26.933432 40.1673522 31.714387 24.995845 37.678806 23.260663
37 49.891326 28.484605 36.3650947 39.022410 25.646680 45.215171 27.352475
38 49.212525 29.185200 37.7123922 38.595230 26.492023 44.629825 27.619462
29 30 31 32 33 34 35
1 5.670204 4.340765 20.77823 14.457113 33.592457 32.015174 33.9478972
2 43.214612 33.435432 58.04576 52.069814 71.208288 51.021546 71.4008703
3 17.822746 8.250643 32.24077 26.756658 45.713365 36.019104 45.6311239
4 41.416534 31.816600 55.49588 50.376623 69.231583 49.320625 68.8783542
5 43.270819 33.941712 56.82123 52.172732 70.746759 50.292011 70.1210340
6 51.306967 41.520867 65.93164 60.225554 79.320964 57.654707 79.3263760
7 35.563021 26.148579 49.37673 44.494269 63.205750 44.740893 62.7341097
8 60.192037 50.418520 74.68783 69.130335 88.189557 65.342813 88.0898337
9 57.529618 47.737931 72.18960 66.433989 85.544406 63.071594 85.5821493
10 20.254611 10.923210 34.33789 29.186302 48.005375 36.340847 47.7385067
11 80.906507 71.639635 93.96437 89.749180 108.030176 83.695123 107.0720363
12 56.827944 47.415499 70.36357 65.738650 84.314201 61.961194 83.6389512
13 49.187695 39.579164 63.21753 58.147152 76.986876 55.556784 76.5890430
14 48.017685 39.044350 60.88343 56.783927 74.949172 54.148992 74.0126420
15 44.181481 34.476344 58.49011 53.143286 72.109934 51.722552 71.8888982
16 55.803793 46.194674 69.75923 64.754487 83.565040 61.812065 83.1174523
17 49.923648 40.169036 64.38856 58.872827 77.910014 56.252140 77.7894217
18 22.375943 14.645327 34.83016 30.897792 48.883214 36.499400 48.0296604
19 29.860383 20.181979 44.24829 38.824368 57.798940 41.087525 57.6484664
20 28.417891 18.877677 42.56525 37.375624 56.240663 40.195202 55.9614673
21 8.663097 6.141529 21.45179 17.012125 35.301523 32.033965 34.8344175
22 39.783763 30.015978 54.37483 48.720305 67.790875 48.101147 67.7683707
23 8.954369 16.255360 10.77016 9.962943 24.888192 33.308006 23.7874412
24 28.063057 37.789057 13.20944 19.577483 4.241384 44.359093 0.3292449
25 25.823158 16.384853 39.88734 34.771652 53.590372 38.427591 53.2800091
26 4.771836 13.665138 13.20666 5.743793 24.670826 33.342483 25.5389104
27 34.180837 24.401033 48.84932 43.105540 62.194899 44.215479 62.2334081
28 7.914562 2.870470 23.04097 16.576422 35.723336 32.171196 36.1672898
29 0.000000 9.801817 15.12841 8.965937 28.015812 31.783596 28.2844015
30 9.801817 0.000000 24.71197 18.713007 37.807919 32.752073 38.0053220
31 15.128409 24.711972 0.00000 7.721990 14.123072 36.406163 13.4024021
32 8.965937 18.713007 7.72199 0.000000 19.147926 34.124176 19.8221305
33 28.015812 37.807919 14.12307 19.147926 0.000000 44.495913 4.4567996
34 31.783596 32.752073 36.40616 34.124176 44.495913 0.000000 44.3960806
35 28.284401 38.005322 13.40240 19.822130 4.456800 44.396081 0.0000000
36 23.526978 24.143199 30.63039 26.772848 39.880272 9.693043 40.2702140
37 25.628821 28.903694 29.11110 26.062441 35.624587 11.853336 36.4502891
38 26.257933 29.061246 30.24027 27.108006 37.033858 10.603652 37.7961083
36 37 38
1 23.266799 26.889829 27.253900
2 44.982008 52.606349 51.900860
3 28.145205 34.378482 34.235169
4 43.962259 51.919038 51.218883
5 45.553812 53.643999 52.914991
6 52.380410 60.248175 59.456156
7 39.146562 46.993797 46.374699
8 60.655467 68.644320 67.785516
9 58.071027 65.947433 65.111395
10 28.985087 35.667532 35.422529
11 80.941066 89.304007 88.347500
12 57.981045 66.221745 65.380012
13 50.769996 58.861706 58.077023
14 50.163641 58.336255 57.577073
15 46.326093 54.260014 53.532951
16 57.313188 65.449690 64.633090
17 51.111540 59.066149 58.275639
18 30.369773 37.268238 36.977095
19 34.475221 41.959578 41.445098
20 33.646374 41.097877 40.616559
21 24.426098 28.931610 29.158457
22 42.142491 49.891326 49.212525
23 26.933432 28.484605 29.185200
24 40.167352 36.365095 37.712392
25 31.714387 39.022410 38.595230
26 24.995845 25.646680 26.492023
27 37.678806 45.215171 44.629825
28 23.260663 27.352475 27.619462
29 23.526978 25.628821 26.257933
30 24.143199 28.903694 29.061246
31 30.630392 29.111103 30.240271
32 26.772848 26.062441 27.108006
33 39.880272 35.624587 37.033858
34 9.693043 11.853336 10.603652
35 40.270214 36.450289 37.796108
36 0.000000 8.389836 7.444404
37 8.389836 0.000000 1.507822
38 7.444404 1.507822 0.000000
menghitung jarak antar objek di ruang MDS baik secara otomatis (dist(fit)) maupun secara manual melalui loop. Hasil akhirnya adalah matriks disparities yang menggambarkan jarak Euclidean antara setiap pasangan titik dalam ruang MDS.
> # Hitung stress
> stress <- sqrt(sum((matriks_jarak - disparities)^2) / sum(matriks_jarak^2))
> cat("Nilai STRESS:", stress, "\n")
Nilai STRESS: 0.05144343
untuk menghitung nilai STRESS, yaiyu ukuran seberapa baik hasil MDS mampu mempresentasikan jarak asli antar objek.
> # Jumlah dimensi yang ingin diuji
> max_dim <- 4
> stress_values <- numeric(max_dim)
> for (k in 1:max_dim) {
+ fit_k <- cmdscale(matriks_jarak, k = k)
+ disparities_k <- as.matrix(dist(fit_k))
+ stress_values[k] <- sqrt(sum((matriks_jarak - disparities_k)^2) / sum(matriks_jarak^2)) # Nilai stress
+ }
> stress_values
[1] 1.654358e-01 7.896208e-02 5.144343e-02 8.226927e-16
Menghitung nilai STRESS untuk setiap dimensi hingga dimensi maksimum.
> #Grafik STRESS
> plot(1:max_dim, stress_values, type = "b", pch = 19, col = "blue",
+ xlab = "Dimensi", ylab = "Nilai STRESS",
+ main = "Grafik STRESS setiap Dimensi",
+ ylim = c(min(stress_values) - 0.01, max(stress_values) + 0.01))
> abline(h = 0.01, col = "red", lty = 2)
menghasilkan grafik STRESS untuk setiap dimensi MDS, yang memungkinkan
kita untuk memantau perubahan nilai STRESS mulai dari dimensi pertama
hingga dimensi tertinggi. Titik di dalam grafik mewakili STRESS untuk
setiap dimensi, sedangkan garis putus-putus merah yang berada di nilai
0.01 berfungsi sebagai panduan kualitas (semakin mendekati garis itu,
semakin baik).menghasilkan grafik STRESS untuk setiap dimensi MDS, yang
memungkinkan kita untuk memantau perubahan nilai STRESS mulai dari
dimensi pertama hingga dimensi tertinggi. Titik di dalam grafik mewakili
STRESS untuk setiap dimensi, sedangkan garis putus-putus merah yang
berada di nilai 0.01 berfungsi sebagai panduan kualitas (semakin
mendekati garis itu, semakin baik).
> #Visualisasi 2 Dimensi
> plot(
+ data_indeks$MDS1, data_indeks$MDS2,
+ type = "n",
+ main = "Visualisasi MDS 2D Provinsi di Indonesia berdasarkan Kualitas Lingkungan Hidup 2023",
+ xlab = "Dimensi 1",
+ ylab = "Dimensi 2"
+ )
> abline(h = 0, col = "red", lty = 2)
> abline(v = 0, col = "red", lty = 2)
> points(data_indeks$MDS1, data_indeks$MDS2, pch = 16, col = "blue")
> text(data_indeks$MDS1, data_indeks$MDS2, labels = data_indeks$Provinsi, cex = 0.8, pos = 3)
membuat visualisasi MDS dalam bentuk scatter plot 2 dimensi menggunakan
koordinat MDS1 dan MDS2. Plot ini menampilkan posisi tiap provinsi
berdasarkan kemiripan kualitas lingkungan hidup tahun 2023.
Nilai STRESS mengalami penurunan signifikan dari dimensi 1 ke dimensi 2, yang menunjukkan bahwa penambahan dimensi kedua sangat memperbaiki kualitas representasi jarak antar provinsi.
STRESS di dimensi 2 sudah mencapai kategori yang baik, sehingga dua dimensi ini sudah cukup optimal dalam menjelaskan pola kesamaan kualitas lingkungan hidup antar provinsi.
Penurunan STRESS setelah dimensi 2 bersifat lebih kecil, sehingga tidak ada kebutuhan untuk menambahkan dimensi untuk tujuan visualisasi dan interpretasi.
A. Pola Umum Pemetaan
B. Provinsi Papua Sangat Berbeda (Dimensi 1 & 2)
C. Provinsi yang Menyimpang Moderat
D. Kelompok Provinsi yang Memiliki Kemiripan Tinggi
Badan Pusat Statistik Indonesia. (16 September 2025). Komponen Penyusun Indeks Kualitas Lingkungan Hidup Menurut Provinsi, 2023. Diakses pada 20 November 2025, dari https://www.bps.go.id/id/statistics-table/2/MjUzMiMy/komponen-penyusun-indeks-kualitas-lingkungan-hidup-menurut-provinsi.html
Johnson, R. A., & Wichern, D. W. (2007). Applied multivariate statistical analysis (6th ed.). Pearson.