Geo Analysis

[This article was first published on R - Data Science Heroes Blog, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

EU – Life Quality Geo Report

Living longer, living better?

It’s equally important to measure the longer living as well as its quality.

Analyzing data from eurostat which containts the following two variables:

1- Healthy life years: Is a health expectancy indicator which combines information on mortality and morbidity.

2- Life expectancy: Life expectancy at birth is defined as the mean number of years still to be lived by a person at birth

Original data is splitted into gender, but here the average was computed between female and male to have only one metric. The last updated data belongs to 2012.

Following plots shows these indicators in a map, Each metric is expressed in years.

Life expectancy (left) Vs. Healthy life years (right)

Life expectancy (left) Vs. Healthy life years (right).

Top 3 – Countries

Top 3 table

Here we can see that top 3 countries with the highest healthy life, are not the top 3 highest with longer life expectancy.

Gap healthy life

Now we’ve know how “expectancy” and “healthy” is distributed, we proceed to compute the gap among them, generating a new metric called “Gap healthy life”

This metric tends to be higher when people live more years in a no-good life condition until their final days, on the other side this value is close to 0 when people tends to live all their life in good condition, let’s life expectancy and life quality have similar values.

Gap between healthy expectancy

To reflect quantitavely the most dissimilar (left) and the most equitative (right), following table was created:

Top 3 Gap  table

Final thoughts

It’s interesting to note how many years people lives in a bad quality of life until their dead, like Germany which their good living ends at the age of 57, while their life expectancy is around 81 years.

Looking at Slovenia which holds the highest gap, we can see their people lives 35% of their lifes in a bad-quality (healthy: 52 vs expectancy:80.2 years)

One further analysis could be to analyze these metrics, across the time to see global trends.


R Code & data available in github

Made by Pablo C. from Data Science Heroes

E-learning course: Data Science with R request free demo in [email protected]

Note: For a live and dynamic graph version, please go here

To leave a comment for the author, please follow the link and comment on their blog: R - Data Science Heroes Blog. offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)