library(tidyverse)
library(dplyr)
library(ggthemes)
library(gt)Water, Sanitation, and Hygiene (WASH) Indicators in North African Countries
Introduction
Access to safe drinking water, sanitation, and hygiene is a fundamental human need and a key determinant of public health outcomes. Adequate WASH services prevent infectious diseases, reduce undernutrition, and lower the risk of premature mortality. Sustainable Development Goal (SDG) 6.1 commits all countries to “achieve universal and equitable access to safe and affordable drinking water for all” by 2030, underscoring the essential role of water and sanitation systems in human development and societal well‑being United Nations, Department of Economic and Social Affairs (2025) .
This report assesses Water, Sanitation, and Hygiene (WASH) outcomes across six North African countries: Algeria, Egypt, Libya, Morocco, Sudan, and Tunisia, using World Health Organisation (WHO) health indicator datasets hosted on the Humanitarian Data Exchange (HDX) platform.
The objective is to assess regional progress toward SDG 6: Clean Water and Sanitation by examining a set of indicators that reflect access disparities, service quality, and financial investment in WASH systems. The analysis focuses on the following metrics:
Official development assistance (ODA) for water and sanitation projects that are aligned with government-coordinated spending plans (2023 constant US$ millions)
Proportion of safely treated domestic wastewater flows, capturing national wastewater management capacity
Population using at least basic sanitation services (%), representing foundational access to hygienic sanitation facilities
Population using safely managed sanitation services (%), reflecting higher service standards that ensure safe disposal and treatment
Population using safely managed drinking-water services (%), measuring access to water sources that are safe, available, and accessible on premises
By analyzing temporal trends and cross-country differences, this report quantifies progress, identifies periods of stagnation, and emerging challenges, providing an evidence-based foundation for policy evaluation and regional comparison.
Methods
Data Import and Initial Inspection
After loading the dataset, an initial exploratory step was performed using glimpse(), which allowed assessment of column formats, missing values, and metadata fields. This step guided subsequent preprocessing decisions. The initial dataset includes 939 observations and 17 variables covering indicator codes, geographic identifiers, residence types, and numeric measurements.
raw_data <- read.csv2(here::here("data/raw/water_sanitation_and_hygiene_wash_indicators.csv"))
glimpse(raw_data)Rows: 939
Columns: 17
$ GHO..CODE. <chr> "WSH_SANITATION_BASIC", "WSH_SANITATION_SAFELY_MANAG…
$ GHO..DISPLAY. <chr> "Population using at least basic sanitation services…
$ GHO..URL. <chr> "https://www.who.int/data/gho/data/indicators/indica…
$ YEAR..DISPLAY. <int> 2002, 2003, 2014, 2011, 2010, 2004, 2015, 2013, 2023…
$ STARTYEAR <int> 2002, 2003, 2014, 2011, 2010, 2004, 2015, 2013, 2023…
$ ENDYEAR <int> 2002, 2003, 2014, 2011, 2010, 2004, 2015, 2013, 2023…
$ REGION..CODE. <chr> "EMR", "EMR", "EMR", "EMR", "EMR", "EMR", "EMR", "EM…
$ REGION..DISPLAY. <chr> "Eastern Mediterranean", "Eastern Mediterranean", "E…
$ COUNTRY..CODE. <chr> "TUN", "TUN", "TUN", "TUN", "TUN", "TUN", "TUN", "TU…
$ COUNTRY..DISPLAY. <chr> "Tunisia", "Tunisia", "Tunisia", "Tunisia", "Tunisia…
$ DIMENSION..TYPE. <chr> "RESIDENCEAREATYPE", "RESIDENCEAREATYPE", "RESIDENCE…
$ DIMENSION..CODE. <chr> "RESIDENCEAREATYPE_RUR", "RESIDENCEAREATYPE_URB", "R…
$ DIMENSION..NAME. <chr> "Rural", "Urban", "Urban", "", "", "Total", "Urban",…
$ Numeric <chr> "51.1154", "72.61696", "83.57548", "153.1567", "129.…
$ Value <chr> "51", "73", "84", "153.2", "129.8", "73", "96", "82"…
$ Low <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
$ High <lgl> NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, NA, …
Data Preprocessing
Data preprocessing was conducted in R, using the tidyverse and dplyr packages.
# Select relevant columns
data <- raw_data |>
select(GHO..CODE., GHO..DISPLAY., YEAR..DISPLAY., REGION..CODE., REGION..DISPLAY.,
COUNTRY..CODE., COUNTRY..DISPLAY., DIMENSION..NAME., Numeric) |>
# Rename columns consistently
rename(
indicator_code = GHO..CODE.,
indicator_name = GHO..DISPLAY.,
year = YEAR..DISPLAY.,
region_code = REGION..CODE.,
region_name = REGION..DISPLAY.,
country_code = COUNTRY..CODE.,
country_name = COUNTRY..DISPLAY.,
location_category = DIMENSION..NAME.,
indicator_value = Numeric
) |>
# Convert to numeric and round
mutate(indicator_value = as.numeric(indicator_value)) |>
mutate(indicator_value = round(indicator_value, 2)) |>
# Replace empty strings with NA
mutate(across(where(is.character), ~ na_if(., "")))
glimpse(data)Rows: 939
Columns: 9
$ indicator_code <chr> "WSH_SANITATION_BASIC", "WSH_SANITATION_SAFELY_MANAG…
$ indicator_name <chr> "Population using at least basic sanitation services…
$ year <int> 2002, 2003, 2014, 2011, 2010, 2004, 2015, 2013, 2023…
$ region_code <chr> "EMR", "EMR", "EMR", "EMR", "EMR", "EMR", "EMR", "EM…
$ region_name <chr> "Eastern Mediterranean", "Eastern Mediterranean", "E…
$ country_code <chr> "TUN", "TUN", "TUN", "TUN", "TUN", "TUN", "TUN", "TU…
$ country_name <chr> "Tunisia", "Tunisia", "Tunisia", "Tunisia", "Tunisia…
$ location_category <chr> "Rural", "Urban", "Urban", NA, NA, "Total", "Urban",…
$ indicator_value <dbl> 51.12, 72.62, 83.58, 153.16, 129.85, 72.98, 96.44, 8…
Filtering of Incomplete Indicators: The indicator representing the proportion of safely treated domestic wastewater (WSH_DOMESTIC_WASTE_SAFELY_TREATED) was excluded from the main analysis due to substantial data gaps, with values reported in only three years.
Creation of Subsets: A separate dataset was created for the WASH official development assistance (ODA) indicator (SDGODAWS) by selecting relevant columns and removing the residence-type dimension, which is not applicable to this metric.
location_category_levels <- c('Rural', 'Urban', 'Total')
proceeded_data <- data |>
filter(indicator_code != "WSH_DOMESTIC_WASTE_SAFELY_TREATED") |>
mutate(location_category = factor(location_category, levels = location_category_levels))
wash_oda_indicator <- data |>
filter(indicator_code == "SDGODAWS") |>
select(-location_category)Output
After preprocessing, the cleaned dataset was saved as:
write_csv(data, here::here("data/processed/my-processed-data.csv"))This processed dataset constitutes the analytical base for all figures, tables, and statistical summaries presented in the report.
Results
Access to drinking water and sanitation services
1. Sanitation Services in North Africa
Access to adequate sanitation is a core component of SDG 6.2, which calls for universal access to “adequate and equitable sanitation and hygiene” by 2030 United Nations, Department of Economic and Social Affairs (2025) . Sanitation outcomes in North Africa vary considerably across countries and between rural and urban populations. This section evaluates coverage of (i) at least basic sanitation services and (ii) safely managed sanitation services. Together, these measures provide insight into both service availability and quality, highlighting disparities between population groups and across countries.
Figure 1 illustrates substantial cross-country variability in sanitation outcomes in North Africa in 2022. Coverage of at least basic sanitation is generally high, with Tunisia (97.4%) and Egypt (97.5%) achieving near-universal access, followed by Libya (92.1%), Morocco (87.5%), and Algeria (85.8%). These values indicate that most countries have succeeded in extending basic sanitation infrastructure to the majority of their populations. Sudan’s coverage of 36.9% is substantially lower than that observed in the other North African countries, indicating substantial remaining gaps in access to sanitation services.
Coverage of safely managed sanitation is lower than basic sanitation across all countries. Tunisia remains highest at 81.1%, yet the gap between its near‑universal basic access and safely managed coverage points to incomplete wastewater treatment and disposal infrastructure. Egypt (67.2%), Algeria (62.4%), and Morocco (61.0%) form an intermediate cluster, while Libya’s drop from over 90% basic coverage to 23.8% safely managed, and Sudan reports no data for this indicator, limiting regional comparison.
The contrast between the two indicators shows that North African countries have expanded basic facilities but still face significant system‑level challenges in achieving safely managed sanitation.
proceeded_data |>
filter(location_category == "Total",
indicator_code %in% c("WSH_SANITATION_BASIC","WSH_SANITATION_SAFELY_MANAGED")) |>
group_by(country_name, indicator_name) |>
filter(year == max(year, na.rm = TRUE)) |>
ungroup() |>
ggplot(aes(x = reorder(country_name, indicator_value),
y = indicator_value,
fill = country_name)) +
geom_col() +
geom_text(aes(label = paste0(round(indicator_value, 1), "%")),
hjust = 1.05,
color = "black",
size = 3) +
coord_flip() +
facet_wrap(~ indicator_name, ncol = 1, scales = "free_y") +
labs(
x = "Country",
y = "Population Coverage (%)",
fill = "Country",
caption = "Indicator: SDG 6.2 – WASH basic and safely managed sanitation services, population using (%)\nSource: WHO Global Health Observatory" ) +
scale_fill_brewer(type = "qual", palette = 3) +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5))
Table 1 further highlights that access to sanitation services is geographically uneven, with persistent and often pronounced rural–urban disparities.
Rural–urban gaps persist despite high national coverage of basic sanitation services as shown in Table 1 (a). In Egypt and Tunisia, rural coverage (95.8% and 97.1%) is close to urban levels, yielding small gaps of 3.9 and 0.5 percentage points (p.p) and indicating broadly equitable basic access. Whereas, Algeria shows a moderate gap of 8.2 p.p, while Morocco (25.0 p.p.) and Sudan (35.9 p.p.) exhibit large rural shortfalls, pointing to significant infrastructure deficits outside urban areas.
Table 1 (b) demonstrates both lower overall coverage of access to safely managed sanitation services and wider rural–urban gaps than for basic services. In Algeria and Egypt, rural coverage (56.0% and 63.0%) remains below urban coverage (64.6% and 72.6%), with gaps of 8.6–9.6 p.p, indicating that rural areas are less likely to benefit from systems that ensure safe treatment and disposal. Tunisia has the most pronounced inequality, with 62.9% in rural areas versus 88.9% in urban areas (26.0 p.p), despite near‑universal basic sanitation, indicating structural constraints in extending sewerage and treatment infrastructure beyond urban centres. Missing rural and safely managed data for Morocco and Sudan limit direct comparison, but, alongside their basic sanitation gaps, suggest that safely managed services are even more unevenly distributed than basic facilities.
# 1. Build a single summary table with latest rural/urban coverage and the gap
sanitation_summary <- proceeded_data |>
filter(
indicator_code %in% c("WSH_SANITATION_BASIC",
"WSH_SANITATION_SAFELY_MANAGED"),
location_category %in% c("Urban", "Rural")
) |>
group_by(country_name, indicator_code, location_category) |>
# Latest year per country–indicator–area
filter(year == max(year, na.rm = TRUE)) |>
ungroup() |>
select(country_name, indicator_code, year,
location_category, indicator_value) |>
pivot_wider(
names_from = location_category, # creates Rural and Urban columns
values_from = indicator_value ) |>
mutate(gap_urban_minus_rural = Urban - Rural) |>
rename(
latest_year = year,
rural_coverage = Rural,
urban_coverage = Urban) |>
arrange(indicator_code, country_name)
# 2. Create one table for each indicator
# 2a. Basic sanitation
tbl_basic <- sanitation_summary |>
filter(indicator_code == "WSH_SANITATION_BASIC") |>
select(country_name, latest_year, rural_coverage, urban_coverage, gap_urban_minus_rural) |>
mutate(across(c(rural_coverage, urban_coverage, gap_urban_minus_rural),
~ round(.x, 1))) |>
gt() |>
cols_label(
country_name= "Country",
latest_year= "Year",
rural_coverage= "Rural (%)",
urban_coverage= "Urban (%)",
gap_urban_minus_rural = "Gap (p.p.)")
# 2b. Safely managed sanitation
# add Sudan for safely managed sanitation with NA values
sanitation_summary <- sanitation_summary |>
bind_rows(
tibble(
country_name = "Sudan",
indicator_code = "WSH_SANITATION_SAFELY_MANAGED",
latest_year = NA_integer_,
rural_coverage = NA_real_,
urban_coverage = NA_real_,
gap_urban_minus_rural = NA_real_
)
) |>
arrange(indicator_code, country_name)
tbl_safe <- sanitation_summary |>
filter(indicator_code == "WSH_SANITATION_SAFELY_MANAGED") |>
select(country_name, latest_year,
rural_coverage, urban_coverage, gap_urban_minus_rural) |>
mutate(across(c(rural_coverage, urban_coverage, gap_urban_minus_rural),
~ round(.x, 1))) |>
gt() |>
cols_label(
country_name= "Country",
latest_year= "Year",
rural_coverage= "Rural (%)",
urban_coverage= "Urban (%)",
gap_urban_minus_rural = "Gap (p.p.)"
)tbl_basic
tbl_safe| Country | Year | Rural (%) | Urban (%) | Gap (p.p.) |
|---|---|---|---|---|
| Algeria | 2022 | 79.7 | 87.9 | 8.2 |
| Egypt | 2022 | 95.8 | 99.8 | 3.9 |
| Morocco | 2022 | 71.4 | 96.4 | 25.0 |
| Sudan | 2020 | 24.2 | 60.1 | 35.9 |
| Tunisia | 2022 | 97.1 | 97.6 | 0.5 |
| Country | Year | Rural (%) | Urban (%) | Gap (p.p.) |
|---|---|---|---|---|
| Algeria | 2022 | 56.0 | 64.6 | 8.6 |
| Egypt | 2022 | 63.0 | 72.6 | 9.6 |
| Morocco | 2022 | NA | 34.4 | NA |
| Sudan | NA | NA | NA | NA |
| Tunisia | 2022 | 62.9 | 88.9 | 26.0 |
2. Drinking Water Services in North Africa
Access to clean water is a fundamental human need, and Sustainable Development Goal (SDG) 6.1 aims to “achieve universal and equitable access to safe and affordable drinking water for all” by 2030.
Figure 2 presents trends in safely managed drinking-water services for North African countries; however, due to data limitations, only Algeria, Morocco, and Tunisia have consistent data available.
All three countries have made measurable progress since 2000; however, improvements have slowed considerably in recent years, with both Tunisia and Algeria experiencing a decline in access, indicating emerging challenges in maintaining water service quality and coverage, while Morocco has reached 75% of the population with safely managed drinking-water services. In all three cases, a persistent rural–urban gap remains, with rural coverage systematically below urban coverage despite overall national progress.
proceeded_data |>
filter(indicator_code == "WSH_WATER_SAFELY_MANAGED") |>
ggplot(aes(x = year,
y = indicator_value,
color = location_category)) +
geom_point() +
geom_line(size = 1) +
labs(
x = "Year",
y = "Population Coverage (%)",
color = "Area",
caption = "Indicator 6.1 - WASH safely managed drinking-water services, population using (%) \nSource: WHO Health Indicators (HDX platform)") +
facet_wrap(~ country_name, scales = "free_y", ncol = 1) +
scale_fill_brewer(type = "qual", palette = 3) +
theme_minimal() +
theme(plot.title = element_text(hjust = 0.5))
Conclusions
Basic sanitation coverage is high in most North African countries, but safely managed sanitation remains substantially lower, revealing major gaps in wastewater treatment and safe disposal.
Safely managed drinking-water services have improved since 2000 in Algeria, Morocco, and Tunisia, but recent stagnation and reversals indicate growing challenges in sustaining service quality and reliability.
Rural–urban inequalities are a persistent feature of both sanitation and drinking-water services, with rural areas consistently lagging behind urban populations despite national-level progress.
External financing for WASH, measured as water- and sanitation-related ODA in government-coordinated plans, shows declining or volatile trends in several countries, raising concerns about the predictability of resources needed to close remaining gaps.