External health expenditure per capita, PPP (current international US$)

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 81.5 +16.7% 20
Angola Angola 10.1 +2.43% 103
Albania Albania 41 +534% 43
United Arab Emirates United Arab Emirates 0 145
Argentina Argentina 33.4 +13.4% 60
Armenia Armenia 9.34 -44% 106
Antigua & Barbuda Antigua & Barbuda 2.18 +64.8% 126
Australia Australia 0 145
Azerbaijan Azerbaijan 20.3 +649% 81
Burundi Burundi 36.1 +11.3% 53
Belgium Belgium 0.898 134
Benin Benin 33.8 +14.8% 58
Burkina Faso Burkina Faso 36.4 +30.1% 52
Bangladesh Bangladesh 33.1 +178% 61
Bahrain Bahrain 0 145
Bahamas Bahamas 13.8 +19.5% 96
Bosnia & Herzegovina Bosnia & Herzegovina 53.1 +351% 31
Belarus Belarus 2.44 -16.9% 125
Belize Belize 21.8 +50.3% 78
Bolivia Bolivia 40.9 +282% 44
Brazil Brazil 1.39 -35% 131
Barbados Barbados 7.88 -3.03% 108
Brunei Brunei 0 145
Bhutan Bhutan 89.9 +149% 14
Botswana Botswana 71.7 +19.5% 22
Central African Republic Central African Republic 38.8 +17% 48
Canada Canada 0 145
Switzerland Switzerland 0 145
Chile Chile 0 145
China China 0.552 +23,230% 140
Côte d’Ivoire Côte d’Ivoire 40.8 +47.4% 45
Cameroon Cameroon 29.1 +8.31% 68
Congo - Kinshasa Congo - Kinshasa 19.2 +15.8% 85
Congo - Brazzaville Congo - Brazzaville 12.5 +44.2% 98
Comoros Comoros 136 +136% 8
Cape Verde Cape Verde 55 +196% 30
Costa Rica Costa Rica 0.577 -32.4% 139
Cuba Cuba 0.994 +159% 132
Cyprus Cyprus 56.3 +35.2% 28
Djibouti Djibouti 39.7 -42.2% 47
Dominica Dominica 4.14 -95.6% 115
Denmark Denmark 0 145
Dominican Republic Dominican Republic 55.7 +261% 29
Algeria Algeria 2.54 -39.5% 124
Ecuador Ecuador 3.18 -25.1% 122
Egypt Egypt 10.7 +177% 102
Eritrea Eritrea 19.5 -22.8% 84
Estonia Estonia 0.364 -20.1% 141
Ethiopia Ethiopia 20 -12.6% 82
Finland Finland 0 145
Fiji Fiji 41 -25.5% 42
Micronesia (Federated States of) Micronesia (Federated States of) 292 -7.67% 5
Gabon Gabon 16.4 +2.7% 93
United Kingdom United Kingdom 0.64 +10.7% 138
Georgia Georgia 6.28 -32% 111
Ghana Ghana 38.2 +10.8% 50
Guinea Guinea 24 -2.12% 74
Gambia Gambia 21.5 +70.7% 80
Guinea-Bissau Guinea-Bissau 34 -16.4% 57
Equatorial Guinea Equatorial Guinea 3.86 +70.5% 117
Greece Greece 7.03 +76.8% 110
Grenada Grenada 17 -43.9% 91
Guatemala Guatemala 16 +2.77% 94
Guyana Guyana 39.9 +200% 46
Honduras Honduras 19.6 -30.1% 83
Croatia Croatia 0.271 -9.78% 142
Haiti Haiti 33.1 -15.4% 62
Hungary Hungary 0 145
Indonesia Indonesia 3.84 -60.8% 118
India India 3.19 +27.9% 121
Iran Iran 4.13 +79.4% 116
Iraq Iraq 5.94 +54.9% 112
Iceland Iceland 0 145
Israel Israel 35.1 +81% 56
Jamaica Jamaica 11.8 +12.8% 101
Jordan Jordan 53 -15.3% 32
Japan Japan 0 145
Kazakhstan Kazakhstan 2.7 +168% 123
Kenya Kenya 45.6 +3.71% 38
Kyrgyzstan Kyrgyzstan 24.4 +50.4% 73
Cambodia Cambodia 31.1 -38.8% 67
Kiribati Kiribati 47.8 -34.2% 36
St. Kitts & Nevis St. Kitts & Nevis 0 145
South Korea South Korea 0 145
Kuwait Kuwait 0 145
Laos Laos 68.6 -23% 25
Lebanon Lebanon 47.7 -12% 37
Liberia Liberia 44.6 +1.03% 40
Libya Libya 17.7 -10.5% 88
St. Lucia St. Lucia 119 +3.21% 10
Sri Lanka Sri Lanka 87.7 +247% 15
Lesotho Lesotho 133 +7.54% 9
Lithuania Lithuania 23.7 +34.1% 75
Luxembourg Luxembourg 87 -2.72% 16
Latvia Latvia 5.69 +25.9% 113
Morocco Morocco 17.2 -9.17% 90
Moldova Moldova 28.2 -31.1% 70
Madagascar Madagascar 18.4 -18.5% 87
Maldives Maldives 69.9 -74.8% 24
Mexico Mexico 0 -100% 145
Marshall Islands Marshall Islands 448 +9.95% 1
Mali Mali 7.8 +17.5% 109
Malta Malta 0 145
Myanmar (Burma) Myanmar (Burma) 31.7 +29.9% 66
Mongolia Mongolia 310 +244% 3
Mozambique Mozambique 71 +1.56% 23
Mauritania Mauritania 48 +147% 34
Mauritius Mauritius 9.61 -52.2% 105
Malawi Malawi 68.1 -7.03% 26
Malaysia Malaysia 0.0549 +3.82% 144
Namibia Namibia 82.9 +20% 19
Niger Niger 12.4 +10.4% 99
Nigeria Nigeria 16.6 -2.49% 92
Nicaragua Nicaragua 32.8 +22.2% 63
Netherlands Netherlands 0.783 +25.4% 137
Norway Norway 0 145
Nepal Nepal 33.5 +13.9% 59
Nauru Nauru 289 -19.3% 6
Oman Oman 0 145
Pakistan Pakistan 23.5 +40.3% 76
Panama Panama 13.7 -58.7% 97
Peru Peru 1.94 -8.56% 128
Philippines Philippines 1.64 -94% 129
Palau Palau 422 -7.37% 2
Papua New Guinea Papua New Guinea 37.2 +0.487% 51
Poland Poland 2.14 +44.7% 127
Portugal Portugal 3.68 -12.4% 120
Paraguay Paraguay 0.158 -95.3% 143
Palestinian Territories Palestinian Territories 86.8 -1.6% 17
Qatar Qatar 0 145
Romania Romania 0 -100% 145
Rwanda Rwanda 95.3 +45.7% 11
Saudi Arabia Saudi Arabia 0 145
Sudan Sudan 21.6 +71.1% 79
Senegal Senegal 35.7 +13.9% 55
Singapore Singapore 0 145
Solomon Islands Solomon Islands 31.9 +2.52% 64
Sierra Leone Sierra Leone 44.7 +9.8% 39
El Salvador El Salvador 12.4 +35% 100
Somalia Somalia 22.4 +18.9% 77
South Sudan South Sudan 18.9 +13.9% 86
São Tomé & Príncipe São Tomé & Príncipe 94 -29.4% 12
Suriname Suriname 15.4 -29.7% 95
Slovenia Slovenia 8.25 -15.2% 107
Eswatini Eswatini 213 +29.5% 7
Seychelles Seychelles 0 145
Syria Syria 92.5 +22.3% 13
Chad Chad 17.5 +81.4% 89
Togo Togo 31.8 +54.7% 65
Thailand Thailand 0.803 -6.51% 135
Tajikistan Tajikistan 41 +0.133% 41
Turkmenistan Turkmenistan 5.46 +264% 114
Timor-Leste Timor-Leste 76.9 -6.33% 21
Trinidad & Tobago Trinidad & Tobago 0.801 -18.3% 136
Tunisia Tunisia 38.8 +139% 49
Tuvalu Tuvalu 305 -41.3% 4
Tanzania Tanzania 35.8 -17.3% 54
Uganda Uganda 52.9 -24.6% 33
Uruguay Uruguay 0 -100% 145
United States United States 0 145
Uzbekistan Uzbekistan 1.52 +789% 130
St. Vincent & Grenadines St. Vincent & Grenadines 3.78 -86.5% 119
Venezuela Venezuela 0.926 +90.9% 133
Vietnam Vietnam 9.68 +55.2% 104
Vanuatu Vanuatu 68 -24.8% 27
Samoa Samoa 28.3 -48.4% 69
Yemen Yemen 26.2 +14.6% 71
South Africa South Africa 25.5 +53% 72
Zambia Zambia 85.9 -27.4% 18
Zimbabwe Zimbabwe 48 +61.9% 35

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