Tariff rate, applied, simple mean, primary products (%)

Source: worldbank.org, 03.09.2025

Year: 2022

Flag Country Value Value change, % Rank
Angola Angola 21.9 -2.54% 14
Albania Albania 2.2 -33.3% 108
Argentina Argentina 7.64 +0.925% 65
Australia Australia 1.26 +4.13% 111
Austria Austria 4.06 -15.6% 92
Azerbaijan Azerbaijan 9.65 -12.7% 57
Burundi Burundi 18.6 +13.3% 22
Belgium Belgium 4.06 -15.6% 92
Benin Benin 14.5 -0.069% 44
Burkina Faso Burkina Faso 11.6 +0.347% 54
Bangladesh Bangladesh 15.2 +3.76% 42
Bulgaria Bulgaria 4.06 -15.6% 92
Bahrain Bahrain 3.14 +7.53% 102
Bahamas Bahamas 15.2 +8.37% 43
Bosnia & Herzegovina Bosnia & Herzegovina 5.89 +66.9% 77
Belize Belize 27.6 +13.1% 2
Bermuda Bermuda 34.5 +6.71% 1
Bolivia Bolivia 7.75 -0.257% 64
Brazil Brazil 8.3 -1.31% 62
Barbados Barbados 20.2 +6.38% 17
Brunei Brunei 0.1 +100% 116
Bhutan Bhutan 9.35 +58.2% 58
Botswana Botswana 4.85 -11.7% 83
Central African Republic Central African Republic 25.5 +48.6% 3
Canada Canada 3.48 -10.3% 99
Switzerland Switzerland 15.8 -20.5% 38
Chile Chile 1.17 -2.5% 113
China China 6.37 -0.933% 73
Côte d’Ivoire Côte d’Ivoire 15.5 -0.386% 40
Cameroon Cameroon 23 +4.27% 12
Congo - Brazzaville Congo - Brazzaville 23.4 +45.1% 8
Colombia Colombia 3.52 +3.83% 98
Cape Verde Cape Verde 16.8 -2.5% 32
Costa Rica Costa Rica 4.07 -7.29% 91
Cuba Cuba 11.9 +1.19% 53
Cyprus Cyprus 4.06 -15.6% 92
Czechia Czechia 4.06 -15.6% 92
Germany Germany 4.06 -15.6% 92
Denmark Denmark 4.06 -15.6% 92
Dominican Republic Dominican Republic 8.25 +5.77% 63
Algeria Algeria 13.3 -11% 48
Ecuador Ecuador 6.86 +7.86% 68
Spain Spain 4.06 -15.6% 92
Estonia Estonia 4.06 -15.6% 92
Finland Finland 4.06 -15.6% 92
France France 4.06 -15.6% 92
Gabon Gabon 23.1 +14.5% 10
United Kingdom United Kingdom 3.19 +50.5% 100
Georgia Georgia 1.44 +9.09% 110
Ghana Ghana 16.5 +3.39% 33
Guinea Guinea 17.3 -4.43% 29
Gambia Gambia 17.9 -1.05% 25
Guinea-Bissau Guinea-Bissau 17.3 +3.05% 30
Equatorial Guinea Equatorial Guinea 24.6 +12.6% 4
Greece Greece 4.06 -15.6% 92
Grenada Grenada 19.1 +16.2% 19
Guatemala Guatemala 3.58 -5.54% 96
Guyana Guyana 17.6 +1.56% 27
Hong Kong SAR China Hong Kong SAR China 0 117
Honduras Honduras 2.42 -54.9% 107
Croatia Croatia 4.06 -15.6% 92
Hungary Hungary 4.06 -15.6% 92
Indonesia Indonesia 6.21 +6.7% 76
India India 17.3 +0.7% 28
Ireland Ireland 4.06 -15.6% 92
Iceland Iceland 9.04 -12.5% 59
Israel Israel 5.81 -3.01% 78
Italy Italy 4.06 -15.6% 92
Jamaica Jamaica 18.3 +14.2% 24
Jordan Jordan 14.3 +18% 45
Japan Japan 7.3 -5.19% 67
Kazakhstan Kazakhstan 4.87 +7.51% 82
Kenya Kenya 22.2 +27.1% 13
Cambodia Cambodia 14.1 +73.8% 46
South Korea South Korea 23.8 +15.5% 7
Kuwait Kuwait 4.39 +27.6% 87
Laos Laos 2.5 -3.85% 105
Liberia Liberia 18.5 -3.3% 23
Lesotho Lesotho 2.73 -34.8% 104
Lithuania Lithuania 4.06 -15.6% 92
Latvia Latvia 4.06 -15.6% 92
Macao SAR China Macao SAR China 0 117
Moldova Moldova 4.15 +1.72% 90
Madagascar Madagascar 13.5 +7.85% 47
Maldives Maldives 6.28 -30% 74
Mexico Mexico 3.6 -20.4% 95
North Macedonia North Macedonia 8.95 +4.92% 60
Mali Mali 16.2 +19.8% 36
Malta Malta 4.06 -15.6% 92
Myanmar (Burma) Myanmar (Burma) 4.31 -8.3% 88
Montenegro Montenegro 3.92 -0.508% 94
Mongolia Mongolia 6.27 +0.966% 75
Mauritania Mauritania 16.4 +5.2% 34
Mauritius Mauritius 1.19 -11.2% 112
Malaysia Malaysia 4.97 -11.6% 81
Namibia Namibia 5.11 +11.1% 80
Niger Niger 12.7 +7.92% 51
Nigeria Nigeria 13.1 -14.3% 49
Nicaragua Nicaragua 3.98 -8.08% 93
Netherlands Netherlands 4.06 -15.6% 92
Norway Norway 16.9 -23.3% 31
Nepal Nepal 20.2 +4.44% 16
New Zealand New Zealand 1.5 +20% 109
Oman Oman 4.25 +13.3% 89
Pakistan Pakistan 8.84 -4.02% 61
Panama Panama 11.1 -2.9% 55
Peru Peru 0.37 0% 114
Philippines Philippines 4.84 -2.22% 84
Poland Poland 4.06 -15.6% 92
Portugal Portugal 4.06 -15.6% 92
Paraguay Paraguay 6.61 +6.44% 71
Qatar Qatar 3.54 +9.26% 97
Romania Romania 4.06 -15.6% 92
Rwanda Rwanda 23.3 +13.3% 9
Saudi Arabia Saudi Arabia 6.72 +37.7% 70
Senegal Senegal 15.4 +0.26% 41
Singapore Singapore 0.32 -36% 115
Solomon Islands Solomon Islands 23.1 +32.5% 11
Sierra Leone Sierra Leone 18.6 -3.07% 21
El Salvador El Salvador 4.51 -6.24% 86
Suriname Suriname 15.8 -0.19% 39
Slovakia Slovakia 4.06 -15.6% 92
Slovenia Slovenia 4.06 -15.6% 92
Sweden Sweden 4.06 -15.6% 92
Eswatini Eswatini 3.15 -36.1% 101
Seychelles Seychelles 6.83 +10.9% 69
Chad Chad 24.1 +16.7% 5
Togo Togo 16.3 +17.6% 35
Thailand Thailand 12.6 -4.02% 52
Tonga Tonga 7.62 -0.262% 66
Trinidad & Tobago Trinidad & Tobago 15.9 -34.6% 37
Turkey Turkey 21.9 -4.54% 15
Tanzania Tanzania 19.8 +9.2% 18
Uganda Uganda 23.8 +6.87% 6
Ukraine Ukraine 2.79 -7.31% 103
Uruguay Uruguay 6.58 -4.08% 72
United States United States 2.48 -3.13% 106
St. Vincent & Grenadines St. Vincent & Grenadines 17.9 +5.93% 26
Venezuela Venezuela 11.1 -6.51% 56
Vietnam Vietnam 5.37 -7.57% 79
Vanuatu Vanuatu 19.1 +10.4% 20
South Africa South Africa 4.63 -5.32% 85
Zambia Zambia 12.9 -3.3% 50

                    
# 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 = 'TM.TAX.TCOM.SM.AR.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 <- 'TM.TAX.TCOM.SM.AR.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))