Some data visualisations created from NRS population data (estimates and projections), using R and ggplot. Data was obtained from the NHS Scotland CKAN OpenData portal, using ckanr. Animations were produced using gganimate. Code can be found here, and a slightly more detailed blog post here.
A histogram of the age distribution of Scotland's current population.
- the large peak at 90 years old represents the population of age 90 and over.)
An annotated and annotated histogram of Scotland's age distribution, showing how it has evolved, and is projected to evolve over time.
- the following groups are annotated: Baby Boomers, Gen-X, Gen-Y, and Gen-α.
A heat-map, showing the same data as the animated histogram above. The data is represented with the single year population age "bins" along the x-axis as before, but with the time dimension now on the y-axis. Larger population is shown as dark blue, with smaller populations as lighter blues.
- any data above the red line is a projection (i.e. into the future) rather than an estimation
- different population age groups are noticeable as diagonal features, which generally become lighter (smaller population) as they age
- there is a notable lighter vertical band to the left of the 19 year old age group, from about 1985 onward, indicating an increase in this age group occurs each year
A version of the previous heat-map, re-framed in terms of birth year rather than age.
- the lighter band around WWI implies fewer births in this period (with a corresponding increase shortly after the war)
- a similar effect is visible after WWII, with a very notable dark band around 1946/1947 indicating a larger population with those birth years
Population curves for different birth year groups (one per decade).
- those born from 1900 - 1970 are generally decreasing sharply in this period; the 1980 group is roughly flat; and the 1990 - 2040 groups are increasing
- the 1990 - 2020 groups show the increase in population at about 19 years old that was visible in previous plots
By comparing the population to that in the preceding year, we can see how much the population changes in each birth year group; e.g. if there are 10,000 people who were born in 1940, alive in 1980, and in 1981 this has changed to 9,500 people, the change would be -5%. The animation below shows this plot for each birth year group.
- the red dotted lines represent projected data
- as you would expect, the is larger negative change towards larger age
- as noted previously, one significant feature is the increase in population in 19-year-olds from the mid-1980s onward
Inspired by the famous pulsar timing chart / Joy Division album cover.
The data is identical to the animated plot above, but with each birth year stacked vertically rather than animated. The smoothness of the projected (red) data, compared to the estimated data, is quite visible.