Using Python in Demography: Part 1

Happy New Year to everyone! Given the start of the New Year (and the beginning of my preparation for my Finals), I thought it would be apt to start a mini-series on… Demography! With all the confusion that’s been going on in the world in the last year, maybe it would be good to try to understand people better. Which, Demography (defined as “the study of human populations in relation to the changes brought about by the interplay of births, deaths, and migration” (Pressat, 1985)) prompt fulfills. This will likely be a 4 part series, looking at 2 demographic measures per part. Each part will look at the theoretical concepts behind the measure and then explore using Python to easily calculate it. So… Let’s dive right in!

Key Measure 1 — Population Growth Rates

Theory

Three key theoretical points about population growth rates before we dive into calculations.

  1. But then, the demographic transition took place, with death rates falling rapidly due to improvements in healthcare and sanitation. This allowed R (the growth rate) to increase.
  2. This transition takes different pathways in different countries and contexts but always has significant implications on the population structure and growth. The following graph shows an example of the demographic transition (Stage 2). You can find more of such graphs and resources here! Lots of good stuff available on Demography at that link.
With permission from ourworldindata.org

Growth Equation

In order to calculate the change in a population, we use the following equation:

Graph (by author)

Key Measure 2 — Crude Death Rates and Standardized Crude Death Rates

Theory

The theory behind this measure was much simpler. Essentially, we need to calculate death rates since these are essential rates in looking at population growth. There are 2 types of death rates — crude and standardized. Crude rates are so called because:

  1. Age is an example of a confounding factor and these need to be taken into account before one can compare populations.

Calculations

Calculating the age specific death rates really isn’t that difficult. The first method was to basically replicate what one would do in excel and create all the individual columns for the rates before summing it up. This could potentially be useful if one wanted to graph out some of the data. I show this on a sample dataset comparing Japan and England/Wales.

Japan Standardized Death Rate: 0.00741 
England/Wales Standardized Death Rate: 0.01090
Graph (by author)
Japan Standardized Death Rate: 0.00741 
England/Wales Standardized Death Rate: 0.01090

Hi! I’m learning to explore data and think about personal finance (not always in that order)

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store