Geo Data Science with R

Living longer, living better?

Following analysis is made with R and the Google Vis library for plotting the interactive maps.
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. Other important point is the year that data belongs, it is: 2012 (old, but the newest one).

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 tableHere 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 the countries tend to have more people that live until their final days, in a no-good condition.
On the other hand, when the metric is closer to 0, it shows that people live almost all their lifes in a good way, how it doesn't reflects if that living is long or short.

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.



For a live and dynamic graph version, please go here

R Code & data available in:

Made by Pablo C. from Data Science Heroes