Domestic general government health expenditure (% of current health expenditure)

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 0.786 -76.2% 191
Angola Angola 51.6 -6.65% 103
Albania Albania 45.2 +13.9% 117
Andorra Andorra 73.5 -0.729% 41
United Arab Emirates United Arab Emirates 59.2 -7.61% 82
Argentina Argentina 58.4 -4.51% 85
Armenia Armenia 17.2 -3.05% 174
Antigua & Barbuda Antigua & Barbuda 57.4 -8.89% 87
Australia Australia 74.1 -2.5% 38
Austria Austria 77.5 -0.83% 29
Azerbaijan Azerbaijan 30.3 -4.07% 158
Burundi Burundi 18.9 -23.7% 171
Belgium Belgium 75.2 -1.98% 33
Benin Benin 19.2 +56.2% 169
Burkina Faso Burkina Faso 40.2 -6.07% 135
Bangladesh Bangladesh 6.48 -61.7% 189
Bulgaria Bulgaria 62.5 -2.86% 74
Bahrain Bahrain 64.9 +1.69% 66
Bahamas Bahamas 56.4 +4.21% 91
Bosnia & Herzegovina Bosnia & Herzegovina 65.8 -3.68% 63
Belarus Belarus 67.6 -8.99% 60
Belize Belize 62.3 -10.5% 76
Bolivia Bolivia 69.8 -3.14% 54
Brazil Brazil 44.9 +0.46% 121
Barbados Barbados 45 -17.1% 119
Brunei Brunei 92.3 -0.782% 1
Bhutan Bhutan 49 -26.8% 109
Botswana Botswana 75.1 -1.97% 35
Central African Republic Central African Republic 16 +15.8% 175
Canada Canada 71.2 -2.39% 50
Switzerland Switzerland 35 -2.48% 148
Chile Chile 50.4 -6.03% 107
China China 54.9 +1.49% 96
Côte d’Ivoire Côte d’Ivoire 36.8 -13% 142
Cameroon Cameroon 15 +33.2% 176
Congo - Kinshasa Congo - Kinshasa 18.4 +9.64% 173
Congo - Brazzaville Congo - Brazzaville 36.7 -25.4% 143
Colombia Colombia 70.4 -2.96% 53
Comoros Comoros 10.3 -29.7% 185
Cape Verde Cape Verde 64.2 -13.1% 70
Costa Rica Costa Rica 69 -1.97% 56
Cuba Cuba 88.8 -3.02% 2
Cyprus Cyprus 80.1 -1.2% 22
Czechia Czechia 84.8 -2.01% 11
Germany Germany 80.3 +1.57% 21
Djibouti Djibouti 41.4 +55.7% 127
Dominica Dominica 71.3 +11.7% 49
Denmark Denmark 84 -0.354% 15
Dominican Republic Dominican Republic 58.4 -12.6% 84
Algeria Algeria 47.4 -17.3% 112
Ecuador Ecuador 61 -3.42% 81
Egypt Egypt 37.9 +0.587% 140
Eritrea Eritrea 23.2 +9.47% 165
Spain Spain 74 +0.429% 39
Estonia Estonia 74.8 -1.68% 36
Ethiopia Ethiopia 25.3 -17.2% 162
Finland Finland 81.7 +0.468% 18
Fiji Fiji 79.6 +53.6% 25
France France 75.4 -0.508% 32
Micronesia (Federated States of) Micronesia (Federated States of) 10.8 +6.72% 183
Gabon Gabon 64.2 +8.43% 71
United Kingdom United Kingdom 83.1 -1.48% 16
Georgia Georgia 42.2 -21% 126
Ghana Ghana 55.4 +1.94% 93
Guinea Guinea 18.4 +0.519% 172
Gambia Gambia 44.6 -11.3% 122
Guinea-Bissau Guinea-Bissau 13.6 -2.65% 179
Equatorial Guinea Equatorial Guinea 26.2 +31.4% 160
Greece Greece 54.1 -8.67% 97
Grenada Grenada 40.4 -0.447% 131
Guatemala Guatemala 32.6 -3.44% 152
Guyana Guyana 71.7 +5.24% 48
Honduras Honduras 40.7 +8.58% 129
Croatia Croatia 84.5 +0.426% 13
Haiti Haiti 10.7 -5.42% 184
Hungary Hungary 72.3 +0.162% 46
Indonesia Indonesia 51.8 -12.9% 102
India India 39.1 -3.19% 137
Ireland Ireland 77.4 -0.0526% 30
Iran Iran 49.2 -11% 108
Iraq Iraq 50.9 +3.14% 104
Iceland Iceland 84.7 +1.07% 12
Israel Israel 66.5 -1.25% 62
Italy Italy 74.4 -0.0113% 37
Jamaica Jamaica 76.2 +7.06% 31
Jordan Jordan 36.5 +2.58% 144
Japan Japan 86 +0.968% 8
Kazakhstan Kazakhstan 61.5 -5.81% 80
Kenya Kenya 46.7 -4.29% 114
Kyrgyzstan Kyrgyzstan 53.7 -2.85% 98
Cambodia Cambodia 24.9 -6.37% 163
Kiribati Kiribati 80.9 +7.65% 20
St. Kitts & Nevis St. Kitts & Nevis 52.6 -8.45% 100
South Korea South Korea 62.8 +3.46% 73
Kuwait Kuwait 87.2 -4.09% 4
Laos Laos 31 +18.4% 156
Lebanon Lebanon 34.3 +18.7% 149
Liberia Liberia 9.57 +19.3% 186
Libya Libya 67.7 -5.92% 59
St. Lucia St. Lucia 42.5 +0.239% 125
Sri Lanka Sri Lanka 40.3 -14.5% 134
Lesotho Lesotho 50.7 +24% 105
Lithuania Lithuania 65.3 -3.09% 65
Luxembourg Luxembourg 87.1 +0.0444% 5
Latvia Latvia 64.7 -6.64% 68
Morocco Morocco 40.9 +0.0199% 128
Monaco Monaco 86.7 -3.45% 7
Moldova Moldova 64.8 -0.654% 67
Madagascar Madagascar 28.8 +37% 159
Maldives Maldives 78.1 +9.98% 27
Mexico Mexico 51.9 +3.59% 101
Marshall Islands Marshall Islands 37.6 -9.7% 141
North Macedonia North Macedonia 56.9 +4.4% 88
Mali Mali 38.9 +2% 138
Malta Malta 67 -0.533% 61
Myanmar (Burma) Myanmar (Burma) 11.1 -33.5% 181
Montenegro Montenegro 63 +2.94% 72
Mongolia Mongolia 35.2 -39.7% 147
Mozambique Mozambique 30.8 +9.01% 157
Mauritania Mauritania 39.2 -0.894% 136
Mauritius Mauritius 47.2 -7.08% 113
Malawi Malawi 13.5 -24.3% 180
Malaysia Malaysia 50.6 -10% 106
Namibia Namibia 45.6 -3.23% 115
Niger Niger 35.3 -3.31% 146
Nigeria Nigeria 14.5 +9.27% 178
Nicaragua Nicaragua 57.6 -9.11% 86
Netherlands Netherlands 68.5 -1.8% 58
Norway Norway 85.7 -0.26% 10
Nepal Nepal 31.6 -4.7% 154
Nauru Nauru 86.9 +10.8% 6
New Zealand New Zealand 81.2 +5.27% 19
Oman Oman 84.4 -3.22% 14
Pakistan Pakistan 38.2 +2.63% 139
Panama Panama 56.2 +1.16% 92
Peru Peru 64.2 -4.03% 69
Philippines Philippines 45.1 +0.814% 118
Palau Palau 40.6 -4.3% 130
Papua New Guinea Papua New Guinea 58.5 +17% 83
Poland Poland 73.2 +1.57% 43
Portugal Portugal 62.4 -0.575% 75
Paraguay Paraguay 52.8 -5.06% 99
Palestinian Territories Palestinian Territories 40.3 -1.34% 132
Qatar Qatar 82.2 -3.33% 17
Romania Romania 77.7 +2.67% 28
Russia Russia 70.6 +1.55% 52
Rwanda Rwanda 35.7 -13% 145
Saudi Arabia Saudi Arabia 78.2 +1.63% 26
Sudan Sudan 25.7 -4.82% 161
Senegal Senegal 22 -18.4% 168
Singapore Singapore 56.6 -6.95% 89
Solomon Islands Solomon Islands 68.9 -1.28% 57
Sierra Leone Sierra Leone 19 -15.9% 170
El Salvador El Salvador 62.2 -1.88% 77
San Marino San Marino 88.6 +0.477% 3
Somalia Somalia 6.59 -36.7% 188
Serbia Serbia 61.6 -1.4% 78
South Sudan South Sudan 8.58 -42.2% 187
São Tomé & Príncipe São Tomé & Príncipe 55.3 +28.9% 94
Suriname Suriname 65.5 +10.9% 64
Slovakia Slovakia 79.9 +0.181% 23
Slovenia Slovenia 73.5 +0.283% 42
Sweden Sweden 86 -0.145% 9
Eswatini Eswatini 44.9 -9.15% 120
Seychelles Seychelles 73.9 -2.35% 40
Syria Syria 33.9 -7.66% 151
Chad Chad 22.3 +20.1% 166
Togo Togo 11 +10.9% 182
Thailand Thailand 72.7 +3.32% 44
Tajikistan Tajikistan 23.4 +1.07% 164
Turkmenistan Turkmenistan 14.9 -13.4% 177
Timor-Leste Timor-Leste 72 +13.4% 47
Tonga Tonga 48.8 +2.94% 110
Trinidad & Tobago Trinidad & Tobago 44.6 -4.3% 123
Tunisia Tunisia 56.6 -4.28% 90
Turkey Turkey 75.2 -4.62% 34
Tuvalu Tuvalu 72.5 +39.7% 45
Tanzania Tanzania 31.6 +16% 155
Uganda Uganda 22.3 +6.22% 167
Uruguay Uruguay 70.7 -3.76% 51
United States United States 55.2 -0.294% 95
Uzbekistan Uzbekistan 34 -13.2% 150
St. Vincent & Grenadines St. Vincent & Grenadines 69 +1.96% 55
Venezuela Venezuela 45.4 +35.4% 116
Vietnam Vietnam 43.6 +0.978% 124
Vanuatu Vanuatu 40.3 +48.8% 133
Samoa Samoa 79.7 +5.81% 24
Yemen Yemen 4.94 +1.53% 190
South Africa South Africa 61.6 -2.9% 79
Zambia Zambia 47.7 +12.2% 111
Zimbabwe Zimbabwe 32.5 -0.833% 153

                    
# 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.GHED.CH.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 <- 'SH.XPD.GHED.CH.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))