Life Expectancy and GDP
Updated: Dec 15, 2020
Python Data Visualization with the Library Matplotlib Seaborn Practice Project From:
Codecademy Data Science course Python, Data Visualization with Seaborn Matplotlib and Jupyter Notebook.
Visualize data from the World Health Organization.
Life Expectancy and GDP Data. Visualize data from the World Health Organization is part of the Visualize Data with Python Matplotlib Seaborn Codecademy Data Science pro. Career Paths Data Visualization section.
This project investigate if there is a strong correlation between the economic output of a country and the life expectancy of its citizens.
Focusing Questions: between 2000 and 2015
Has life expectancy increased over time in the six nations?
Has GDP increased over time in the six nations?
Is there a correlation between GDP and life expectancy of a country?
What is the average life expectancy in these nations?
What is the distribution of that life expectancy?
GDP Source: World Bank national accounts data, and OECD National Accounts data files.
LEABY, Life expectancy Data Source: World Health Organization
The fallowing six countries are represented in the data:
The project uses different charts to visualize the data, to easily recognize each country I assign each country a color.
Average GDP (between 2000 and 2015)
Comparing country average GDPs.
A significant difference average GDP size exists between the countries, with the US having an average GDP considerably larger relative to all the other countries and Zimbabwe having an insignificant average GDP relative to all other countries.
Countries average GDP in billions USD (between 2000 and 2015):
Zimbabwe has only an average GDP (between 2000 and 2015) of 0.9 billion USD.
Zimbabwe GDP between 200 and 2015:
From the year 2000 to the year 2008, Zimbabwe add a declining GDP, but between 2008 and 2015 period Zimbabwe GDP grew %269.
Average Life Expectancy (between 2000 and 2015)
Comparing country average LEABYs.
Focus question: "What is the average life expectancy in these nations?"
Average Life Expectancy At Birth in Years (between 2000 and 2015):
Zimbabwe with an average LEABY at 50 years is roughly one third of all other countries and its average GPA when compared to all other countries is insignificant.
A visualization of Zimbabwe and the other countries LEABY distributions over the years, will give us a better picture of the countries average LEABY overtime.
Live Expectancy Distributions between (2000 and 2015)
Comparing countries LEABY distribution.
Focus Question: “What is the distribution of that life expectancy?”
Based on the chart above. Chile and Germany's distribution LEABY (2000-2015) figures are very similar, with Germany having a denser concentration of LEABY at 80 years, and their averages (2000-2015) LEABY being roughly the same. Chile LEABY distribution spreads between 76 and 81.5 years compared to Germany with a LEABY distribution spread between 76.9 and 82 years. The US distribution LEABY (2000-2015) figure is remarkably similar in shape to the Germany distribution LEABY (2000-2015) figure, but with the US having its highest concentration of LEABY at 78.5 years instead of 80 years and with the US having almost no LEABY higher than 80 years. The US average (2000-2015) LEBAY is roughly 1.5 years lower than the Germany average (2000-2015) LEBAY.
The US LEABY distribution spreads between 76 and 81.5 years compared to Germany with a LEABY distribution spread between 76.9 and 80.3 years. Mexico and China have roughly an average (2000-2015) LEBAY of 74 years and 75.5 years respectively. China has a more broadly distributed LEABY between 70 and 77.5 years, compared to Mexico with a distribution spread between 74 and 77.5 years. Mexico highest concentration of LEABY is at 75.5 years. Zimbabwe has the most spread out distribution LEABY (2000-2015) shape, from 37.5 to 67.5 years. It has also the lowest average (2000-2015) LEBAY at 50 years.
Let's compare the country GDPs and the country LEABYs evolution overtime, to visualize if a correlational exist between the county GDPs and the country LEABYs.
For example, Chile's average GDP is only 17 billions USD and its average LEABY at 79 years is a higher than the US with an average GDP at 1407.5 billions USD and an average LEABY at 78 years.
We want to compare the GDPs of the countries over time, in order to get a sense of the relationship between GDP and life expectancy.
Countries GDP growth rate, in the 15 year period 2000-2015
Focus question: "Has GDP increased over time in the six nations?"
All the countries listed on the chart had a GDP growth between 2000 and 2015. In the 15 year period 2000-2015, China had a gigantic exponential GDP growth, with a growth rate of 8.13. In other words, China grew 813% between 2000 and 2015 compared to the US with 75% growth between 2000 and 2015. Chile had significant 211% growth between 2000 and 2015. Most countries had their GDP drop in 2009 with the exception of China and Zimbabwe (see Zimbabwe GDP (in Billions USD)). After 2009 Germany had erratic GDP levels, dropping and rising almost from one year to another, with a significant drop in 2015.
Comparing countries LEABY overtime
Focus question: "Has life expectancy increased over time in the six nations?"
The LEABY increased over time in all six countries, but Zimbabwe has had the most significant growth of LEABY, with a growth of 32% LEABY between 2000 and 2015.
It is important to note that Zimbabwe also experienced a decrease of LEABY between 2000 and 2004.
Countries LEABY growth rate, in the 15 year period 2000-2015
Closer look at Zimbabwe LEABY overtime
Which countries' bars changes the most?
What years are there the biggest changes in the data?
Which country has had the least change in GDP over time?
How do countries compare to one another?
Now that we can see the both bar charts, what do we think about the relationship between GDP and life expectancy?
Can we think of any reasons that the data looks like this for particular countries?
Note: I've mapped two bar plots showcasing a variable over time by country, however, bar charts are not traditionally used for this purpose. In fact, a great way to visualize a variable over time is by using a line plot. While the bar charts tell us some information, the data would be better illustrated on a line plot. See the grid line charts.
• Question: "Which countries' bars changes the most?"
- In GDP
China had the largest growth in GDP, 813%.
Zimbabwe had a drop in GDP from 2000 to 2008, and then its GDP grew 269%.
After 2009, Germany had erratic GDP levels.
- In LEABY:
Zimbabwe had a growth of 32% LEABY from 2000 to 2015,
but Zimbabwe also experienced a decrease of LEABY between 2000 and 2004,
and it has the lowest average (2000-2015) LEABY at 50 years.
• Question: "What years are there the biggest changes in the data?"
The biggest changes of data occurred in the GDPs of China, Chile and the US, and in the Zimbabwe LEABY.
• Question: "Which country has had the least change in GDP over time?"
Mexico experienced the least change of all the countries both in its GDP and LEABY, 68% and 4% respectively.
• Question: "How do countries compare to one another?"
- In GDP:
Overtime, the US had a significantly higher GDP than all other countries.
China had a gigantic GDP growth compared to all other countries.
Chile had very low GDP compared to the US,
but it had a significant GDP growth of 211%.
Zimbabwe had an extremely low GDP compared to all other countries.
- In LEABY:
Overtime, Zimbabwe had the most significant increase of LEABY, but it had a very low average LEABY growth compared to all other countries.
Germany had the highest average LEABY at 80 years.
Mexico, compared to all other countries, had an average in the low range for its GDP and in the low-medium range for its LEABY,
with an average GDP of 97.6 millions USD and an average LEABY of 75.7 years.
• Focus question: "Now that we can see the both bar charts, what do we think about the relationship between GDP and life expectancy?"
For most of the countries where the data was provided, there does not seem to be a correlation between the countries GDPs and their LEABYs. Zimbabwe is the exception.
A correlation may exist between low LEABY and countries with extremely low GDPs, but the provided datasets are not substantial enough, with Zimbabwe been the only country with an extremely low GDP, to show, as a general rule, the existence of a real correlation between the countries GDPs and their LEABYs.
The data from Zimbabwe shows that the decrease or the increase of its LEABY is somehow connected with the growth and the decline of its GDP during the period of 2000-2015. The data seems to show that a major event affected Zimbabwe GDP and LEABY during the 2000-2008 period.
• Question: "Can we think of any reasons that the data looks like this for particular countries?"
Most countries GDPs dropped in 2008-09, during that period, the world was experiencing a worldwide financial and automobile crisis.
Zimbabwe had its GDP and LEABY drop between 2000 and 2004, during that period, Zimbabwe was experiencing violent civil unrest.
Scatter Plots of GDP and Life Expectancy Data
To create a visualization that will make it easier to see the possible correlation between GDP and life expectancy, by looking at the distribution of the combine countries GDPs and LEABYs per year, I plotted each set of data on its own scatter subplot, on a shared figure grid chart.
Which country moves the most along the X axis over the years?
Which country moves the most along the Y axis over the years?
Is this surprising?
Do we think these scatter plots are easy to read? Maybe there's a way to plot that!
- China had the largest motion on the X axis, with a GDP growth of 813%.
- Zimbabwe had the largest motion on the Y axis, with LEABY growth of 32%.
- It is not surprising. During the 2000-2015 period, China had the largest GDP growth and Zimbabwe had the largest LEABY growth.
- Scatter plots are a good tool to visualize the distribution of the combine countries GDPs and LEABYs per year, but it makes it difficult to see the individual evolution of the country GDPs and LEABYs over the years.
Line plots would be a more suitable choice for that purpose.
Line Plots for Life Expectancy
Comparing each country LEABY overtime using a grid chart.
Which countries' line changes the most?
What years are there the biggest changes in the data?
Which country has had the least change in life expectancy over time?
Can we think of any reasons that the data looks like this for particular countries?
- Zimbabwe had the most change in LEABY, with a LEABY growth of 32%.
- All the countries LEABYs increased between 2000 and 2015, but Zimbabwe experienced a decrease of LEABY between 2000 and 2004, and a radical increase between 2005 and 2015.
- Mexico had the least change in LEABY, with a LEABY gowth of 2.5%.
- All the countries benefited from advancements in medical technology resulting in a LEABY growth in all the countries.
Zimbabwe experienced a violent civil unrest between 1999 and 2006, affecting greatly their LEABY during that period.
Mexico did not experience political unrest and had no major changes in its health care system, resulting in the smallest LEABY growth.
China's gigantic GDP increase probably had an influence on its citizens access to and quality of health care.
China experienced a slight LEABY increase, with a 6% LEABY growth.
Line Plots for GDPs
Comparing each country GDP overtime using a grid chart.
The GDP grid chart clearly shows that over the years the US had the highest GDP, with its highest GDP over 1,800 Billions USD in 2015. Zimbabwe had constantly the lowest GDP, with its lowest GDP under 0.5 Billions USD in 2008.
Which countries have the highest and lowest GDP?
Which countries have the highest and lowest life expectancy?
Researching Data Context
- Most countries had their GDP drop in 2008-09 with exception of China and Zimbabwe.
The 2009 drop in GDP was mostly caused by the financial crisis of 2007–2008, also known as the global financial crisis (GFC), was a severe worldwide financial crisis. Excessive risk-taking by banks combined with a downturn in the subprime lending market in the United States culminated with the bankruptcy of Lehman Brothers on September 15, 2008 and an international banking crisis.
The crisis sparked the Great Recession, a global recession, it was the most severe recession since the Great Depression It was also followed by the European debt crisis, which began with a deficit in Greece in late 2009, and the 2008–2011 Icelandic financial crisis.
The automotive industry crisis of 2008–2010 was also part of the financial crisis of 2007–2008 and the resulting Great Recession. The crisis affected European and Asian automobile manufacturers, but it was primarily felt in the American automobile manufacturing industry. Due to China and Zimbabwe not having a real banking loaning system, and having a small or no automotive industry in 2008-2009, the global financial crisis had little effects on their GDPs.
After 2008 the automotive industry in China became the largest in the world measured by automobile unit production, today, the annual production of automobiles in China exceeds that of the European Union or that of the United States and Japan combined.
Source: Financial crisis of 2007–2008
- The data shows, between 2000 and 2008, Zimbabwe was experiencing a decrease in its GDP and LEABY, with the sharpest decrease in GDP in 2008.
During that period of time, Zimbabwe experienced civil unrest, starting in 2000 by the seizure of hundreds of white-owned farms in a violent campaign supported by the government.
In 2001, the Finance Minister Simba Makoni acknowledges economic crisis, saying foreign reserves have run out and warning of serious food shortages. Most western donors, including the World Bank and the IMF, cut aid because of President Mugabe's land seizure program.
In 2002, Zimbabwe parliament passed a law limiting media freedom. The European Union imposes sanctions on Zimbabwe and the Commonwealth suspends Zimbabwe for a year. Shortly after the imposed sanctions were implemented, a state of disaster was declared as worsening food shortages threaten famine.
In 2005, tens of thousands of shanty dwellings and illegal street stalls are destroyed as part of a "clean-up" program. The UN estimates that the drive has left about 700,000 people homeless.
In 2006, Year-on-year inflation exceeds 1,000%.
In 2008, EU and US widen sanctions against Zimbabwe's leaders, Galloping price increases rendered Zimbabwe's currency nearly worthless by 2008, explaining the sharp drop of the 2008 GDP seen in the data. The data shows, between 2009 and 2015, Zimbabwe was experiencing an increase in its GDP and LEABY.
In 2009, the Zimbabwe Government allowed the use of foreign currencies to try stem hyperinflation. Morgan Tsvangirai is sworn in as prime minister, after protracted talks over formation of a new government. The IMF provided USD400M support as part of G20 agreement.
In 2010, Zimbabwe resumes official diamond sales.
In 2013, a new constitution approved by an overwhelming majority in a referendum.
Source: Zimbabwe profile - Timeline
My python code for the project: Project Code Presentation