IMPORT DATA BPS

data_bps <- read.csv2(
  "C:/Users/Lenovo/Downloads/Dataset_BPS_Sakernas_2018_2023_Cleaned.csv",
  stringsAsFactors = FALSE,
  check.names = TRUE
)

head(data_bps)
names(data_bps)
##  [1] "Tahun"                      "Sektor"                    
##  [3] "Kode.Sektor"                "Tidak.belum.pernah.sekolah"
##  [5] "Tidak.belum.tamat.SD"       "SD"                        
##  [7] "SLTP"                       "SLTA.Umum.SMU"             
##  [9] "SLTA.Kejuruan.SMK"          "Akademi.Diploma"           
## [11] "Universitas"                "Total"

TRANSFORMASI DATA BPS

data_bps <- data_bps %>%
  mutate(
    across(
      c(
        Tidak.belum.pernah.sekolah,
        Tidak.belum.tamat.SD,
        SD,
        SLTP,
        SLTA.Umum.SMU,
        SLTA.Kejuruan.SMK,
        Akademi.Diploma,
        Universitas,
        Total
      ),
      as.numeric
    )
  )

head(data_bps)

IMPORT DATA KLHK

data_klhk <- read_excel(
  "C:/Users/Lenovo/Downloads/SIPSN 2018 2023.xlsx"
)

head(data_klhk)
names(data_klhk)
## [1] "Tahun"                                                
## [2] "Timbulan Sampah Nasional (Ton/Tahun)"                 
## [3] "Sampah Terkelola (%)"                                 
## [4] "Sampah Tidak Terkelola / Unmanaged (%)"               
## [5] "Volume Sampah Liar / Kebocoran Lingkungan (Ton/Tahun)"

RENAME DATA KLHK

data_klhk <- data_klhk %>%
  rename(
    Tahun = 1,
    Timbulan_Sampah = 2,
    Sampah_Terkelola = 3,
    Sampah_Unmanaged = 4
  )

head(data_klhk)

DATA ESDM

data_esdm <- data.frame(

  Tahun = 2018:2023,

  Total_Energi_Industri_BOE = c(
    308101365,
    363534776,
    297942171,
    286850949,
    511714610,
    556383954
  ),

  Batu_Bara_Thousand_BOE = c(
    100506,
    167412,
    113416,
    87820,
    299191,
    316754
  ),

  Biomassa_Thousand_BOE = c(
    342,
    555,
    637,
    1309,
    4524,
    20452
  ),

  Share_Industri = c(
    39.8,
    40.5,
    38.7,
    39.9,
    43.2,
    45.6
  ),

  Share_Batubara = c(
    22.1,
    23.4,
    24.0,
    24.7,
    25.1,
    25.95
  ),

  Share_Biomassa = c(
    0.5,
    0.7,
    0.9,
    1.1,
    1.4,
    1.68
  ),

  Potensi_RDF_BOE = c(
    12000,
    18000,
    26000,
    42000,
    76000,
    98000
  )
)

data_esdm

ANALISIS SKILL GAP

skill_gap_sampah <- data_bps %>%
  filter(Kode.Sektor == "Sektor E") %>%
  mutate(
    Pendidikan_Rendah =
      Tidak.belum.pernah.sekolah +
      Tidak.belum.tamat.SD +
      SD +
      SLTP,

    Pendidikan_Tinggi =
      SLTA.Umum.SMU +
      SLTA.Kejuruan.SMK +
      Akademi.Diploma +
      Universitas,

    Rasio_Skill_Gap =
      (Pendidikan_Rendah / Total) * 100
  ) %>%
  select(
    Tahun,
    Total_Pekerja_Sampah = Total,
    Pendidikan_Rendah,
    Pendidikan_Tinggi,
    Rasio_Skill_Gap
  )

skill_gap_sampah

ANALISIS POTENSI ENERGI SAMPAH

potensi_energi_sampah <- data_klhk %>%
  mutate(
    Potensi_Energi_BOE =
      Timbulan_Sampah * 0.35
  ) %>%
  select(
    Tahun,
    Timbulan_Sampah,
    Sampah_Terkelola,
    Sampah_Unmanaged,
    Potensi_Energi_BOE
  )

potensi_energi_sampah

INTEGRASI DATA

tabel_sinergi_final <- data_esdm %>%
  inner_join(
    potensi_energi_sampah,
    by = "Tahun"
  ) %>%
  inner_join(
    skill_gap_sampah,
    by = "Tahun"
  ) %>%
  mutate(
    Rasio_Substitusi_Batubara =
      (
        Potensi_Energi_BOE /
        (Batu_Bara_Thousand_BOE * 1000)
      ) * 100
  )

tabel_sinergi_final

UJI CHI-SQUARE

total_rendah <- sum(
  skill_gap_sampah$Pendidikan_Rendah,
  na.rm = TRUE
)

total_tinggi <- sum(
  skill_gap_sampah$Pendidikan_Tinggi,
  na.rm = TRUE
)

total_terkelola <- sum(
  potensi_energi_sampah$Sampah_Terkelola,
  na.rm = TRUE
)

total_unmanaged <- sum(
  potensi_energi_sampah$Sampah_Unmanaged,
  na.rm = TRUE
)

matriks_uji <- matrix(
  c(
    total_rendah,
    total_tinggi,
    total_terkelola,
    total_unmanaged
  ),
  nrow = 2
)

hasil_uji <- chisq.test(matriks_uji)

hasil_uji
## 
##  Pearson's Chi-squared test with Yates' continuity correction
## 
## data:  matriks_uji
## X-squared = 9.9958e-21, df = 1, p-value = 1

VISUALISASI 1

TREN ENERGI INDUSTRI

ggplot(
  data_esdm,
  aes(
    x = Tahun,
    y = Total_Energi_Industri_BOE / 1000000
  )
) +
  geom_line(
    color = "#1B5E20",
    linewidth = 1.5
  ) +
  geom_point(
    color = "#2E7D32",
    size = 4
  ) +
  labs(
    title = "Tren Konsumsi Energi Industri Indonesia",
    x = "Tahun",
    y = "Juta BOE"
  ) +
  theme_minimal()

VISUALISASI 2

SHARE INDUSTRI NASIONAL

ggplot(
  data_esdm,
  aes(
    x = factor(Tahun),
    y = Share_Industri
  )
) +
  geom_col(
    fill = "#2E7D32",
    width = 0.7
  ) +
  geom_text(
    aes(label = paste0(Share_Industri, "%")),
    vjust = -0.5,
    fontface = "bold"
  ) +
  labs(
    title = "Kontribusi Energi Industri terhadap Nasional",
    x = "Tahun",
    y = "Persentase (%)"
  ) +
  theme_minimal()

VISUALISASI 3

BATUBARA VS BIOMASSA

data_bauran <- data_esdm %>%
  select(
    Tahun,
    Batu_Bara_Thousand_BOE,
    Biomassa_Thousand_BOE
  ) %>%
  pivot_longer(
    cols = -Tahun,
    names_to = "Jenis_Energi",
    values_to = "Jumlah"
  )

ggplot(
  data_bauran,
  aes(
    x = factor(Tahun),
    y = Jumlah,
    fill = Jenis_Energi
  )
) +
  geom_col(
    position = "dodge"
  ) +
  scale_fill_manual(
    values = c(
      "#1B5E20",
      "#81C784"
    )
  ) +
  labs(
    title = "Perbandingan Batubara dan Biomassa",
    x = "Tahun",
    y = "Ribu BOE"
  ) +
  theme_minimal()

VISUALISASI 4

GAP ENERGI FOSIL VS HIJAU

data_gap <- data_esdm %>%
  select(
    Tahun,
    Share_Batubara,
    Share_Biomassa
  ) %>%
  pivot_longer(
    cols = -Tahun,
    names_to = "Jenis",
    values_to = "Persentase"
  )

ggplot(
  data_gap,
  aes(
    x = factor(Tahun),
    y = Persentase,
    fill = Jenis
  )
) +
  geom_col(
    position = "dodge"
  ) +
  scale_fill_manual(
    values = c(
      "#1B5E20",
      "#66BB6A"
    )
  ) +
  labs(
    title = "Kesenjangan Energi Fosil vs Energi Hijau",
    x = "Tahun",
    y = "Persentase (%)"
  ) +
  theme_minimal()

VISUALISASI 5

POTENSI ENERGI SAMPAH

ggplot(
  tabel_sinergi_final,
  aes(
    x = factor(Tahun),
    y = Potensi_Energi_BOE / 1000000
  )
) +
  geom_col(
    fill = "#388E3C",
    width = 0.7
  ) +
  geom_text(
    aes(
      label = round(
        Potensi_Energi_BOE / 1000000,
        2
      )
    ),
    vjust = -0.5,
    fontface = "bold"
  ) +
  labs(
    title = "Potensi Energi dari Sampah Nasional",
    x = "Tahun",
    y = "Juta BOE"
  ) +
  theme_minimal()

VISUALISASI 6

SKILL GAP TENAGA KERJA

ggplot(
  skill_gap_sampah,
  aes(
    x = factor(Tahun),
    y = Rasio_Skill_Gap
  )
) +
  geom_col(
    fill = "#43A047",
    width = 0.7
  ) +
  geom_text(
    aes(
      label = paste0(round(Rasio_Skill_Gap,1), "%")
    ),
    vjust = -0.5,
    fontface = "bold"
  ) +
  labs(
    title = "Skill Gap Tenaga Kerja Sektor Sampah",
    x = "Tahun",
    y = "Persentase (%)"
  ) +
  theme_minimal()

VISUALISASI 7

PARADOKS TRANSISI HIJAU

ggplot(
  tabel_sinergi_final,
  aes(x = Tahun)
) +
  geom_line(
    aes(
      y = Rasio_Skill_Gap,
      color = "Skill Gap"
    ),
    linewidth = 1.5
  ) +
  geom_point(
    aes(
      y = Rasio_Skill_Gap,
      color = "Skill Gap"
    ),
    size = 3
  ) +
  geom_line(
    aes(
      y = Rasio_Substitusi_Batubara,
      color = "Substitusi Energi"
    ),
    linewidth = 1.5,
    linetype = "dashed"
  ) +
  geom_point(
    aes(
      y = Rasio_Substitusi_Batubara,
      color = "Substitusi Energi"
    ),
    size = 3
  ) +
  scale_color_manual(
    values = c(
      "Skill Gap" = "#1B5E20",
      "Substitusi Energi" = "#81C784"
    )
  ) +
  labs(
    title = "Paradoks Transisi Hijau",
    x = "Tahun",
    y = "Persentase (%)",
    color = "Indikator"
  ) +
  theme_minimal()

VISUALISASI 8

POTENSI RDF / WASTE TO ENERGY

ggplot(
  data_esdm,
  aes(
    x = Tahun,
    y = Potensi_RDF_BOE
  )
) +
  geom_line(
    color = "#2E7D32",
    linewidth = 1.5
  ) +
  geom_point(
    color = "#1B5E20",
    size = 4
  ) +
  labs(
    title = "Potensi Waste-to-Energy / RDF",
    x = "Tahun",
    y = "BOE"
  ) +
  theme_minimal()