Pupil-teacher ratio, secondary

Source: worldbank.org, 03.09.2025

Year: 2018

Flag Country Value Value change, % Rank
Afghanistan Afghanistan 33.5 +0.784% 4
Albania Albania 11.2 -3.48% 43
Andorra Andorra 8.02 -2.57% 65
Armenia Armenia 8.02 -17.8% 64
Antigua & Barbuda Antigua & Barbuda 9.3 -3.58% 58
Azerbaijan Azerbaijan 7.61 67
Burundi Burundi 26.6 -5.11% 10
Burkina Faso Burkina Faso 23.1 -0.904% 16
Bangladesh Bangladesh 35.1 +3.27% 2
Bahrain Bahrain 10.2 +0.914% 52
Bahamas Bahamas 12.5 -11.3% 37
Bosnia & Herzegovina Bosnia & Herzegovina 9.12 -2.35% 59
Belarus Belarus 8.56 +2.47% 61
Belize Belize 16.7 +0.997% 27
Bolivia Bolivia 18.5 -2.14% 22
Barbados Barbados 17.9 -2.82% 24
Brunei Brunei 8.27 -5.14% 63
Bhutan Bhutan 10.8 -1.77% 48
China China 13.3 -0.379% 35
Côte d’Ivoire Côte d’Ivoire 27.3 +3.67% 8
Colombia Colombia 25.9 -0.387% 14
Comoros Comoros 8.31 +56.4% 62
Cape Verde Cape Verde 15.4 -1.34% 30
Costa Rica Costa Rica 12.4 -6.66% 38
Cuba Cuba 9.63 +1.65% 57
Cayman Islands Cayman Islands 11 +108% 47
Djibouti Djibouti 25.4 +11.8% 15
Ecuador Ecuador 20.6 -1.8% 18
Egypt Egypt 15.2 -0.335% 32
Eritrea Eritrea 35 -4.23% 3
Georgia Georgia 7.58 +2.46% 68
Ghana Ghana 16 +2.43% 29
Grenada Grenada 12.8 +8.63% 36
Guatemala Guatemala 10.5 -0.187% 51
Hong Kong SAR China Hong Kong SAR China 11.2 -2.57% 42
Indonesia Indonesia 15.2 -0.791% 31
India India 28.5 +3.94% 5
Jamaica Jamaica 16.7 +7.78% 28
Jordan Jordan 12.3 +7.26% 39
Kazakhstan Kazakhstan 6.96 +5.57% 70
Kyrgyzstan Kyrgyzstan 10.6 +2% 50
Laos Laos 18.2 +0.109% 23
St. Lucia St. Lucia 11.1 -2.38% 44
Sri Lanka Sri Lanka 17.5 +0.463% 25
Macao SAR China Macao SAR China 9.76 -3.75% 56
Morocco Morocco 19.4 -4.16% 20
Moldova Moldova 9.86 -0.48% 55
Madagascar Madagascar 19.3 -3.72% 21
Myanmar (Burma) Myanmar (Burma) 27.2 +3.14% 9
Mauritania Mauritania 25.9 +9.33% 13
Mauritius Mauritius 11 -13.1% 46
Malawi Malawi 72.3 +90.8% 1
Malaysia Malaysia 11.4 -7.11% 41
Oman Oman 10.2 +2.45% 53
Pakistan Pakistan 20.4 +5.22% 19
Peru Peru 14.2 -2.6% 33
Palestinian Territories Palestinian Territories 17.3 -13.7% 26
Qatar Qatar 11 +6.02% 45
Rwanda Rwanda 28.2 +40.6% 6
Saudi Arabia Saudi Arabia 11.5 +3.44% 40
El Salvador El Salvador 27.6 -0.956% 7
San Marino San Marino 5.84 -59.7% 71
Serbia Serbia 7.95 -1.68% 66
Seychelles Seychelles 10.8 -7.03% 49
Turks & Caicos Islands Turks & Caicos Islands 10.1 +5.05% 54
Thailand Thailand 25.9 -1.6% 12
Timor-Leste Timor-Leste 26.5 -2.72% 11
Tuvalu Tuvalu 8.64 +3.13% 60
Tanzania Tanzania 20.9 +21.9% 17
Ukraine Ukraine 7.34 +1.82% 69
St. Vincent & Grenadines St. Vincent & Grenadines 13.9 -3.43% 34

The pupil-teacher ratio (PTR) in secondary education is a crucial educational indicator that reflects the number of students for every teacher in a school or educational system. Specifically, it helps to assess the quality of education by evaluating the ability of educators to manage their classrooms effectively, thus impacting the learning experience and outcomes of students. An optimal pupil-teacher ratio is generally considered essential for promoting better educational attainment, as it allows teachers to give more personalized attention to each student, fostering an environment conducive to learning.

The importance of the pupil-teacher ratio cannot be overstated. A lower ratio typically signifies smaller class sizes, which are linked to better student performance, greater teacher satisfaction, and lower dropout rates. Conversely, a higher ratio may indicate overcrowded classrooms, where teachers are overwhelmed and unable to meet the individual needs of students. Consequently, a high pupil-teacher ratio may correlate with diminished educational outcomes, including poor academic performance and emotional distress among students.

To understand the significance of pupil-teacher ratios, one must also recognize its relationship with other educational indicators, such as student performance, graduation rates, and overall quality of education. For instance, a systematic analysis often reveals that regions with lower pupil-teacher ratios usually experience higher graduation rates and improved standardized test scores. Conversely, as the pupil-teacher ratio increases, student performance tends to fluctuate negatively. This correlation emphasizes the necessity for educational policymakers to focus on maintaining a favorable pupil-teacher ratio as a strategic approach to enhancing educational quality.

Several factors can affect the pupil-teacher ratio. Economic disparities, for example, play a significant role in determining the availability of qualified teachers. Wealthier areas often have the resources to attract and retain qualified educators, consequently lowering the pupil-teacher ratio. In contrast, developing regions may struggle with recruitment and retention due to low funding, inadequate training opportunities, and unfavorably working conditions. Additionally, cultural attitudes towards education, governmental policies, and population demographics also contribute to variations in pupil-teacher ratios across different regions.

Addressing high pupil-teacher ratios requires implementing targeted strategies. Investments in education, particularly in teacher recruitment and training, can significantly impact this indicator. For example, scholarship programs aimed at aspiring teachers in underserved areas can help increase the supply of qualified educators. Moreover, class size reduction initiatives funded by government budgets can also assist in reaching optimal pupil-teacher ratios. Innovative strategies such as integrating technology and teacher assistants can further alleviate the burdens faced by educators and improve the learning environment.

Despite the potential solutions, there are inherent flaws in relying solely on pupil-teacher ratios as an educational quality indicator. While a low pupil-teacher ratio is generally desirable, it does not guarantee effective teaching or positive student outcomes. Other factors, such as teacher quality, curriculum, and the socio-economic context of schools, also play critical roles in education. Therefore, a holistic approach that considers multiple indicators alongside pupil-teacher ratios is necessary for a complete understanding of educational effectiveness.

Examining the data surrounding pupil-teacher ratios offers insightful perspectives. For the year 2019, the median pupil-teacher ratio in secondary education stood at 21.0 students per teacher. This figure serves as a benchmark, indicating that half of the regions reporting their data had higher ratios, while the other half reported lower ratios. Among the top areas, we find Nepal, with a ratio of 28.26; Djibouti at 26.83; Ghana at 15.17; and Kazakhstan having a strikingly low ratio of 7.68. The wide variance among these regions can shed light on education policies, funding allocation, and societal values regarding education.

Interestingly, the bottom figures reflect the same areas but in a reverse context. Kazakhstan ranks as the top-performing area in terms of lower pupil-teacher ratios, indicating a lesser number of students assigned per educator. However, Ghana and Djibouti, which tend to have higher pupil-teacher ratios, suggest challenges in educational delivery, Capacity constraints, and possible issues in their educational systems which may ultimately affect student outcomes negatively.

When compared against historical world values, we observe a gradual increase in large pupil-teacher ratios reaching from 15.92 in 1970 to an overall decline to around 17.0 in the years leading up to 2019. This shifts indicates an ongoing concern regarding how educational policies address the need for lower ratios over the decades. With numerous countries still facing challenges in achieving optimal ratios, it’s evident that many educational systems globally still have much work ahead to enhance classroom conditions to ensure that students receive the focused attention and support they require.

In conclusion, the pupil-teacher ratio in secondary education is an essential metric that can signal the health of an educational environment. It interconnects with several factors including economic disparities, quality of teaching, and educational policies. Moreover, while it provides valuable insights into classroom dynamics and educational outcomes, it is imperative to consider it alongside other relevant indicators for a comprehensive understanding of educational effectiveness. Continuous efforts must be made to seek innovative strategies aimed at optimizing pupil-teacher ratios, thus enabling educational systems to meet the needs of all learners effectively.

                    
# 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.SEC.ENRL.TC.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.SEC.ENRL.TC.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))