Visualizing Indonesia HDI 2024

Posted on

Introduction

The Human Development Index (HDI) is a widely used composite indicator for assessing the overall level of human development in a region. It reflects achievements in three fundamental dimensions of human well-being: health, education, and standard of living. By integrating these dimensions into a single index, HDI provides a comprehensive measure that goes beyond purely economic indicators and captures broader aspects of social development.

In Indonesia, HDI plays a crucial role in evaluating regional development performance and identifying disparities across provinces. Despite continuous national improvements over recent decades, substantial spatial inequality in human development persists. Differences in access to education, health services, and economic opportunities contribute to uneven development outcomes between western and eastern regions, as well as between urbanized and less-developed provinces. Understanding these spatial patterns is essential for designing targeted and evidence-based development policies.

The year 2024 represents an important reference point for analyzing Indonesia’s current human development landscape, as it reflects recent socioeconomic conditions following post-pandemic recovery efforts and ongoing structural transformation. Provincial-level HDI data for 2024 provide valuable insights into how development outcomes vary geographically and how provinces position themselves relative to national development goals.

Visualization plays a key role in enhancing the interpretation of HDI data. Spatial visualization, particularly thematic mapping, allows researchers and policymakers to intuitively identify regional patterns, clusters, and disparities that may not be evident from tabular data alone. By presenting HDI values on a map, differences between provinces can be communicated more effectively, supporting both analytical understanding and policy discussion.

This article aims to visualize the 2024 Human Development Index across all provinces in Indonesia using the R programming language. By employing spatial data analysis and mapping techniques, the study demonstrates how open-source statistical tools can be used to produce clear, reproducible, and informative visual representations of regional development indicators. The resulting visualization is expected to support exploratory analysis of spatial disparities in human development and serve as a useful reference for researchers, students, and policymakers interested in regional development analysis in Indonesia. This study utilizes provincial-level Human Development Index (HDI) data for the year 2024 published by Statistics Indonesia (Badan Pusat Statistik, BPS).

Data Processing

All data processing and visualization were conducted using the R programming language, ensuring transparency and reproducibility. Spatial data handling was performed using the sf package, which provides a standardized framework for working with simple feature objects in R.

The processing steps included:

  1. Importing the provincial shapefile and HDI dataset into R.
  2. Harmonizing province names and identifiers to avoid mismatches during the join process.
  3. Merging attribute data with spatial geometries using a left join operation.
  4. Checking and correcting invalid geometries using spatial validation functions to prevent rendering errors.
  5. Removing empty or duplicated geometries when necessary.

Visualization Method

The spatial visualization of HDI was produced using the ggplot2 package, which provides a flexible and layered grammar of graphics. Provincial boundaries were rendered using geom_sf(), with HDI values mapped to polygon fill colors.

A continuous color gradient was applied to represent HDI variation across provinces, where lighter colors indicate lower HDI values and darker colors indicate higher HDI values. This approach facilitates intuitive comparison and highlights spatial disparities in human development levels. Additional cartographic elements, including a north arrow and scale bar, were added using the ggspatial package to improve map readability and geographic orientation.

Discussion

Data and materials obtained from here

library(readxl)
library(tidyverse)
library(ggplot2)
library(sp)
library(sf)
library(spgwr)
library(spdep)
library(spData)
library(GWmodel)
df <- read_excel("D:/personal/akhor umur/statspatial.com/posts/ipm visualization/ipm 2024.xlsx")
df
str(df)

result:
tibble [38 × 3] (S3: tbl_df/tbl/data.frame)
 $ id      : chr [1:38] "11" "12" "13" "14" ...
 $ province: chr [1:38] "ACEH" "SUMATERA UTARA" "SUMATERA BARAT" "RIAU" ...
 $ ipm     : num [1:38] 74 74 74.5 74.8 73.4 ...

dfipm<-df%>% dplyr::select(id,province,ipm)
str(dfipm)
hist(dfipm$ipm,main = "HDI Distribution",xlab="ipm") 
histogram_hdi
petaprov <- st_read(file.path("D:/Provinsi SHP/Provinsi.shp"))
print(petaprov)

result:
Simple feature collection with 38 features and 3 fields
Geometry type: MULTIPOLYGON
Dimension:     XY, XYZ
Bounding box:  xmin: 94.97191 ymin: -11.00762 xmax: 141.02 ymax: 6.076832
z_range:       zmin: 0 zmax: 0
Geodetic CRS:  WGS 84
First 10 features:
   KODE_PROV                   PROVINSI  FID                       geometry
1         72            Sulawesi Tengah   72 MULTIPOLYGON (((121.3651 -1...
2         76             Sulawesi Barat   76 MULTIPOLYGON (((117.5564 -2...
3         73           Sulawesi Selatan   73 MULTIPOLYGON (((117.2023 -7...
4         91               Papua Tengah 91-D MULTIPOLYGON (((134.8314 -3...
5         92                Papua Barat 92-A MULTIPOLYGON (((132.2503 -2...
6         75                  Gorontalo   75 MULTIPOLYGON (((121.3543 0....
7         14                       Riau   14 MULTIPOLYGON (((101.4301 1....
8         91              Papua Selatan 91-C MULTIPOLYGON (((138.4997 -8...
9         34 Daerah Istimewa Yogyakarta   34 MULTIPOLYGON (((110.6796 -8...
10        13             Sumatera Barat   13 MULTIPOLYGON (((99.09373 -1...

check if shp is empty or is valid

table(st_geometry_type(petaprov))
sum(st_is_empty(petaprov))
sum(!st_is_valid(petaprov))

result:

          GEOMETRY              POINT         LINESTRING            POLYGON         MULTIPOINT    MULTILINESTRING       MULTIPOLYGON 
                 0                  0                  0                  0                  0                  0                 38 
GEOMETRYCOLLECTION     CIRCULARSTRING      COMPOUNDCURVE       CURVEPOLYGON         MULTICURVE       MULTISURFACE              CURVE 
                 0                  0                  0                  0                  0                  0                  0 
           SURFACE  POLYHEDRALSURFACE                TIN           TRIANGLE 
                 0                  0                  0                  0 
[1] 0
[1] 1

select the row which is invalid

petaprov |> 
  dplyr::filter(!st_is_valid(petaprov)) |> 
  dplyr::select(PROVINSI)
result:
Simple feature collection with 1 feature and 1 field
Geometry type: MULTIPOLYGON
Dimension:     XY
Bounding box:  xmin: 117.0383 ymin: -7.758941 xmax: 122.2226 ymax: -1.947286
Geodetic CRS:  WGS 84
          PROVINSI                       geometry
1 Sulawesi Selatan MULTIPOLYGON (((117.2023 -7...

fix the invalid

library(sf)

petaprov_fix <- petaprov |>
  st_make_valid()

join the shp petaprov and the data dfipm by left join or inner join or right join

prov <- petaprov %>% 
  left_join(dfipm, by = c("FID"="id"))
print(prov)

result:
Simple feature collection with 38 features and 5 fields
Geometry type: MULTIPOLYGON
Dimension:     XY, XYZ
Bounding box:  xmin: 94.97191 ymin: -11.00762 xmax: 141.02 ymax: 6.076832
z_range:       zmin: 0 zmax: 0
Geodetic CRS:  WGS 84
First 10 features:
   KODE_PROV                   PROVINSI  FID         province   ipm                       geometry
1         72            Sulawesi Tengah   72  SULAWESI TENGAH 71.56 MULTIPOLYGON (((121.3651 -1...
2         76             Sulawesi Barat   76   SULAWESI BARAT 68.20 MULTIPOLYGON (((117.5564 -2...
3         73           Sulawesi Selatan   73 SULAWESI SELATAN 74.05 MULTIPOLYGON (((117.2023 -7...
4         91               Papua Tengah 91-D     PAPUA TENGAH 59.75 MULTIPOLYGON (((134.8314 -3...
5         92                Papua Barat 92-A      PAPUA BARAT 67.02 MULTIPOLYGON (((132.2503 -2...
6         75                  Gorontalo   75        GORONTALO 71.23 MULTIPOLYGON (((121.3543 0....
7         14                       Riau   14             RIAU 74.79 MULTIPOLYGON (((101.4301 1....
8         91              Papua Selatan 91-C    PAPUA SELATAN 67.90 MULTIPOLYGON (((138.4997 -8...
9         34 Daerah Istimewa Yogyakarta   34    DI YOGYAKARTA 81.55 MULTIPOLYGON (((110.6796 -8...
10        13             Sumatera Barat   13   SUMATERA BARAT 74.49 MULTIPOLYGON (((99.09373 -1...

if we want to export the joined data to excel, we can do

library(writexl)
df_excel <- sf::st_drop_geometry(petaprov)
write_xlsx(df_excel, "petaprov.xlsx")

visualize the HDI

library(ggspatial) #for arrow
p<-ggplot() +
  geom_sf(
    data = prov_fix,
    aes(fill = ipm),
    color = "grey30",
    linewidth = 0.2
  ) +
  
  scale_fill_gradient(
    low = "#FFF400",
    high = "#D10000",
    name = "IPM (HDI)"
  ) +
  
  labs(
    title = "HDI Distribution",
    caption = "Source: BPS (processed)"
  ) +
   # Arrow
  annotation_north_arrow(
    location = "tr", # position: tl, tr, bl, br
    which_north = "true",
    style = north_arrow_fancy_orienteering,
    height = unit(1.0, "cm"),
    width  = unit(1.0, "cm"),
    pad_x  = unit(0.5, "cm"),
    pad_y  = unit(0.5, "cm")
  ) +
  # Skala
  annotation_scale(
    location = "bl", # position: tl, tr, bl, br
    width_hint = 0.2,
    height = unit(0.2, "cm"),
    text_cex = 1.0
  ) +
  theme_minimal() +
  theme(
    panel.grid = element_blank(),
    plot.title = element_text(face = "bold", size = 14)
  )
p
hdi indonesia visualization

if we want to export the visualization to images

ggsave(
  filename = "visual_hdi.png",
  plot = p,
  width = 16,
  height = 12,
  units = "in",
  dpi = 300
)

Conclution

The spatial visualization of the 2024 Human Development Index (HDI) highlights clear regional disparities across Indonesian provinces. Mapping HDI using R and administrative shapefiles provides an intuitive and effective way to identify spatial patterns that are not easily observed in tabular data. This visualization can serve as a preliminary step for more advanced spatial analyses to better understand regional inequality in human development.

Leave a Reply

Your email address will not be published. Required fields are marked *