Publications by Anthony B. Masters

Illustrating False Recall

25.11.2019

R Markdown The purpose of this code to create three graphs, illustrating the issue of false recall and past vote weighting in surveys. Packages and Themes First, we install the tidyverse package. library(tidyverse) Next, we create our custom theme. theme_clean <- theme_bw(base_family="Calibri") + theme(legend.position = "top", legend....

520 sym R (3578 sym/10 pcs) 3 img

Self-Selecting Surveys

24.11.2019

R Markdown I intend to create a graph showing Facebook surveys against the results of actual pollng. The Google Sheets file may be viewed here. Packages and Themes We are going to need the pivot_longer function, so you need to download the latest version of the tidyverse. library(tidyverse) library(readxl) Next, we set the custom theme. theme_cl...

687 sym R (2474 sym/7 pcs) 1 img

GE Vote Shares 1918 to 2019

09.02.2020

R Markdown This is an R Markdown document, showing General Election votes for political parties in the UK. The vote shares are calculated based on two House of Commons Library briefing papers, CBP-7529 and CBP-8749. Install packages First, we install the packages we need: library(tidyverse) library(readxl) library(stringr) Set the theme Next, s...

1249 sym R (7506 sym/21 pcs) 4 img

GE2019 Constituency Polling Accuracy

22.02.2020

R Markdown The purpose of this R Markdown document is to show absolute errors in constituency polls for the 2019 UK General Election. The constituency survey estimates have been downloaded from the Deltapoll and Survation archives. 2019 General Election results were collated by the House of Commons Library. Install packages and set theme First, ...

915 sym R (5533 sym/10 pcs) 2 img

Dice Rolls and the Law of Large Numbers

29.02.2020

Purpose This R Markdown document shows the code for creating static and animated graphs. The aim is to show a different version of the Law of Large Numbers, applying it to dice rolls and their cumulative sum. Packages and Themes First, we install the packages we need. library(tidyverse) library(readxl) library(gganimate) library(gifski) library(...

1207 sym R (2902 sym/11 pcs) 3 img

Mortgage Overpayment

27.03.2020

R Markdown This document will use functions to create mortgage tables. From there, we will see the effect of making overpayments on total interest paid. Packages and Theme First, we install the tidyverse package. library(tidyverse) Next, we set the theme for the graph. theme_clean <- theme_bw(base_family="Calibri") + theme(legend.position = "...

711 sym R (4567 sym/8 pcs) 1 img

Log Graphs

10.04.2020

Purpose This document seeks to create two GIFs along side each other. Those GIFs will show exponential growth, on linear and logarithmic scales. Install packages First, we install the packages we need. library(tidyverse) library(gganimate) library(gifski) library(png) library(magick) Set the theme Next, we set the theme for the graphs: theme_cl...

556 sym R (2048 sym/7 pcs) 2 img

Weekly Death Registrations

12.05.2020

Purpose The purpose of this R Markdown document is to create graphs about weekly death registrations in England and Wales. The underlying dataset has been collated from ONS weekly death registration reports, for 2010 to 2019. Install Package and Set Theme First, I install the tidyverse package. library(tidyverse) library(readxl) Next, I set the ...

975 sym R (5629 sym/12 pcs) 3 img

Google Search Index

11.06.2020

Purpose This R Markdown document creates graphs of Google search trends. The trends are shown as a rounded index, where 100 is the highest volume. We can draw Google search indices from the Google Trends tool. Packages and Theme First, we install the tidyverse packages and readxl. library(tidyverse) library(readxl) Next, I set the plotting theme...

823 sym R (3113 sym/10 pcs) 2 img

Coronavirus Deaths by Source

22.07.2020

Purpose This R Markdown document creates two graphs, with annotations. The graphs compare deaths with COVID-19 from Public Health England and Public Health Wales to the Office for National Statistics. The ONS death certificate mentions were drawn from a weekly occurrence report. PHE and PHW statistics comes from the Public Health England Coronavi...

701 sym R (4837 sym/9 pcs) 2 img