The United Nations reports both the Human Development Index (HDI) and the Inequality-adjusted Human Development Index (IHDI). Although the data source is the same, these indexes represent different things. The HDI represents the national average of human development achievements in the three basic dimensions: i) life expectancy (health), ii) education, and iii) income. Like all averages, it conceals disparities in human development across the population within the same country. For example, two countries with the same HDI average may have a widely different improvements across the three dimensions1. In turn, the IHDI accounts for the distribution of a country’s achievements in the same three dimensions among its population.

Naively interpreted, the HDI tells us the average development of a country regardless of how such development is distributed among its citizes, whereas the IHDI tells us how large is the inequality gap bewteen those enjoying the highest developments and those standing the lowest achievements in a given country.

For this project, there are three kinds of pre-processed inequality datasets available: Adjusted index, Percentage, and Coefficients. The example shown below uses Adjusted index and Percentage datasets specifically about life expectancy inequality. Each dataset has entries spanning over multiple years, one column per year.


Life expectancy descriptive statistics

Global percentage of life expectancy

# Read percentage dataset
Percentage_Expectancy <- read.csv2("data/Ineq_Life_Expectancy.csv")
colorSequence1 <- c("#596791","#ca3355","#acc11d","#565318","#4146ca","#e8737b","#251141","#f1e943")
colorSequence2 <- c("#596791","#565318","#e8737b")

The “Ineq_Life_Expectancy.csv” dataset has percentage data from all the countries of the world from 2010 until 2017.

# Subset by year
Percentage_2017 <- subset (Percentage_Expectancy , Percentage_Expectancy$year == 'X2017')
# Sort by value
Percentage_2017 <- Percentage_2017[order(Percentage_2017$value),]
# Save the sorted list of countries
sortedCountryNames <- factor(Percentage_2017$iso3, levels = Percentage_2017$iso3)

A visual output of the sorted dataset shows that the lower half of sorted countries by life-expectancy inequality is between 2.4% and 12.1%, whereas the upper half varies from 12.2% up to 42.2%. There is a high contrast between European and African countries.

library(ggplot2)
# assign dataset 
plot <- ggplot(Percentage_2017)
# add canvas aesthetics
plot <- plot + aes(x=sortedCountryNames, y=value)
# Median 185/2
plot <- plot + geom_vline(xintercept = 92.5, color = 'gray59')
# Median label
plot <- plot + geom_text(aes(x= 90.5, y= 40, label="Median", angle = 90), color = 'gray59', size=3)
# add bars layer
plot <- plot + geom_bar(aes(x=sortedCountryNames, y=value, fill=as.factor(Continent)), stat = "identity", alpha= 0.8)
# add text layer
plot <- plot + geom_text(aes (y = value + 1, label = sortedCountryNames, angle = 90), size=1.3 )
# Add customized color palette
plot <- plot + scale_fill_manual(values = colorSequence1)
# Customize legends
plot <- plot + guides(fill=guide_legend(title="Continent"))
# Customize labels
plot <- plot + labs(title = "Sorted life expectancy inequality in the world", subtitle = "Year 2017", caption = " 1: Africa, 2:Antartida (removed), 3:Asia, 4:Europe, 5:North America, 6:Oceania, 7:South America",x = "World countries", y = "Percentage")
# adjust background, remove x label
plot <- plot + theme(legend.position=c(0.1,0.7), axis.text.x = element_blank())
# Hide x tick marks, labels, and grid lines
plot <- plot + scale_x_discrete(breaks=NULL)
# plot output
plot

By average, the six less inequal countries are: Iceland, Hong Kong, Singapore, Norway, Sweden, and Finland. The six most inequal countries in 2017 are: Burundi, Guinea-Bissau, Somalia, Sierra Leone, Central African Republic, and Chad.

# Less inequal
#head(Percentage_2017$country_name)
# More inequal
#tail(Percentage_2017$country_name)

Global indexed life expectancy

# Read percentage dataset
Adjusted_Expectancy <- read.csv2("data/Adjusted_Life_Expectancy.csv")
# Subset by year
Adjusted_2017 <- subset (Adjusted_Expectancy , Adjusted_Expectancy$year == 'X2017')
# Sort by value
Adjusted_2017 <- Adjusted_2017[order(-Adjusted_2017$value),]
# Save the sorted list of countries
sortedCountryNamesAdjusted <- factor(Adjusted_2017$iso3, levels = Adjusted_2017$iso3)
library(ggplot2)
# assign dataset 
plot <- ggplot(Adjusted_2017)
# add canvas aesthetics
plot <- plot + aes(x=sortedCountryNamesAdjusted, y=value)
# Median 185/2
plot <- plot + geom_vline(xintercept = 92.5, color = 'gray59')
# Median label
plot <- plot + geom_text(aes(x= 90.5, y= 0.85, label="Median", angle = 90), color = 'gray59', size=3)
# add bars layer
plot <- plot + geom_bar(aes(x=sortedCountryNamesAdjusted, y=value, fill=as.factor(Continent)), stat = "identity", alpha= 0.8)
# add text layer
plot <- plot + geom_text(aes (y=value + 0.03, label=sortedCountryNamesAdjusted, angle = 90), size=1.3 )
# Add customized color palette
plot <- plot + scale_fill_manual(values = colorSequence1)
# Customize legends
plot <- plot + guides(fill=guide_legend(title="Continent"))
# Customize labels
plot <- plot + labs(title = "Indexed life expectancy inequality in the world. Sorted chart", subtitle = "Year 2017", caption = " 1: Africa, 2:Antartida (removed), 3:Asia, 4:Europe, 5:North America, 6:Oceania, 7:South America",x = "World countries", y = "Indexed life expectancy")
# adjust background, remove x label
plot <- plot + theme(legend.position=c(0.93,0.75), axis.text.x = element_blank())
# Hide x tick marks, labels, and grid lines
plot <- plot + scale_x_discrete(breaks=NULL)
# plot output
plot

The top six countries with better distribution of achievements ameliorating life expectancy inequalities among citizes are: Hong Kong, Japan, Singapore, Iceland, Spain, and Italy. The last six in 2017 are: Cote d’Ivore, Somalia, Nigeria, Sierra Leone, Central African Republic, and Chad.

# More inequal
#head(Adjusted_2017$country_name)
# Less inequal
#tail(Adjusted_2017$country_name)

A Parallel between Africa and America

# Subset Africa and America
Africa_America_2017 <- subset(Adjusted_2017, (Adjusted_2017$Continent == 1 | Adjusted_2017$Continent == 7 | Adjusted_2017$Continent == 5))
# Sort by value
Africa_America_2017 <- Africa_America_2017[order(-Africa_America_2017$value),]
# Save the sorted list of countries
sortedCountryNamesAdjusted <- factor(Africa_America_2017$iso3, levels = Africa_America_2017$iso3)

# assign dataset 
plot <- ggplot(Africa_America_2017)
# add canvas aesthetics
plot <- plot + aes(x=sortedCountryNamesAdjusted, y=value)
# Median 185/2
plot <- plot + geom_vline(xintercept = 27.5, color = 'gray59')
# Median label
plot <- plot + geom_text(aes(x= 28.5, y= 0.88, label="Global Median", angle = 90), color = 'gray59', size=3)
# add bars layer
plot <- plot + geom_bar(aes(x=sortedCountryNamesAdjusted, y=value, fill=as.factor(Continent)), stat = "identity", alpha= 0.8)
# add text layer
plot <- plot + geom_text(aes (y=value + 0.03, label=sortedCountryNamesAdjusted, angle = 90), size=1.7 )
# Add customized color palette
plot <- plot + scale_fill_manual(values = colorSequence2)
# Customize legends
plot <- plot + guides(fill=guide_legend(title="Continent"))
# Customize labels
plot <- plot + labs(title = "Sorted indexed life expectancy inequality in Africa and America", subtitle = "Year 2017", caption = " 1: Africa, 5:North America, 7:South America",x = "African and American countries", y = "Indexed life expectancy")
# adjust background, remove x label
plot <- plot + theme(legend.position=c(0.93,0.75), axis.text.x = element_blank())
# Hide x tick marks, labels, and grid lines
plot <- plot + scale_x_discrete(breaks=NULL)
# plot output
plot

Canada, Cuba, United States, Chile, and Costa Rica head the top of the list. Almost one third of the African and American countries are above the global median. The tail of the distribution is consistently populated by African countries, with the exception of Haiti, by far the country with the lowest index of life expectancy in America.


Conclusion

Life expectancy is highly dissimilar across continents and countries of the world. Europeans have the highest and most consistent equality in life expectancy. Any other region of the world has a wide distribution of inequality. Africa is sadly populating the last quarter of high inequality in life expectancy, with exceptions such as Haiti, Afganistan, Pakistan and Bolivia.

Significnat efforts must be done to improve the quality and access to healt care in countries below the median of the sorted distribution of life expectancy.


  1. http://hdr.undp.org/en/faq-page/inequality-adjusted-human-development-index-ihdi#t293n2906