Graphing mortality II

On bar graphs, showing a value using a line can be effective.

Anthony B. Masters
3 min readApr 15, 2021

Last week, I looked at how to emulate the mortality graph with a ranged ribbon. This week, I seek to emulate a graph in the Office for National Statistics weekly death reports.

There is a lot to deconstruct here. (Image: ONS)

The graph has the following key elements:

  • A stacked bar graph, showing deaths which involve and do not involve COVID-19. A death ‘involves’ a disease if clinicians believe it caused or contributed to the death.
  • A straight line representing the weekly average of deaths in 2015 to 2019.
  • A legend showing what all three counts correspond to on the graph.
  • Informative text and arrows, highlighting public holidays influence death registrations in particular weeks.

Setting up

First, we start by install packages that we need:

library(tidyverse)
library(readxl)
library(scales)
library(lubridate)

I had some trouble installing the ‘ungeviz’ package in R Studio Cloud. I was able to find Prof Wilke’s code for the geom_hpline function. We can use that instead. We draw the values from a prepared file (which I added a date to):

ons_deathregistration_figure3_df <- read_excel("ONS Weekly

--

--

Anthony B. Masters
Anthony B. Masters

Written by Anthony B. Masters

This blog looks at the use of statistics in Britain and beyond. It is written by RSS Statistical Ambassador and Chartered Statistician @anthonybmasters.

No responses yet