IMPORT DATA BPS

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

head(data_bps)
colnames(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)
colnames(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)"

TRANSFORMASI DATA KLHK

data_klhk <- data_klhk %>%
  mutate(
    Tahun = as.numeric(Tahun)
  )

head(data_klhk)

DATA ENERGI INDUSTRI 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_Industry = c(
    42.1,
    43.0,
    41.2,
    42.8,
    44.1,
    45.6
  ),

  Share_Coal = c(
    22.4,
    23.5,
    23.8,
    24.1,
    25.0,
    25.95
  ),

  Share_Biomassa = c(
    0.8,
    0.9,
    1.0,
    1.1,
    1.3,
    1.68
  )
)

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 =
      `Volume Sampah Liar / Kebocoran Lingkungan (Ton/Tahun)` * 0.35

  ) %>%
  select(
    Tahun,

    Timbulan_Sampah =
      `Timbulan Sampah Nasional (Ton/Tahun)`,

    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(
  data_klhk$`Sampah Terkelola (%)`,
  na.rm = TRUE
)

total_unmanaged <- sum(
  data_klhk$`Sampah Tidak Terkelola / 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

FORECAST KONSUMSI ENERGI INDUSTRI (ETS)

ts_energi <- ts(
  data_esdm$Total_Energi_Industri_BOE,
  start = 2018,
  frequency = 1
)

model_ets <- ets(ts_energi)

forecast_energi <- forecast(
  model_ets,
  h = 3
)

forecast_energi
##      Point Forecast     Lo 80     Hi 80     Lo 95     Hi 95
## 2024      607593104 490679529 724506680 428789221 786396988
## 2025      663026515 513828251 812224780 434847461 891205570
## 2026      718459926 542814089 894105764 449832800 987087053

VISUALISASI TREN KONSUMSI ENERGI INDUSTRI

ggplot(
  data_esdm,
  aes(
    x = Tahun,
    y = Total_Energi_Industri_BOE / 1000000
  )
) +

  geom_line(
    color = "#D9534F",
    linewidth = 1.5
  ) +

  geom_point(
    color = "#D9534F",
    size = 3
  ) +

  geom_text(
    aes(
      label = round(
        Total_Energi_Industri_BOE / 1000000,
        1
      )
    ),
    vjust = -1
  ) +

  labs(
    title = "Tren Konsumsi Energi Industri Indonesia",
    x = "Tahun",
    y = "Juta BOE"
  ) +

  theme_minimal()

VISUALISASI POTENSI ENERGI WtE

ggplot(
  tabel_sinergi_final,
  aes(
    x = factor(Tahun),
    y = Potensi_Energi_BOE / 1000000
  )
) +

  geom_bar(
    stat = "identity",
    fill = "#2E8B57",
    width = 0.6
  ) +

  geom_text(
    aes(
      label = round(
        Potensi_Energi_BOE / 1000000,
        2
      )
    ),
    vjust = -0.5,
    fontface = "bold"
  ) +

  labs(
    title = "Potensi Energi Waste-to-Energy",
    x = "Tahun",
    y = "Potensi Energi (Juta BOE)"
  ) +

  theme_minimal()

VISUALISASI GAP BATUBARA VS BIOMASSA

data_bauran <- data.frame(
  Jenis = c("Batubara", "Biomassa"),
  Nilai = c(25.95, 1.68)
)

ggplot(
  data_bauran,
  aes(
    x = Jenis,
    y = Nilai,
    fill = Jenis
  )
) +

  geom_col(width = 0.6) +

  geom_text(
    aes(
      label = paste0(Nilai, "%")
    ),
    vjust = -0.5,
    fontface = "bold"
  ) +

  labs(
    title = "Ketimpangan Energi Fosil vs Energi Hijau",
    y = "Persentase (%)"
  ) +

  theme_minimal()

VISUALISASI SKILL GAP

ggplot(
  skill_gap_sampah,
  aes(
    x = factor(Tahun),
    y = Rasio_Skill_Gap
  )
) +

  geom_col(
    fill = "#428BCA",
    width = 0.6
  ) +

  geom_text(
    aes(
      label = round(
        Rasio_Skill_Gap,
        1
      )
    ),
    vjust = -0.5,
    fontface = "bold"
  ) +

  labs(
    title = "Skill Gap Tenaga Kerja Sektor Sampah",
    x = "Tahun",
    y = "Persentase Pendidikan Rendah (%)"
  ) +

  theme_minimal()

VISUALISASI PARADOKS TRANSISI HIJAU

ggplot(
  tabel_sinergi_final,
  aes(x = Tahun)
) +

  geom_line(
    aes(
      y = Rasio_Skill_Gap,
      color = "Skill Gap"
    ),
    linewidth = 1.3
  ) +

  geom_point(
    aes(
      y = Rasio_Skill_Gap,
      color = "Skill Gap"
    ),
    size = 3
  ) +

  geom_line(
    aes(
      y = Rasio_Substitusi_Batubara,
      color = "Substitusi Batubara"
    ),
    linewidth = 1.3,
    linetype = "dashed"
  ) +

  geom_point(
    aes(
      y = Rasio_Substitusi_Batubara,
      color = "Substitusi Batubara"
    ),
    size = 3
  ) +

  labs(
    title = "Paradoks Transisi Hijau Indonesia",
    x = "Tahun",
    y = "Persentase (%)",
    color = "Indikator"
  ) +

  theme_minimal()

PIE CHART BAURAN ENERGI NASIONAL

data_pie <- data.frame(
  Energi = c(
    "Coal",
    "Oil Fuel",
    "Electricity",
    "Industrial Biomass"
  ),

  Persentase = c(
    25.95,
    21.60,
    15.85,
    1.68
  )
)

ggplot(
  data_pie,
  aes(
    x = "",
    y = Persentase,
    fill = Energi
  )
) +

  geom_col(width = 1) +

  coord_polar("y", start = 0) +

  geom_text(
    aes(
      label = paste0(Persentase, "%")
    ),
    position = position_stack(vjust = 0.5)
  ) +

  labs(
    title = "Bauran Energi Nasional Tahun 2023"
  ) +

  theme_void()