School enrollment, primary, male (% net)

Source: worldbank.org, 03.09.2025

Year: 2017

Flag Country Value Value change, % Rank
Armenia Armenia 92 -0.0417% 45
Antigua & Barbuda Antigua & Barbuda 93.6 -0.704% 35
Australia Australia 96 -1.54% 16
Azerbaijan Azerbaijan 92.9 -2.29% 42
Burundi Burundi 93.4 -0.979% 36
Belgium Belgium 98.7 +0.326% 2
Burkina Faso Burkina Faso 77.4 +1.38% 72
Bulgaria Bulgaria 86.6 -1.49% 56
Bolivia Bolivia 91.1 +2.27% 48
Barbados Barbados 95.8 +0.845% 20
Bhutan Bhutan 87.2 +0.278% 54
Chile Chile 94.7 +0.809% 27
Côte d’Ivoire Côte d’Ivoire 89.2 +2.18% 50
Cameroon Cameroon 97 -1.73% 9
Colombia Colombia 92.9 +0.0726% 43
Comoros Comoros 80.7 -2.09% 68
Cape Verde Cape Verde 93.8 +0.141% 33
Costa Rica Costa Rica 96.4 -1.8% 14
Cuba Cuba 95.7 +1.25% 21
Cyprus Cyprus 97.1 +0.727% 8
Djibouti Djibouti 58.3 +5.15% 80
Dominican Republic Dominican Republic 93 -0.672% 41
Eritrea Eritrea 54.1 -13.6% 81
Spain Spain 96.9 -1.56% 10
Estonia Estonia 93.2 +0.251% 39
Finland Finland 98.5 -0.461% 3
United Kingdom United Kingdom 99.6 -0.105% 1
Ghana Ghana 84.6 -1.23% 60
Gambia Gambia 72.4 +3.16% 74
Greece Greece 98 +0.0402% 5
Guatemala Guatemala 85.6 +1.13% 58
Honduras Honduras 79.3 +0.669% 71
Hungary Hungary 91.5 -0.451% 46
Indonesia Indonesia 96.3 +1.28% 15
Italy Italy 95.9 -0.323% 18
Jamaica Jamaica 82.3 -1.64% 64
Jordan Jordan 80.6 +4.36% 69
Cambodia Cambodia 90.8 -2.19% 49
South Korea South Korea 97.3 +0.452% 7
Kuwait Kuwait 84.8 -4.94% 59
Laos Laos 93.2 -1.91% 38
Liberia Liberia 44.1 +12% 82
St. Lucia St. Lucia 94.6 -1.2% 29
Lesotho Lesotho 93.2 +3.51% 37
Latvia Latvia 95.8 +0.278% 19
Macao SAR China Macao SAR China 96.7 +0.194% 12
Morocco Morocco 96.8 +2.38% 11
Moldova Moldova 87 -0.55% 55
Maldives Maldives 94.5 -1.16% 30
North Macedonia North Macedonia 94.9 +3.7% 26
Mali Mali 64.7 +6.98% 78
Montenegro Montenegro 95.4 +1.44% 22
Mozambique Mozambique 91.5 -1.39% 47
Mauritania Mauritania 75.8 +6.26% 73
Niger Niger 69.9 +1.83% 76
Netherlands Netherlands 98.2 +1.42% 4
Pakistan Pakistan 69.6 -1.25% 77
Panama Panama 86.6 -1.05% 57
Philippines Philippines 93.9 -0.184% 31
Poland Poland 95.9 -0.0504% 17
Portugal Portugal 97.9 +0.97% 6
Palestinian Territories Palestinian Territories 95.4 +2.06% 23
Qatar Qatar 93.8 +0.457% 34
Romania Romania 82.4 -2.22% 63
Rwanda Rwanda 96.5 -1.76% 13
Saudi Arabia Saudi Arabia 95.1 -2.51% 25
Sudan Sudan 61.1 +8.25% 79
Senegal Senegal 71.3 +1.97% 75
El Salvador El Salvador 79.9 -4.96% 70
Serbia Serbia 95.1 -0.589% 24
São Tomé & Príncipe São Tomé & Príncipe 93.2 +4.73% 40
Suriname Suriname 84.3 -3.68% 61
Slovakia Slovakia 82.1 +0.859% 65
Eswatini Eswatini 82.7 -2.6% 62
Togo Togo 93.8 +0.999% 32
Timor-Leste Timor-Leste 92.8 +1.69% 44
Turkey Turkey 88.6 -6.19% 51
Tanzania Tanzania 82 +0.423% 66
United States United States 94.7 -0.638% 28
Venezuela Venezuela 87.5 -1.6% 52
South Africa South Africa 87.3 -1.28% 53
Zambia Zambia 81.4 -5.14% 67

The indicator 'School enrollment, primary, male (% net)' measures the percentage of male children who are officially registered and attending primary school relative to the total number of eligible children in that age group. This metric is vital for assessing a country's educational system and the extent to which boys are receiving basic education. It serves as a critical marker not only for educational attainment but also for wider socio-economic development and gender equality.

Understanding the importance of this indicator requires recognizing its influence on various aspects of society. High primary school enrollment rates signal better access to education, which can lead to improved literacy rates and educational outcomes in the future. Conversely, low enrollment can indicate systemic issues such as poverty, cultural barriers, or inadequate educational infrastructure.

This indicator is interconnected with several other metrics. For instance, high school enrollment rates often correlate positively with GDP growth and national economic performance. More educated individuals tend to contribute more to the economy, ultimately leading to higher incomes and improved job opportunities. Furthermore, educational access is closely linked to health outcomes; for instance, more educated men are typically more aware of health practices and family planning. Hence, enhanced education can contribute to better overall public health.

Several factors influence male primary school enrollment rates. Economic conditions play a pivotal role; in poorer regions, families may choose to prioritize work over education for their sons. Cultural norms and gender expectations also heavily affect enrollment; in some areas, boys are preferred for educational investment, believing they will carry the family name and wealth forward. Additionally, local governance and the quality of educational institutions can significantly impact enrollment rates, as can broader issues such as political stability and access to resources.

Strategically improving primary school enrollment among boys requires a multifaceted approach. Governments and NGOs may invest in building schools in underserved areas, offering incentives for families to send their children to school, such as scholarships or subsidies. Community awareness programs can play a critical role in changing perceptions about education's value, emphasizing its long-term benefits over immediate economic contributions to the household.

Nevertheless, there are flaws in the current assessment of this indicator. One major issue is that it often overlooks the disparities in enrollment rates between different socioeconomic or cultural groups. While aggregate data may show improvements in enrollment, these figures can mask significant inequities. For instance, marginalized communities may still face barriers to education, leading to a situation where overall enrollment rates rise but specific groups remain underserved.

Examining global historical data, we see significant trends in primary male school enrollment rates since 1970. Initially hovering around 78.82%, the global average steadily increased over the decades, touching a high of around 90.53% in 2018. This sharp rise reflects concerted international efforts and investments in education, highlighting a commitment toward improving access to education worldwide. However, while the median value of 76.11% in 2019 shows that many countries have made substantial progress, it also indicates that there remains a considerable gap to be filled to achieve universal primary education for males.

When we delve into the most recent data from 2019, we note that Ghana achieved a remarkable 85.73%, placing it among the top areas for male primary school enrollment. Yet, the disparities become glaring when we consider Djibouti, which sits at 66.48%. These figures indicate not merely differences in enrollment but also suggest deeper issues related to governance, economic stability, and cultural influences on education. Ghana's success can be seen as part of broader reforms and investments in educational infrastructure and accessibility, whereas Djibouti's challenges may involve socio-economic hurdles that hinder educational progress.

As those in the field of education and development work towards closing the gap in school enrollment, it is crucial to develop targeted interventions based on these findings. By maintaining a focus on those regions lagging behind, stakeholders can work to ensure educational equity—creating a bright future for all children, regardless of their background or socio-economic status. Moreover, the continued monitoring and analysis of trends in educational metrics will be essential to drive policy decisions and resource allocations in the years to come.

                    
# Install missing packages
import sys
import subprocess

def install(package):
subprocess.check_call([sys.executable, "-m", "pip", "install", package])

# Required packages
for package in ['wbdata', 'country_converter']:
try:
__import__(package)
except ImportError:
install(package)

# Import libraries
import wbdata
import country_converter as coco
from datetime import datetime

# Define World Bank indicator code
dataset_code = 'SE.PRM.NENR.MA'

# Download data from World Bank API
data = wbdata.get_dataframe({dataset_code: 'value'},
date=(datetime(1960, 1, 1), datetime.today()),
parse_dates=True,
keep_levels=True).reset_index()

# Extract year
data['year'] = data['date'].dt.year

# Convert country names to ISO codes using country_converter
cc = coco.CountryConverter()
data['iso2c'] = cc.convert(names=data['country'], to='ISO2', not_found=None)
data['iso3c'] = cc.convert(names=data['country'], to='ISO3', not_found=None)

# Filter out rows where ISO codes could not be matched — likely not real countries
data = data[data['iso2c'].notna() & data['iso3c'].notna()]

# Sort for calculation
data = data.sort_values(['iso3c', 'year'])

# Calculate YoY absolute and percent change
data['value_change'] = data.groupby('iso3c')['value'].diff()
data['value_change_percent'] = data.groupby('iso3c')['value'].pct_change() * 100

# Calculate ranks (higher GDP per capita = better rank)
data['rank'] = data.groupby('year')['value'].rank(ascending=False, method='dense')

# Calculate rank change from previous year
data['rank_change'] = data.groupby('iso3c')['rank'].diff()

# Select desired columns
final_df = data[['country', 'iso2c', 'iso3c', 'year', 'value',
'value_change', 'value_change_percent', 'rank', 'rank_change']].copy()

# Optional: Add labels as metadata (could be useful for export or UI)
column_labels = {
'country': 'Country name',
'iso2c': 'ISO 2-letter country code',
'iso3c': 'ISO 3-letter country code',
'year': 'Year',
'value': 'GDP per capita (current US$)',
'value_change': 'Year-over-Year change in value',
'value_change_percent': 'Year-over-Year percent change in value',
'rank': 'Country rank by GDP per capita (higher = richer)',
'rank_change': 'Change in rank from previous year'
}

# Display first few rows
print(final_df.head(10))

# Optional: Save to CSV
#final_df.to_csv("gdp_per_capita_cleaned.csv", index=False)
                    
                
                    
# Check and install required packages
required_packages <- c("WDI", "countrycode", "dplyr")

for (pkg in required_packages) {
  if (!requireNamespace(pkg, quietly = TRUE)) {
    install.packages(pkg)
  }
}

# Load the necessary libraries
library(WDI)
library(dplyr)
library(countrycode)

# Define the dataset code (World Bank indicator code)
dataset_code <- 'SE.PRM.NENR.MA'

# Download data using WDI package
dat <- WDI(indicator = dataset_code)

# Filter only countries using 'is_country' from countrycode
# This uses iso2c to identify whether the entry is a recognized country
dat <- dat %>%
  filter(countrycode(iso2c, origin = 'iso2c', destination = 'country.name', warn = FALSE) %in%
           countrycode::codelist$country.name.en)

# Ensure dataset is ordered by country and year
dat <- dat %>%
  arrange(iso3c, year)

# Rename the dataset_code column to "value" for easier manipulation
dat <- dat %>%
  rename(value = !!dataset_code)

# Calculate year-over-year (YoY) change and percentage change
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(
    value_change = value - lag(value),                              # Absolute change from previous year
    value_change_percent = 100 * (value - lag(value)) / lag(value) # Percent change from previous year
  ) %>%
  ungroup()

# Calculate rank by year (higher value => higher rank)
dat <- dat %>%
  group_by(year) %>%
  mutate(rank = dense_rank(desc(value))) %>% # Rank countries by descending value
  ungroup()

# Calculate rank change (positive = moved up, negative = moved down)
dat <- dat %>%
  group_by(iso3c) %>%
  mutate(rank_change = rank - lag(rank)) %>% # Change in rank compared to previous year
  ungroup()

# Select and reorder final columns
final_data <- dat %>%
  select(
    country,
    iso2c,
    iso3c,
    year,
    value,
    value_change,
    value_change_percent,
    rank,
    rank_change
  )

# Add labels (variable descriptions)
attr(final_data$country, "label") <- "Country name"
attr(final_data$iso2c, "label") <- "ISO 2-letter country code"
attr(final_data$iso3c, "label") <- "ISO 3-letter country code"
attr(final_data$year, "label") <- "Year"
attr(final_data$value, "label") <- "GDP per capita (current US$)"
attr(final_data$value_change, "label") <- "Year-over-Year change in value"
attr(final_data$value_change_percent, "label") <- "Year-over-Year percent change in value"
attr(final_data$rank, "label") <- "Country rank by GDP per capita (higher = richer)"
attr(final_data$rank_change, "label") <- "Change in rank from previous year"

# Print the first few rows of the final dataset
print(head(final_data, 10))