Net ODA received (% of gross capital formation)

Source: worldbank.org, 01.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 161 -36.4% 5
Angola Angola 0.356 -74.7% 95
Albania Albania 6.17 -49.5% 63
Argentina Argentina 0.351 +99% 96
Armenia Armenia 6.88 +35.4% 61
Azerbaijan Azerbaijan 0.499 +378% 92
Burundi Burundi 129 -22.8% 8
Benin Benin 15.6 -6.6% 43
Burkina Faso Burkina Faso 42.4 -19.7% 20
Bangladesh Bangladesh 3.52 -10.7% 76
Bosnia & Herzegovina Bosnia & Herzegovina 4.22 -53.8% 72
Belarus Belarus 0.102 -87.6% 105
Belize Belize 3.18 -78.2% 77
Bolivia Bolivia 4.57 -38.8% 70
Brazil Brazil 0.163 -52.2% 102
Bhutan Bhutan 12 +16.1% 49
Botswana Botswana 1.64 -12.5% 84
Central African Republic Central African Republic 118 +14.1% 9
China China -0.00364 -49.9% 109
Côte d’Ivoire Côte d’Ivoire 10.1 +10.3% 53
Cameroon Cameroon 13.9 -0.619% 46
Congo - Kinshasa Congo - Kinshasa 15.7 -33.8% 42
Congo - Brazzaville Congo - Brazzaville 21.3 +241% 35
Colombia Colombia 2.75 -13.4% 82
Comoros Comoros 80.5 -8.15% 10
Cape Verde Cape Verde 16.8 -34.2% 39
Costa Rica Costa Rica 5.22 +695% 68
Djibouti Djibouti -15.7 -52.6% 110
Dominican Republic Dominican Republic 1.05 -32.5% 90
Algeria Algeria 0.272 -7.69% 97
Ecuador Ecuador 1.45 +6.88% 88
Egypt Egypt 6.15 -40.2% 64
Ethiopia Ethiopia 15.3 +17.4% 45
Fiji Fiji 39 -40.1% 21
Gabon Gabon 4.07 +40.1% 73
Georgia Georgia 6.25 -68.3% 62
Ghana Ghana 8.95 -2.07% 57
Guinea Guinea 17.9 -17% 37
Gambia Gambia 43.2 +6.62% 19
Guinea-Bissau Guinea-Bissau 38.5 -16.1% 22
Equatorial Guinea Equatorial Guinea 1.11 -12.2% 89
Guatemala Guatemala 2.76 -21.9% 81
Honduras Honduras 9.49 +4.88% 54
Haiti Haiti 27.7 +10.1% 28
Indonesia Indonesia 0.169 +0.691% 101
India India 0.252 -18.3% 99
Iran Iran 0.193 -3.77% 100
Iraq Iraq 2.25 -44.2% 83
Kazakhstan Kazakhstan 0.131 +19.1% 104
Kenya Kenya 12.2 -14.4% 48
Kyrgyzstan Kyrgyzstan 16.9 -8.63% 38
Cambodia Cambodia 11.2 -8.59% 52
Kiribati Kiribati 166 +15% 4
Lebanon Lebanon 554 +391% 1
Libya Libya 5.8 -27.7% 66
Sri Lanka Sri Lanka 0.0546 -88.5% 106
Lesotho Lesotho 23.8 -8.88% 30
Morocco Morocco 3.57 +60.8% 75
Moldova Moldova 22.3 +37.5% 33
Madagascar Madagascar 29.4 -35.2% 27
Maldives Maldives 5.86 -31% 65
Mexico Mexico 0.148 -24.8% 103
Marshall Islands Marshall Islands 205 -1.48% 3
North Macedonia North Macedonia 4.46 -40.4% 71
Mali Mali 23.1 -12.5% 32
Montenegro Montenegro 5.44 -36.2% 67
Mongolia Mongolia 3.92 -22% 74
Mozambique Mozambique 31.4 -10.3% 25
Mauritania Mauritania 6.99 -39% 60
Mauritius Mauritius 2.89 -77.6% 80
Malaysia Malaysia 0.00508 -70.8% 108
Namibia Namibia 13 +54.1% 47
Niger Niger 44.5 +1.24% 16
Nicaragua Nicaragua 33.1 +48.6% 23
Nepal Nepal 7.79 -36.7% 59
Pakistan Pakistan 3.16 -45.3% 78
Panama Panama 0.475 +9.56% 93
Peru Peru 1.51 +151% 87
Philippines Philippines 1.62 -17.6% 86
Palau Palau 56.7 +0.0738% 14
Paraguay Paraguay 0.833 -54.4% 91
Palestinian Territories Palestinian Territories 44 -6.14% 17
Rwanda Rwanda 31.4 -30.1% 24
Sudan Sudan 138 -57% 7
Senegal Senegal 11.5 -12.4% 51
Solomon Islands Solomon Islands 69.1 -32.7% 12
Sierra Leone Sierra Leone 49.4 -29.6% 15
El Salvador El Salvador 9.08 +189% 55
Somalia Somalia 80.3 -43.1% 11
Serbia Serbia 2.89 -10.4% 79
Eswatini Eswatini 9.07 -31.7% 56
Chad Chad 21.7 -0.178% 34
Togo Togo 24.5 +16% 29
Thailand Thailand 0.401 +340% 94
Tajikistan Tajikistan 15.5 -13.1% 44
Timor-Leste Timor-Leste 65.8 +34.4% 13
Tonga Tonga 212 +249% 2
Tunisia Tunisia 15.7 +7.43% 41
Turkey Turkey 0.252 -38.8% 98
Tanzania Tanzania 8.55 -8.38% 58
Uganda Uganda 19.2 -27% 36
Ukraine Ukraine 146 +1,811% 6
Uzbekistan Uzbekistan 5.07 +27.1% 69
Vietnam Vietnam 0.0366 -91.6% 107
Vanuatu Vanuatu 30.9 -17.9% 26
Samoa Samoa 43.5 +51.9% 18
Kosovo Kosovo 11.6 -13.7% 50
South Africa South Africa 1.64 -15.2% 85
Zambia Zambia 23.3 +48.2% 31
Zimbabwe Zimbabwe 16.3 -30% 40

                    
# 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 = 'DT.ODA.ODAT.GI.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 <- 'DT.ODA.ODAT.GI.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))