Expenditure on primary education (% of government expenditure on education)

Source: worldbank.org, 03.09.2025

Year: 2014

Flag Country Value Value change, % Rank
Aruba Aruba 26.2 +8.17% 67
Afghanistan Afghanistan 59.1 -1.5% 4
Andorra Andorra 22.3 -30.7% 78
Argentina Argentina 30.1 +0.0934% 53
Australia Australia 32.6 -0.589% 44
Austria Austria 16.3 -0.035% 89
Belgium Belgium 23.1 -1.03% 73
Benin Benin 48.9 -2.37% 16
Burkina Faso Burkina Faso 65.4 +9.4% 1
Bahrain Bahrain 32.5 +1.33% 45
Belize Belize 37.8 -5.51% 32
Bermuda Bermuda 29.9 -2.95% 55
Brazil Brazil 26.8 -4.48% 65
Bhutan Bhutan 32 +46.5% 47
Switzerland Switzerland 29.6 -0.407% 57
Chile Chile 24.8 -15.1% 69
Côte d’Ivoire Côte d’Ivoire 39.1 -0.473% 27
Colombia Colombia 35.6 +3.43% 38
Comoros Comoros 56.4 +2.2% 7
Cape Verde Cape Verde 42.9 +11.8% 23
Costa Rica Costa Rica 36.3 -0.788% 36
Cyprus Cyprus 31.5 +3.03% 48
Czechia Czechia 18.6 +4.95% 86
Germany Germany 12.8 +0.0709% 93
Denmark Denmark 27.2 +9.38% 63
Ecuador Ecuador 25.7 -16.9% 68
Spain Spain 26.3 +0.794% 66
Estonia Estonia 24.6 -19.8% 70
Ethiopia Ethiopia 30.5 +26.7% 52
Finland Finland 19.1 +2.68% 83
Gabon Gabon 29.2 +15.8% 58
United Kingdom United Kingdom 28.9 -2.93% 60
Ghana Ghana 21.7 -11% 80
Guinea Guinea 38.9 -3.07% 28
Gambia Gambia 55.2 +6.51% 9
Guatemala Guatemala 49.1 -6.79% 15
Hong Kong SAR China Hong Kong SAR China 18.9 +7.46% 85
Hungary Hungary 12.5 -39% 94
Indonesia Indonesia 43.7 +2.87% 20
Ireland Ireland 36.4 +0.495% 34
Iran Iran 26.9 +2.57% 64
Iceland Iceland 29 +1.45% 59
Israel Israel 37.9 +0.811% 31
Italy Italy 24.5 +0.374% 71
Jamaica Jamaica 36.4 +0.353% 35
Japan Japan 33.1 -0.95% 42
Kenya Kenya 36.1 -0.166% 37
Cambodia Cambodia 48.5 -2.51% 17
Laos Laos 40.6 -1.68% 25
St. Lucia St. Lucia 35.5 -4.13% 39
Sri Lanka Sri Lanka 28.7 +24.7% 61
Lithuania Lithuania 15.2 -0.508% 91
Luxembourg Luxembourg 30.8 -9.57% 51
Latvia Latvia 30 +0.09% 54
Monaco Monaco 16 +21.9% 90
Moldova Moldova 22.7 +24.2% 76
Maldives Maldives 39.8 +1.54% 26
Mexico Mexico 32.8 -13.2% 43
Mali Mali 43.2 +9.45% 21
Malta Malta 21 +3.84% 82
Mongolia Mongolia 24.4 +7.89% 72
Mauritius Mauritius 22.7 -17.4% 77
Malawi Malawi 49.5 +34.7% 13
Malaysia Malaysia 32.2 +0.308% 46
Namibia Namibia 16.9 -57.8% 88
Niger Niger 52.2 -2.01% 11
Norway Norway 21.6 -3.22% 81
Nepal Nepal 53.5 -2.39% 10
New Zealand New Zealand 23 -0.127% 74
Pakistan Pakistan 35.1 +7.5% 40
Peru Peru 38.5 -3.07% 30
Poland Poland 31.4 +3.67% 49
Puerto Rico Puerto Rico 22 +1.68% 79
Portugal Portugal 29.9 +0.694% 56
Romania Romania 13.7 -13.8% 92
Senegal Senegal 34.9 -2.05% 41
Sierra Leone Sierra Leone 43.1 -11.8% 22
El Salvador El Salvador 42.5 -0.634% 24
South Sudan South Sudan 57.5 -7.84% 6
São Tomé & Príncipe São Tomé & Príncipe 55.8 +4.73% 8
Slovakia Slovakia 19.1 -3.08% 84
Slovenia Slovenia 28.2 +1.1% 62
Sweden Sweden 22.8 +1.79% 75
Eswatini Eswatini 50.8 +4.35% 12
Seychelles Seychelles 37.4 +8.89% 33
Togo Togo 58.9 +0.62% 5
Timor-Leste Timor-Leste 64.9 +0.234% 2
Tanzania Tanzania 49.2 +17.3% 14
Uganda Uganda 59.2 +3.36% 3
Ukraine Ukraine 18 +3.26% 87
United States United States 31 -0.465% 50
Vanuatu Vanuatu 47.1 -13.2% 19
South Africa South Africa 38.8 -2.81% 29
Zimbabwe Zimbabwe 47.8 +2.56% 18

Expenditure on primary education as a percentage of government expenditure on education plays a crucial role in understanding how much prioritization governments give to the foundational level of education. This indicator reflects the commitment to fostering basic education, indicating a nation's dedication to ensuring that every child has access to essential educational resources and learning opportunities. The allocation of funds toward primary education directly impacts literacy rates, economic development, and overall societal well-being.

The significance of this indicator cannot be understated. Countries investing a substantial part of their education budgets into primary education often see better educational outcomes, such as higher enrollment rates, improved retention, and enhanced quality of teaching. Such investments foster the development of a skilled workforce, decrease poverty, and contribute to sustainable socio-economic growth. The concentration on primary education sets the groundwork for higher education levels, forming a stepping stone for future academic and professional successes.

Several relations exist between the expenditure on primary education and other socio-economic indicators. For instance, countries with higher literacy rates correlate strongly with increased government expenditure in primary education. Similarly, there is often a direct relationship between economic growth and educational investment; nations with robust economies tend to prioritize education to maintain their competitive edge in the global market. Additionally, the Health and Education indicators often illustrate that government investment in education improves public health by fostering a better-informed population that values and practices healthy behaviors.

The factors affecting the expenditure on primary education are manifold. Economically, a country's financial health determines how much funding can be allocated to education. In less economically stable nations, budget constraints may lead to reduced spending on primary education despite its importance. Additionally, political will can affect educational budgets significantly; governments that prioritize education in their agendas typically allocate more resources toward primary education. Other influencing factors include demographic changes, such as population growth among school-age children, which can strain educational resources and budgets, and social factors that may prioritize immediate economic concerns over long-term investments in education.

To enhance expenditure on primary education, countries can adopt several strategies. First, increasing public awareness regarding the long-term benefits of investing in education can galvanize public support for education initiatives, potentially influencing government decisions. Second, governments could improve resource allocation efficiency by creating transparent budgets that directly illustrate education spending. Additionally, international aid and partnerships with NGOs can garner additional funding to supplement national budgets. Foreign aid programs often focus on improving educational outcomes and infrastructure, which can substantially increase investment in primary education.

Despite the importance of this indicator, there are inherent flaws in relying solely on it for assessing educational quality. For instance, a high percentage of spending on primary education does not automatically translate to quality education. Countries might allocate a significant portion of their budget to primary education while still experiencing poor educational outcomes if those resources are mismanaged or used inefficiently. Moreover, disparities in spending within countries can also lead to inequitable access to quality education, as regions with higher socioeconomic statuses may benefit disproportionately compared to underprivileged areas.

Examining the available data from 2010 to 2019 demonstrates the shifting dynamics in government expenditure on primary education. In 2010, the mean expenditure stood at 33.2%, indicating a strong commitment to foundational education. However, this number fluctuated over the following years, with a notable drop to 31.59% in 2013. By 2019, the median value stabilized at 36.33%, showing a renewed focus on primary education, particularly in countries like Myanmar, which maintained the same percentage for both the top and bottom of the spectrum. This reflection suggests that while some areas improved their educational funding, others remained stagnant, raising concerns about equitable access to educational resources.

In summary, the expenditure on primary education as a percentage of government expenditure on education serves as a pivotal indicator of a nation's priorities regarding educational investment. Through understanding its importance, relation to various socio-economic factors, strategies for enhancement, and the inherent flaws in solely relying on expenditure percentages, stakeholders can work towards creating a more equitable and effective educational landscape. Bridging the gap between budget allocation and educational quality remains a critical challenge for many nations, requiring comprehensive strategies to invest in the future workforce and ultimately, the sustainability of society.

                    
# 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 = 'SE.XPD.PRIM.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 <- 'SE.XPD.PRIM.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))