Adolescents out of school, male (% of male lower secondary school age)

Source: worldbank.org, 03.09.2025

Year: 2023

Flag Country Value Value change, % Rank
Albania Albania 2.16 +646% 61
Andorra Andorra 1.67 -77.3% 63
Armenia Armenia 1.18 +48.9% 66
Azerbaijan Azerbaijan 9.03 -27.8% 40
Burkina Faso Burkina Faso 59 +3.06% 3
Bangladesh Bangladesh 24.4 +1.32% 19
Bahrain Bahrain 4.01 +23.2% 56
Bahamas Bahamas 21.8 +61.6% 24
Bosnia & Herzegovina Bosnia & Herzegovina 6.47 +29.2% 50
Belarus Belarus 6.6 +46.9% 48
Belize Belize 6.52 +26.4% 49
Bolivia Bolivia 7.56 -33.9% 44
Brunei Brunei 2.35 +40.7% 60
Côte d’Ivoire Côte d’Ivoire 26.8 -41% 18
Cameroon Cameroon 45.8 +1.32% 8
Comoros Comoros 32.8 -17.8% 16
Cuba Cuba 7.01 -9.25% 46
Dominica Dominica 19.3 +14.3% 28
Dominican Republic Dominican Republic 16.3 +38.5% 31
Algeria Algeria 2.51 -84.5% 59
Ecuador Ecuador 14.6 +239% 33
Ethiopia Ethiopia 51.6 +4.65% 6
Guatemala Guatemala 35.8 +0.256% 11
Guyana Guyana 23.8 +25.6% 21
Honduras Honduras 44.2 -6.88% 9
Indonesia Indonesia 7.23 -14.9% 45
India India 15.2 +32.5% 32
Jamaica Jamaica 20.6 +4.35% 25
Jordan Jordan 3.81 -38.4% 57
Kazakhstan Kazakhstan 1.67 -10.8% 62
Kyrgyzstan Kyrgyzstan 5.17 +10.8% 53
Cambodia Cambodia 4.64 -77.2% 54
Kiribati Kiribati 11.9 -11% 37
Laos Laos 35.3 +1.19% 12
Lebanon Lebanon 33.5 15
Lesotho Lesotho 32.4 +5.11% 17
Macao SAR China Macao SAR China 8.46 -3.85% 41
Morocco Morocco 1.58 -49.9% 64
Madagascar Madagascar 38.5 +6.5% 10
Mongolia Mongolia 5.19 -2.77% 52
Malawi Malawi 33.9 +4.57% 14
Malaysia Malaysia 10.3 -16.8% 39
Niger Niger 71.6 +1.96% 1
Nicaragua Nicaragua 13.3 -30.2% 35
Nepal Nepal 1.18 -82.8% 65
Nauru Nauru 13.1 +9.95% 36
Oman Oman 8.4 -41% 42
Peru Peru 1.12 -53.2% 67
Philippines Philippines 11.1 -18.2% 38
Palau Palau 4.26 -73.4% 55
Puerto Rico Puerto Rico 14 +65% 34
Paraguay Paraguay 17.4 -6.62% 30
Palestinian Territories Palestinian Territories 6.98 +15.2% 47
Rwanda Rwanda 5.89 -20% 51
Senegal Senegal 68.4 +4.39% 2
Solomon Islands Solomon Islands 20 +11% 27
Sierra Leone Sierra Leone 18.8 +40.6% 29
El Salvador El Salvador 24 -0.611% 20
San Marino San Marino 8.11 +14.7% 43
Seychelles Seychelles 0.639 -84.9% 68
Syria Syria 54.1 -1.46% 4
Chad Chad 51.3 -1.86% 7
Togo Togo 23 +41.8% 22
Trinidad & Tobago Trinidad & Tobago 34 +168% 13
Tuvalu Tuvalu 20.1 +115% 26
Tanzania Tanzania 53.3 +2.21% 5
Uzbekistan Uzbekistan 2.7 -2.49% 58
Vanuatu Vanuatu 23 +706% 23

                    
# 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.SEC.UNER.LO.MA.ZS'

# 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.SEC.UNER.LO.MA.ZS'

# 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))