Publications by Anthony B. Masters
European Social Survey 09-GB
Purpose The purpose of this R Markdown document is to use the ESS ninth wave survey data to show the importance of weights. I downloaded the SAS data file from the European Social Survey website. Packages and Themes First, I install the packages I need. library(haven) library(sjlabelled) library(janitor) library(tidyverse) library(survey) Next, ...
892 sym R (4843 sym/13 pcs) 1 img
Coronavirus cases in Wiltshire
Purpose The purpose of this R Markdown document is to show Coronavirus cases in Wiltshire, by specimen date. This data is downloaded from the Public Health England dashboard, as a CSV file. Packages and Themes First, I install the packages I need. library(tidyverse) library(readxl) library(janitor) Next, I set the theme for the graphs. theme_cle...
593 sym R (2429 sym/7 pcs) 1 img
Coronavirus Deaths by Data Source - 2020-08-05
Purpose This R Markdown document creates three graphs, with annotations. The graphs compares deaths from statistics offices and public health agencies. Packages and Themes First, we install our needed packages. library(tidyverse) library(readxl) library(lubridate) Next, I set the plotting theme. theme_clean <- theme_bw(base_family="Calibri") + ...
789 sym R (8397 sym/16 pcs) 3 img
House Effects
Purpose This R Markdown document creates two outputs. One is an estimate of polling company house effects using generalised additive models. The second is a graph showing Conservative and Labour vote intention shars by polling company. UK vote intention polls for general elections were initially drawn from Wikipedia. That can be incomplete, so I ...
1274 sym R (8468 sym/22 pcs) 1 img
Systematic Sampling
Purpose This R Markdown document calculates the standard errors of two different sampling methods. Standard errors are the variance of the sampling distribution. The resulting graph then compares the standard errors for 10,000 simulated populations. The systematic sample standard error calculation is based on Glen Meeden’s code. Packages and T...
1137 sym R (4617 sym/13 pcs) 2 img
House Effects - 2020-09-12
Purpose This R Markdown document creates a table. That table is an estimate of polling company house effects using generalised additive models. The main output is a reproducible table for house effects. Like the previous version, I include a graph. Captions and colour coding are improved from the previous version. UK vote intention polls for gene...
2845 sym R (8203 sym/17 pcs) 1 img
Bayesian A/B Test
Purpose This R Markdown document runs through an example of Bayesian statistics with A/B testing. In order to help this analysis, I use Prof Matthew Kay’s tidybayes package. Packages and Themes First, we install our needed packages. library(tidyverse) library(tidybayes) I set the theme for the graph: theme_clean <- theme_bw(base_family="Calibr...
1621 sym R (3058 sym/16 pcs) 1 img
Prevalence and Positive Rates
Purpose This R Markdown document illustrates what happens to true and false positive results with changing prevalence. The graph will show the false positive paradox, and how true positives increase with rising prevalence. Packages and Themes First, we install the tidyverse group of packages. library(tidyverse) Next, I set the plotting theme. th...
706 sym R (2898 sym/8 pcs) 1 img
PHE Case Rates by Age Group
Purpose This R Markdown document creates a heatmap of lab-confirmed SARS-CoV-2 cases per 100,000 estimated people in each age group. This is based on the Public Health England National COVID-19 Surveillance report for week 39. Packages and Themes First, we install the tidyverse group of packages. library(tidyverse) library(readxl) Next, I set th...
758 sym R (2908 sym/9 pcs) 1 img
ONS COVID-19 Model Estimates - 2020-12-12
Purpose The purpose of this R Markdown document is to create two animated graphs. That graph will focus how the model estimates of COVID-19 positivity and incidence in England have revised. The Office for National Statistics COVID-19 Infection Survey is published weekly. The ONS published the latest survey estimates on 11th December 2020. The ONS...
1037 sym R (3288 sym/10 pcs) 2 img