Adjusted net savings, excluding particulate emission damage (% of GNI)

Source: worldbank.org, 03.09.2025

Year: 2021

Flag Country Value Value change, % Rank
Aruba Aruba 7.06 -364% 71
Angola Angola 14 +44.5% 38
Albania Albania 3.3 -240% 89
Argentina Argentina 11.8 +47.8% 47
Armenia Armenia 1.2 -57.8% 96
Australia Australia 6.44 -10.3% 76
Austria Austria 12.8 -1.96% 42
Azerbaijan Azerbaijan 9.45 +15.6% 58
Belgium Belgium 12.1 +15.7% 46
Bangladesh Bangladesh 32.8 -4.99% 2
Bulgaria Bulgaria 8.84 +11% 62
Bahamas Bahamas 4.95 -43.2% 82
Belarus Belarus 13.4 +9.51% 41
Belize Belize 12.3 -20.1% 44
Bolivia Bolivia -1.61 -156% 108
Brazil Brazil -0.0811 -93.8% 102
Brunei Brunei 24 -22.8% 9
Bhutan Bhutan 13.9 -26.1% 40
Botswana Botswana 9 +0.707% 61
Canada Canada 7.62 +97.2% 70
Switzerland Switzerland 16.2 +36.2% 32
Chile Chile -3.6 -176% 115
China China 16.8 +6.42% 29
Cameroon Cameroon -0.245 -22.2% 103
Congo - Kinshasa Congo - Kinshasa -10.2 -297% 120
Colombia Colombia 1.76 -64.7% 95
Comoros Comoros 6.47 +152% 75
Cape Verde Cape Verde 24.2 -8.09% 8
Costa Rica Costa Rica 17 +10.4% 28
Cyprus Cyprus 2.02 +63.8% 94
Czechia Czechia 9.78 +12.6% 56
Germany Germany 14.6 +10.1% 36
Denmark Denmark 20.5 +10.1% 15
Dominican Republic Dominican Republic 21.9 +23.1% 13
Algeria Algeria 15.8 +10.5% 33
Ecuador Ecuador 2.66 -58.4% 93
Egypt Egypt -0.455 -110% 104
Spain Spain 8.01 +16.7% 67
Estonia Estonia 16.5 +15.7% 31
Ethiopia Ethiopia 14.2 -12.2% 37
Finland Finland 11.2 +5.01% 51
France France 9.25 +55% 59
Georgia Georgia -5.1 +81.8% 116
Ghana Ghana 4.45 -69.5% 84
Guinea Guinea -14.4 +15.1% 122
Gambia Gambia 18.8 +123% 24
Greece Greece -2.06 -70.3% 110
Guatemala Guatemala 9.21 +5.92% 60
Honduras Honduras 20 -14.9% 19
Croatia Croatia 8.37 +20.9% 64
Haiti Haiti 9.83 -27.8% 55
Hungary Hungary 11.7 +0.493% 48
Indonesia Indonesia 11.3 +22.4% 49
India India 16.6 +5.66% 30
Ireland Ireland 20.1 +42% 18
Iraq Iraq 10 +168% 53
Iceland Iceland 5.71 -27.2% 80
Israel Israel 19.3 +2.18% 23
Italy Italy 7.75 +39.6% 69
Jamaica Jamaica 31.1 +32.2% 4
Jordan Jordan 4.43 -20.1% 85
Japan Japan 3.63 -24.7% 88
Kazakhstan Kazakhstan -0.0136 -100% 101
Kenya Kenya 8.13 +34.8% 66
Kyrgyzstan Kyrgyzstan -2.23 -116% 112
Cambodia Cambodia 17.9 +3.96% 25
South Korea South Korea 17.9 +0.449% 27
Lebanon Lebanon -27.4 +39.7% 123
Lithuania Lithuania 12.2 +6.11% 45
Luxembourg Luxembourg 20.4 +33.8% 16
Latvia Latvia 3.2 -38.7% 91
Morocco Morocco 22 +6.03% 12
Moldova Moldova 6.91 -2.51% 72
Madagascar Madagascar -2.18 -31.1% 111
Maldives Maldives 23.1 -4,408% 10
Mexico Mexico 3.64 -47.7% 87
North Macedonia North Macedonia 14.7 +23% 35
Mongolia Mongolia -7.42 +95.6% 119
Mozambique Mozambique -5.88 +98% 117
Mauritania Mauritania 25.2 -13.3% 7
Mauritius Mauritius 0.166 -105% 100
Malaysia Malaysia 0.537 +64.5% 99
Namibia Namibia -1.09 -109% 106
Nigeria Nigeria 20.6 +23.5% 14
Nicaragua Nicaragua 12.4 -30% 43
Netherlands Netherlands 15.5 +13.5% 34
Norway Norway 20.2 +48.7% 17
Nepal Nepal 26.1 -1.11% 5
New Zealand New Zealand 9.88 -12.8% 54
Oman Oman -10.2 +17.7% 121
Pakistan Pakistan 8.45 -5.45% 63
Panama Panama 19.5 +5.17% 21
Peru Peru 6.69 -40.2% 73
Philippines Philippines 8.36 -38.6% 65
Poland Poland 11 -2.12% 52
Portugal Portugal 3.09 +94.5% 92
Paraguay Paraguay 17.9 +3.36% 26
Qatar Qatar 25.5 +42% 6
Romania Romania 5.13 -17.5% 81
Russia Russia 6.51 -24.4% 74
Rwanda Rwanda 0.54 -126% 98
Sudan Sudan -6.54 -133% 118
Singapore Singapore 31.6 +20.6% 3
El Salvador El Salvador 5.84 -35.2% 78
Serbia Serbia 6.04 +0.468% 77
Slovakia Slovakia 4.57 -9.04% 83
Slovenia Slovenia 11.3 -3.3% 50
Sweden Sweden 19.8 +0.571% 20
Eswatini Eswatini 5.76 +237% 79
Seychelles Seychelles -1.35 -53.3% 107
Thailand Thailand 9.6 -6.45% 57
Timor-Leste Timor-Leste -80.1 +253% 124
Tonga Tonga -3.03 -121% 113
Tunisia Tunisia -1.02 -72.9% 105
Uganda Uganda -3.38 +6,741% 114
Ukraine Ukraine -1.81 +144% 109
Uruguay Uruguay 14 -0.483% 39
United States United States 4.37 -24.1% 86
Uzbekistan Uzbekistan 3.23 -70.3% 90
Vietnam Vietnam 19.4 -4.18% 22
Vanuatu Vanuatu 37.3 -7.49% 1
Samoa Samoa 22.8 -19.5% 11
South Africa South Africa 0.975 -146% 97
Zambia Zambia 7.93 -66.2% 68

                    
# 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 = 'NY.ADJ.SVNX.GN.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 <- 'NY.ADJ.SVNX.GN.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))