Out-of-pocket expenditure per capita, PPP (current international US$)

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 299 +7.2% 90
Angola Angola 62.3 +11.6% 148
Albania Albania 608 -14.2% 51
Andorra Andorra 454 -21.4% 68
United Arab Emirates United Arab Emirates 469 +14.2% 64
Argentina Argentina 703 +16.6% 38
Armenia Armenia 1,442 -2.38% 5
Antigua & Barbuda Antigua & Barbuda 356 +48.8% 78
Australia Australia 1,081 +18.1% 17
Austria Austria 1,275 +4.88% 10
Azerbaijan Azerbaijan 450 -7.71% 69
Burundi Burundi 16.7 -1.25% 178
Belgium Belgium 1,481 +14.6% 4
Benin Benin 44.8 +0.58% 162
Burkina Faso Burkina Faso 60.4 +12.7% 150
Bangladesh Bangladesh 130 +14% 125
Bulgaria Bulgaria 901 +6.03% 26
Bahrain Bahrain 530 -14.1% 57
Bahamas Bahamas 739 +19.5% 35
Bosnia & Herzegovina Bosnia & Herzegovina 564 +3.65% 54
Belarus Belarus 417 +34.3% 73
Belize Belize 127 +15.2% 127
Bolivia Bolivia 182 +8.94% 117
Brazil Brazil 464 +13.2% 66
Barbados Barbados 548 +16.1% 56
Brunei Brunei 95.1 -2.26% 134
Bhutan Bhutan 207 +160% 114
Botswana Botswana 49.7 +4.19% 156
Central African Republic Central African Republic 52 +13.1% 154
Canada Canada 1,038 +8.09% 18
Switzerland Switzerland 2,302 +9.97% 1
Chile Chile 1,125 +21.8% 15
China China 381 +7.15% 74
Côte d’Ivoire Côte d’Ivoire 65.3 +11% 145
Cameroon Cameroon 137 +8.66% 124
Congo - Kinshasa Congo - Kinshasa 18.5 +6.54% 175
Congo - Brazzaville Congo - Brazzaville 21 -31% 171
Colombia Colombia 230 +5.27% 107
Comoros Comoros 139 +10.6% 123
Cape Verde Cape Verde 171 +37% 120
Costa Rica Costa Rica 430 +14.1% 71
Cuba Cuba 321 +24.6% 87
Cyprus Cyprus 701 +10.4% 39
Czechia Czechia 660 +15.3% 46
Germany Germany 908 -5.03% 25
Djibouti Djibouti 47.6 +13.5% 158
Dominica Dominica 256 +29.9% 99
Denmark Denmark 967 +1.12% 20
Dominican Republic Dominican Republic 288 +20.8% 92
Algeria Algeria 274 -1.25% 97
Ecuador Ecuador 321 +6.3% 86
Egypt Egypt 377 +12.5% 77
Eritrea Eritrea 47.1 +9.39% 160
Spain Spain 916 +5.25% 24
Estonia Estonia 789 +5.64% 33
Ethiopia Ethiopia 35.2 +17.7% 166
Finland Finland 974 +2.82% 19
Fiji Fiji 47.5 -76.5% 159
France France 612 +5.59% 47
Micronesia (Federated States of) Micronesia (Federated States of) 10.7 +2.53% 183
Gabon Gabon 85.9 -1.21% 138
United Kingdom United Kingdom 857 +9.33% 30
Georgia Georgia 589 +34% 53
Ghana Ghana 60.5 -2.02% 149
Guinea Guinea 64.4 +11.1% 146
Gambia Gambia 17.6 +11.3% 177
Guinea-Bissau Guinea-Bissau 121 +16.8% 129
Equatorial Guinea Equatorial Guinea 328 -18.4% 85
Greece Greece 1,106 +10.6% 16
Grenada Grenada 494 +10.1% 60
Guatemala Guatemala 457 +12.2% 67
Guyana Guyana 284 -10.3% 94
Honduras Honduras 284 -2.28% 93
Croatia Croatia 281 +4.15% 95
Haiti Haiti 51.4 +5.82% 155
Hungary Hungary 706 +0.567% 37
Indonesia Indonesia 129 -1.33% 126
India India 126 +12.8% 128
Ireland Ireland 886 +9.5% 28
Iran Iran 378 +15.2% 76
Iraq Iraq 223 -12.7% 110
Iceland Iceland 916 +4.72% 23
Israel Israel 812 +4.27% 32
Italy Italy 1,133 +7.05% 14
Jamaica Jamaica 103 +3.3% 132
Jordan Jordan 309 +9.73% 88
Japan Japan 591 +1.08% 52
Kazakhstan Kazakhstan 349 +28% 79
Kenya Kenya 60.1 +11.4% 151
Kyrgyzstan Kyrgyzstan 119 +5.97% 130
Cambodia Cambodia 204 +5% 115
Kiribati Kiribati 2.38 +8.22% 190
St. Kitts & Nevis St. Kitts & Nevis 842 +18.1% 31
South Korea South Korea 1,399 +7.51% 6
Kuwait Kuwait 279 +18.7% 96
Laos Laos 54.2 -24.7% 153
Lebanon Lebanon 218 +21.1% 111
Liberia Liberia 140 +6.05% 122
Libya Libya 295 -3.41% 91
St. Lucia St. Lucia 342 +18.3% 82
Sri Lanka Sri Lanka 246 -0.607% 101
Lesotho Lesotho 46.1 +12.1% 161
Lithuania Lithuania 1,186 +9.81% 12
Luxembourg Luxembourg 679 -1.96% 42
Latvia Latvia 965 +7.23% 21
Morocco Morocco 238 +12.3% 104
Monaco Monaco 663 +14.9% 45
Moldova Moldova 347 +0.399% 80
Madagascar Madagascar 18.1 -0.907% 176
Maldives Maldives 431 +32.8% 70
Mexico Mexico 529 +3.46% 59
Marshall Islands Marshall Islands 8.96 +3.27% 186
North Macedonia North Macedonia 730 -6.43% 36
Mali Mali 38.9 +8.13% 164
Malta Malta 1,729 +4.58% 2
Myanmar (Burma) Myanmar (Burma) 158 +20.2% 121
Montenegro Montenegro 1,141 +13% 13
Mongolia Mongolia 493 +71.7% 61
Mozambique Mozambique 12.7 +12.9% 181
Mauritania Mauritania 112 +11.1% 131
Mauritius Mauritius 684 +12% 41
Malawi Malawi 12.8 -15.4% 180
Malaysia Malaysia 485 +21.1% 63
Namibia Namibia 75.3 +12.7% 144
Niger Niger 27.5 -17.6% 168
Nigeria Nigeria 187 +13.2% 116
Nicaragua Nicaragua 227 +18.4% 108
Netherlands Netherlands 759 +7.26% 34
Norway Norway 1,397 +14.9% 7
Nepal Nepal 180 +52.6% 118
Nauru Nauru 12.1 +4.86% 182
New Zealand New Zealand 609 +9.05% 50
Oman Oman 88.1 -13.6% 137
Pakistan Pakistan 84.6 +0.0116% 139
Panama Panama 1,237 +7.95% 11
Peru Peru 254 +6.73% 100
Philippines Philippines 236 +6.67% 106
Palau Palau 328 -12.3% 84
Papua New Guinea Papua New Guinea 10.7 +10.5% 184
Poland Poland 561 +6.49% 55
Portugal Portugal 1,388 +8.75% 8
Paraguay Paraguay 485 +11.1% 62
Palestinian Territories Palestinian Territories 210 +1.91% 112
Qatar Qatar 179 -3.48% 119
Romania Romania 529 +3.34% 58
Russia Russia 678 +0.975% 43
Rwanda Rwanda 21.4 +16.3% 170
Saudi Arabia Saudi Arabia 342 -4.19% 83
Sudan Sudan 62.9 -8.99% 147
Senegal Senegal 82 +3.63% 141
Singapore Singapore 1,647 +10.3% 3
Solomon Islands Solomon Islands 4.33 +1.7% 188
Sierra Leone Sierra Leone 84 +3.07% 140
El Salvador El Salvador 343 +9.97% 81
San Marino San Marino 672 +8.4% 44
Somalia Somalia 18.7 +7.66% 173
Serbia Serbia 867 +7.87% 29
South Sudan South Sudan 13.2 +19.7% 179
São Tomé & Príncipe São Tomé & Príncipe 36.4 +2.48% 165
Suriname Suriname 241 +11.4% 103
Slovakia Slovakia 610 +7.56% 48
Slovenia Slovenia 609 +7.39% 49
Sweden Sweden 925 +2.37% 22
Eswatini Eswatini 79 -0.00727% 142
Seychelles Seychelles 381 +11.4% 75
Syria Syria 207 -14.7% 113
Chad Chad 54.4 -9.21% 152
Togo Togo 94.2 +7.56% 135
Thailand Thailand 102 +16.1% 133
Tajikistan Tajikistan 238 +3.16% 105
Turkmenistan Turkmenistan 692 +10.6% 40
Timor-Leste Timor-Leste 18.7 +18.4% 174
Trinidad & Tobago Trinidad & Tobago 892 +2.44% 27
Tunisia Tunisia 300 +8.96% 89
Turkey Turkey 270 +18.5% 98
Tuvalu Tuvalu 4.15 +5.14% 189
Tanzania Tanzania 26.6 +11.5% 169
Uganda Uganda 43.4 +13.1% 163
Uruguay Uruguay 419 +16.1% 72
United States United States 1,380 +6.18% 9
Uzbekistan Uzbekistan 468 +14.8% 65
St. Vincent & Grenadines St. Vincent & Grenadines 227 +4.12% 109
Venezuela Venezuela 32.7 +13.9% 167
Vietnam Vietnam 242 +13.7% 102
Vanuatu Vanuatu 10.4 +1% 185
Samoa Samoa 49.5 +4.06% 157
Yemen Yemen 76.7 +2.97% 143
South Africa South Africa 90 +10.5% 136
Zambia Zambia 20.1 +18.8% 172
Zimbabwe Zimbabwe 7.83 +16.3% 187

                    
# 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 = 'SH.XPD.OOPC.PP.CD'

# 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 <- 'SH.XPD.OOPC.PP.CD'

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