by Michel Wermelinger and Andres Muniz, 08 November 2015
This is the project notebook for Week 1 of The Open University's Learn to code for Data Analysis course.
In 2000, the United Nations set eight Millenium Development Goals (MDGs) to reduce poverty and diseases, improve gender equality and environmental sustainability, etc. Each goal is quantified and time-bound, to be achieved by the end of 2015. Goal 6 is to have halted and started reversing the spread of HIV, malaria and tuberculosis (TB). TB doesn't make headlines like Ebola, SARS (severe acute respiratory syndrome) and other epidemics, but is far deadlier. For more information, see the World Health Organisation (WHO) page http://www.who.int/gho/tb/en/.
Given the population and number of deaths due to TB in all countries during one year, the following questions will be answered:
The death rate allows for a better comparison of countries with widely different population sizes.
The data consists of total population and total number of deaths due to TB (excluding HIV) in 2013 in each of the BRICS and Portuguese-speaking countries.
The data was taken from http://apps.who.int/gho/data/node.main.POP107?lang=en (population) and http://apps.who.int/gho/data/node.main.593?lang=en (deaths). The uncertainty bounds of the number of deaths were ignored.
The data was collected into an Excel file which should be in the same folder as this notebook.
from pandas import *
data = read_excel('WHO POP TB all.xls')
data
The column of interest is the last one.
tbColumn = data['TB deaths']
The total number of deaths in 2013 is:
tbColumn.sum()
The largest and smallest number of deaths in a single country are:
tbColumn.max()
tbColumn.min()
From 0 to almost a quarter of a million deaths is a huge range. The average number of deaths, over all countries in the data, can give a better idea of the seriousness of the problem in each country. The average can be computed as the mean or the median. Given the wide range of deaths, the median is probably a more sensible average measure.
tbColumn.mean()
tbColumn.median()
The median is far lower than the mean. This indicates that some of the countries had a very high number of TB deaths in 2013, pushing the value of the mean up.
To see the most affected countries, the table is sorted in ascending order by the last column, which puts those countries in the last rows.
data.sort('TB deaths')
The table raises the possibility that a large number of deaths may be partly due to a large population. To compare the countries on an equal footing, the death rate per 100,000 inhabitants is computed.
populationColumn = data['Population (1000s)']
data['TB deaths (per 100,000)'] = tbColumn * 100 / populationColumn
data
If we sort the data by rate we get a clear idea of the most affected:
data.sort('TB deaths (per 100,000)')
The all the countries had a total of about one million deaths due to TB in 2013. The median shows that half of these coutries had fewer than 315 deaths. The much higher mean (over 5,000) indicates that some countries had a very high number. The least affected were San Marino, Monaco and Norway, with 0,0.08 and 0.09 deaths rate per 100,000 respectively, and the most affected were Djibouti and Nigeria with 99.6 and 92 deaths per population of 100,000. In number of deaths the most affected where Nigeria and India with 160,000 and 240,000 deaths in the year 2013.
One should not forget that most values are estimates, and that the chosen countries are a small sample of all the world's countries. Nevertheless, they convey the message that TB is still a major cause of fatalities, and that there is a huge disparity between countries, with several ones being highly affected.