-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathreport.Rmd
226 lines (139 loc) · 8.46 KB
/
report.Rmd
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
---
title: "COVID-19 updates"
author: "Marek Gierlinski"
date: '`r format(as.POSIXlt(Sys.time(), tz = "UTC"), "Updated %d %B %Y, %H:%M:%S UTC")`'
output:
html_document:
css: css/nice_notebook.css
toc: true
toc_float: true
---
```{r setup, include=FALSE}
library(drake)
knitr::opts_chunk$set(
echo = FALSE,
message=FALSE,
warning=FALSE,
cache=FALSE
)
N <- function(n) prettyNum(n, big.mark = ",")
```
# Data
This document presents COVID-19 data released daily by [ECDC](https://www.ecdc.europa.eu/en). Specifically, the source for this report is
[`r readd(url_covid)`](`r readd(url_covid)`).
# How data were processed
ECDC data were processed with an R code, which is available in [GitHub](https://github.com/MarekGierlinski/COVID-19).
## Time alignment
The onset of the epidemic in each country is different. Many publications align data in time based on a day where number of cases/deaths crossed a certain, arbitrary level, for example 1 per million. This relies on one data point and, since data are noisy, can introduce large random shifts. Here this issue is curtailed by using a range of data for time alignment. This is still an arbitrary selection, but results in a reduced random error.
For this procedure a range in the response variable (case or deaths, raw counts or normalised to population) is selected based upon visual inspection of data (I know!) to identify a region where cumulative curves are similar. Then, a time shift is introduced to each country in order to bring them together. Specifically, Italy is used as a base line, and other data are shifted to minimise the root-mean-square between a given country and a best-fitting Italy loess model. Day 0 is where Italy's model crosses the bottom value of the range. The range of the response variable used is shown in cumulative plots.
## Normalisation
Most of the plots show data normalised to population (counts per million).
# Cumulative data
A small selection of countries, specifically chosen to compare with the UK. The dashed blue lines show the rage of the response variable chosen to align countries in time.
```{r cumulative, fig.width=10, fig.height=4}
readd(fig_shifted_cases_pop)
readd(fig_shifted_deaths_pop)
```
# Daily data
Daily cases (top) and deaths (bottom) from a larger selection of countries. Black step line shows weekly mean.
```{r daily, fig.width=10, fig.height=5}
readd(fig_weekly_cases)
readd(fig_weekly_deaths)
```
## Hysteresis
```{r hysteresis, fig.width=8, fig.height=6}
readd(fig_hysteresis)
```
## Smoothed data
These plots show smooth daily data from loess fits plotted together.
```{r daily_fits, fig.width=10, fig.height=8}
readd(fig_daily_fits_cases)
readd(fig_daily_fits_deaths)
```
## UK nations
Data from [UK government website](https://coronavirus.data.gov.uk). Daily cases and hospital admissions with weekly average. Data available until `r format(readd(last_date_stag), format="%d %B %Y")`.
```{r weekly_uk, fig.width=10, fig.height=5, message=FALSE, warning=FALSE}
readd(fig_weekly_cases_uk)
readd(fig_weekly_admissions_uk)
readd(fig_weekly_deaths_uk)
readd(fig_stag_uk)
```
## Heatmaps
Another representation of the same data. Cases and deaths (per million) for countries with at least 1000 cases per million and at least 50 deaths per million, respectively. Plots show weekly means, ordered by the centre of gravity of each time course.
```{r heatmaps_cases, fig.width=6, fig.height=9}
readd(fig_heatmap_cases)
```
```{r heatmaps_deaths, fig.width=6, fig.height=7}
readd(fig_heatmap_deaths)
```
# Recent cases and deaths
Reported daily cases and deaths (per million), averaged over last seven days. Only countries with at least 1 million population are included. The plot shows the top 10 countries.
```{r recent_daily_deaths, fig.width=6, fig.height=3}
readd(fig_recent_daily_cases)
readd(fig_recent_daily_deaths)
```
# Global overview
## Global timeline
The step line shows weekly average.
```{r global_timeline, fig.width=8, fig.height=4}
readd(fig_global)
```
## EU, UK and USA comparison
```{r eu_uk_us, fig.width=6, fig.height=4}
readd(fig_eu_uk_us)
```
## Deaths and cases
Reported deaths (red) and cases (blue) for all countries, order by deaths. The left panel shows raw counts, the right panel data normalised to population
```{r deaths_and_cases, fig.width=10, fig.height=15}
readd(fig_cases_deaths_both)
```
## Deaths vs cases
Reported deaths versus cases for all countries. Countries with at least 1000 total deaths are annotated.
```{r deaths_vs_cases, fig.width=7, fig.height=5}
readd(fig_deaths_vs_cases)
```
## Deaths vs GDP
```{r deaths_gdp, fig.width=7, fig.height=5, warning=FALSE, message=FALSE}
readd(fig_deaths_gdp)
```
# UK vs South Korea
South Korea has a remarkable small number of deaths. It is a country with size and GDP comparable to the UK. The plot shows the comparison between deaths in the two countries (top panel, normalised to population). The bottom panel shows the excess deaths in the UK with respect to South Korea (corrected for population).
```{r uk_korea, fig.width=6, fig.height=6}
readd(fig_uk_korea_excess)
```
# Mortality excess
Financial Times provides with an excellent resource of excess mortality data, meticulously combined from various [national sources](https://github.com/Financial-Times/coronavirus-excess-mortality-data/blob/master/sources.md). Excess mortality allows for direct comparison between regions and countries regardless of COVID-19 counting methodology. By comparing this year's data with 2015-2019 death counts we can not only calculate excess deaths, but also test if the excess is statistically significant.
I use the following data set
[`r readd(url_excess)`](`r readd(url_excess)`)
from FT's [GitHub](https://github.com/Financial-Times/coronavirus-excess-mortality-data/) repository. See also FT's [coronavirus tracker page](https://www.ft.com/content/a26fbf7e-48f8-11ea-aeb3-955839e06441).
At the moment this document was created, FT provided 2020 UK data up to week `r readd(last_week_uk)`, ending on `r format(readd(last_date_uk), format="%d %B %Y")`.
## World data
This plot shows data from countries included in FT's data. The grey points are years 2015-2019 (where available), the green squares shows 2020 data.
```{r exc_countries, fig.width=8, fig.height=8}
readd(fig_exc_countries)
```
## UK data
This plot shows 2015-2019 (grey points) and 2020 (green squares) deaths for UK regions.
```{r exc_uk, fig.width=8, fig.height=8}
readd(fig_exc_uk)
```
The next plot shows 2020 deaths divided by deaths from each of the years 2015-2019, in corresponding weeks. One dot corresponds to one year. When there is no mortality excess, ratios are near 1. Ratios greater than 1 indicate mortality excess in 2020. Red points indicate statistically significant excess (one-sample t-test, Benjamini-Hochberg corrected within each region, significance limit of 0.05).
```{r exc_prop_uk, fig.width=8, fig.height=8}
readd(fig_exc_prop_uk)
```
## Total excess deaths
One does not simply quote total excess deaths without stating their uncertainty. As everything in nature, these quantities are variable. This plots show weekly deaths and total deaths for weeks from 1 to `r readd(last_week_uk)` (last available FT data):
```{r uk_weekly_deaths, fig.width=5, fig.height=3}
loadd(exc_deaths_2015, exc_deaths_2010)
readd(fig_excess_weekly_deaths_uk)
readd(fig_excess_deaths_uk)
```
There is not only a lot of year-to-year variability, but also a strange step-wise change in 2015 (I don't know what it is). Hence, the excess deaths should be calculated by subtracting previous years' deaths (e.g. 2015-2019) from 2020 count and finding the mean and confidence interval of the difference. Using years 2015-2019 as baseline, we find the following number of excess deaths in the UK in 2020 (weeks 1-`r readd(last_week_uk)`):
<font size="4">`r N(exc_deaths_2015$diff)`±`r N(exc_deaths_2015$ci)`</font>
Errors are 95% confidence intervals. However, if we take all years 2010-2019 as baseline, we find `r N(exc_deaths_2010$diff)`±`r N(exc_deaths_2010$ci)` excess deaths.
WARNING: do not trust excess deaths numbers in media and social media until they quote them with confidence intervals and clearly state what baseline they used.
## Excess deaths for UK nations
Using the method described above we found the excess deaths (normalised to population) for four UK nations. Points in this figure shows the difference between 2020 deaths (weeks 1-`r readd(last_week_uk)`) and the 2015-2019 deaths.
```{r uk_nations_excess, fig.width=6, fig.height=4}
readd(fig_exc_uk_nations)
```