Publications by Anthony B. Masters

A/B Testing

09.06.2021

Purpose This R Markdown document runs through an example of Bayesian statistics in A/B testing. I used Prof Matthew Kay’s tidybayes package. This builds on an earlier set of code. Packages and Themes First, download the packages we need: library(tidyverse) library(tidybayes) Second, set the plotting theme: theme_clean4 <- theme_bw(base_family ...

1525 sym R (4865 sym/15 pcs) 2 img

NHS England Covid Hospital Beds

31.07.2021

Purpose The purpose of this R code is to show total beds occupied by confirmed Covid-19 patients, by primary diagnosis. This is given in a data file on the NHS England website. Packages and Themes First, we install the packages we need: library(tidyverse) library(readxl) library(curl) library(scales) library(janitor) library(lubridate) library(p...

696 sym R (4723 sym/12 pcs) 1 img

PHE Vaccine Coverage Revision

29.07.2021

Purpose The purpose of this R code is to show the revision to vaccine coverage (by dose) for the adult population in England. This is drawn from two sheets downloaded from the Public Health England Coronavirus dashboard. Packages and Themes First, install the packages we need: library(tidyverse) library(curl) Second, we set the plotting theme an...

670 sym R (4800 sym/10 pcs) 1 img

Age at Death by UK Nation

15.07.2021

Purpose The purpose of this R code is to draw data from the online UK Life Table showing numbers dying at exact ages. The Office for National Statistics also has a guide to how these life table measures are calculated. Once drawn, we can create a graph showing the expected numbers dying at single years of age from a synthetic cohort, by UK nation...

789 sym R (4531 sym/22 pcs) 1 img

Vaccine Effectiveness

28.06.2021

Purpose The purpose of this R code is to show vaccine effectiveness in an illustrative at-risk population. That shows the counter-intuitive result with sufficiently high coverage, most deaths from the disease will be among those vaccinated (assuming 94% protection). Packages and Themes First, install the packages we need: library(tidyverse) libr...

983 sym R (5516 sym/11 pcs) 2 img

UK General Election Opinion Polling Wiki

17.06.2021

Purpose This R Markdown looks at the effect of using different spans for local regression (Loess) curves. It shows four different spans for UK/GB vote intention opinion polling since the 2019 General Election. I also use the britpol package to show modelled estimates of vote intention. Packages and Themes First, download the packages we need. li...

1000 sym R (6201 sym/13 pcs) 2 img

NHS Vaccination Data Wrangling

03.07.2021

Purpose The purpose of this R code is to produce a graph showing Covid-19 vaccine coverage in England by age group and population estimates. The goal is to wrangle the data directly from the NHS England online spreadsheet into that graph. Packages and Themes First, we install the packages we need: library(tidyverse) library(readxl) library(curl)...

889 sym R (4998 sym/19 pcs) 1 img

Covid-19 surveillance deaths weekly cycle

22.01.2022

Purpose The purpose of this code is to visualise the reporting cycle in Covid-19 deaths in England. The figures are surveillance counts: deaths within 28 days of a positive test. Statistics come from the UKHSA Covid-19 dashboard. Packages and Themes First, we download the packages we need: library(tidyverse) library(curl) library(lubridate) libr...

793 sym R (5139 sym/15 pcs) 3 img

Confirmed cases in England by test type

30.12.2021

Purpose The purpose of this R code is to create a graph showing confirmed cases by test type in England. The data is downloaded from the UKHSA Covid-19 dashboard. Packages and Themes First, we install the packages we need. library(tidyverse) library(curl) library(lubridate) library(scales) library(patchwork) Next, we set the plotting theme. them...

953 sym R (5495 sym/14 pcs) 1 img

ONS Weekly Excess Deaths by Location

29.12.2021

Purpose The R code produces a graph showing excess deaths (with the 2015-2019 average as the baseline) by location in England and Wales. These statistics are published by the Office for National Statistics. Packages and Themes First, we install the packages we need. library(tidyverse) library(readxl) library(curl) library(scales) library(janitor...

590 sym R (3754 sym/8 pcs) 1 img