Simple views of the data

The data are the daily deaths from Covid-19 in the UK, announced by DHSC each day, and usually available at https://coronavirus.data.gov.uk/archive. The archive was effectively down for two days as of 29th May apparently owing to a coding error, but now seems restored to health. The daily deaths are reported by DHSC each day, and so can be manually added when the archive is unavailable.

This document was prepared using R-markdown and RStudio.

This section has simple tables and figures, the following section uses them to look at how the future may develop, and then the final section employs more formal modelling methods to make predictions about the the remaining deaths in the “first wave”.

Table 1 shows the death tallies arranged by day of the week, and Figure 1 plots them by day of the week. Each curve has a much simpler pattern than if we ignored day of the week. The weekly pattern is presumably due to working shifts and administrative arrangements for people involved in different stages of reporting a death.

## [[1]]
##            6Mar- 13Mar- 20Mar- 27Mar- 3Apr- 10Apr- 17Apr- 24Apr- 1May- 8May-
## 6Friday       1     1     36    284    714  1152    935   1005    739   626 
## 7Saturday     1    18     56    294    760   839   1115    843    621   345 
## 1Sunday       0    15     35    214    644   686    498    420    315   269 
## 2Monday       1    22     74    374    568   744    559    338    288   210 
## 3Tuesday      4    16    149    382   1038  1044   1172    909    693   627 
## 4Wednesday    0    34    186    670   1034   842    837    795    649   494 
## 5Thursday     2    43    183    652   1103  1029    727    674    539   428 
## 
## [[2]]
##            8May- 15May- 22May- 29May- 5Jun- 12Jun-
## 6Friday     626   384    351    373    357   202  
## 7Saturday   345   468    282    226    204   181  
## 1Sunday     269   170    441    115     77    36  
## 2Monday     210   160    121    111     55    38  
## 3Tuesday    627   545    136    324    286   233  
## 4Wednesday  494   363    434    359    245        
## 5Thursday   428   338    413    176    151

Table 1. The numbers of deaths arranged by day of the week

Figure 1. The numbers of deaths plotted by day of the week

Next, in Table 2 and Figure 2, we express each figure as a ratio, by dividing it by the figure of exactly one week previously. These ratios are not affected by day of the week effects, and they also incorporate a whole week of change, so are likely to be more reliable indicators. The obvious pattern is that the ratios are high to begin with, and do get gradually lower. The grey line at a ratio of one separates ratios indicating numbers are increasing, from those that indicate a decrease

## [[1]]
##            13Mar- 20Mar- 27Mar- 3Apr- 10Apr- 17Apr- 24Apr- 1May- 8May- 15May-
## 6Friday     1.00  36.00   7.89   2.51  1.61   0.81   1.07   0.74  0.85  0.61 
## 7Saturday  18.00   3.11   5.25   2.59  1.10   1.33   0.76   0.74  0.56  1.36 
## 1Sunday      Inf   2.33   6.11   3.01  1.07   0.73   0.84   0.75  0.85  0.63 
## 2Monday    22.00   3.36   5.05   1.52  1.31   0.75   0.60   0.85  0.73  0.76 
## 3Tuesday    4.00   9.31   2.56   2.72  1.01   1.12   0.78   0.76  0.90  0.87 
## 4Wednesday   Inf   5.47   3.60   1.54  0.81   0.99   0.95   0.82  0.76  0.73 
## 5Thursday  21.50   4.26   3.56   1.69  0.93   0.71   0.93   0.80  0.79  0.79 
## 
## [[2]]
##            15May- 22May- 29May- 5Jun- 12Jun-
## 6Friday     0.61   0.91   1.06   0.96  0.57 
## 7Saturday   1.36   0.60   0.80   0.90  0.89 
## 1Sunday     0.63   2.59   0.26   0.67  0.47 
## 2Monday     0.76   0.76   0.92   0.50  0.69 
## 3Tuesday    0.87   0.25   2.38   0.88  0.81 
## 4Wednesday  0.73   1.20   0.83   0.68       
## 5Thursday   0.79   1.22   0.43   0.86

Table 2. The ratio of number of deaths to the preceding same day of the week

## [[1]]
##            20Mar- 27Mar- 3Apr-  10Apr- 17Apr- 24Apr- 1May-  8May-  15May- 22May-
## 6Friday     36.00 284.00  19.83   4.06   1.31   0.87   0.79   0.62   0.52   0.56
## 7Saturday   56.00  16.33  13.57   2.85   1.47   1.00   0.56   0.41   0.75   0.82
## 1Sunday       Inf  14.27  18.40   3.21   0.77   0.61   0.63   0.64   0.54   1.64
## 2Monday     74.00  17.00   7.68   1.99   0.98   0.45   0.52   0.62   0.56   0.58
## 3Tuesday    37.25  23.88   6.97   2.73   1.13   0.87   0.59   0.69   0.79   0.22
## 4Wednesday    Inf  19.71   5.56   1.26   0.81   0.94   0.78   0.62   0.56   0.88
## 5Thursday   91.50  15.16   6.03   1.58   0.66   0.66   0.74   0.64   0.63   0.96
## 
## [[2]]
##            22May- 29May- 5Jun-  12Jun-
## 6Friday      0.56   0.97   1.02   0.54
## 7Saturday    0.82   0.48   0.72   0.80
## 1Sunday      1.64   0.68   0.17   0.31
## 2Monday      0.58   0.69   0.45   0.34
## 3Tuesday     0.22   0.59   2.10   0.72
## 4Wednesday   0.88   0.99   0.56       
## 5Thursday    0.96   0.52   0.37

Table 2a. The ratio of number of deaths to the preceding same day a whole fortnight ago. This helps to understand bank holiday periods better, as one can look back across the distorted period. A formal method could be devised, but gaining enough data would take some more bank holidays for that – we may well get there.

Figure 2. The ratios plotted against time

How quickly will the death rates fall?

The ratios seem to be currently between 0.7 and 0.9, and we can ask how quickly will the numbers decrease? A transformation of the ratios allows us to see in Table 3 and Figure 3 the number of doublings or halvings per week. In the early days, there were large positive figures, indicating more than two doublings per week, so four times as many people were dying at the end of the week than at the beginning. This was a very steep ascent at the beginning of the epidemic.

Later, the doubling times came down, and did so gradually, and eventually became negative on the 15th April (apart from a small number of rare reversions). Once negative, we can take the signs off, and think of them as the number of halvings in a week. For the figures to drop as fast as they rose, we would need to see the number of halvings per week to rise to more than 2, to match the number of doublings per week of 2. However, the number of halvings hovers around 0.3 to 0.4, suggesting it would take 2.5 to 3 weeks to halve the number of deaths. This clearly indicates a very slow tailing off, certainly compared to the very rapid initial increase.

The slowness of decline must be the result of ineffectiveness in our lockdown. Infectious people are still meeting susceptible people, and passing the infection on. These figures don’t tell us whether these are key workers who use public transport, health workers and hospital patients, care home workers and residents, or people not obeying the lockdown restrictions. Or, indeed, it is possible that non-key workers who are obeying the lockdown restrictions are still not sufficiently protected. I am sure someone connected to SAGE is studying these important questions, with more informative data.

These figures can also be used to note that a delay of one week in imposing the lockdown, at a time when there were two doublings per week, would result in an extension of over four weeks now, to get down to any given level. The more formal modelling predictions in the next section give a numerical estimate of this ratio of upspeed to downspeed. The sharp rise and slow fall makes those early decisions look very important.

## [[1]]
##            13Mar- 20Mar- 27Mar- 3Apr-  10Apr- 17Apr- 24Apr- 1May-  8May-  15May-
## 6Friday     0.000  5.170  2.980  1.330  0.690 -0.301  0.104 -0.444 -0.239 -0.705
## 7Saturday   4.170  1.637  2.392  1.370  0.143  0.410 -0.403 -0.441 -0.848  0.440
## 1Sunday       Inf  1.222  2.612  1.589  0.091 -0.462 -0.246 -0.415 -0.228 -0.662
## 2Monday     4.459  1.750  2.337  0.603  0.389 -0.412 -0.726 -0.231 -0.456 -0.392
## 3Tuesday    2.000  3.219  1.358  1.442  0.008  0.167 -0.367 -0.391 -0.144 -0.202
## 4Wednesday    Inf  2.452  1.849  0.626 -0.296 -0.009 -0.074 -0.293 -0.394 -0.445
## 5Thursday   4.426  2.089  1.833  0.758 -0.100 -0.501 -0.109 -0.322 -0.333 -0.341
## 
## [[2]]
##            15May- 22May- 29May- 5Jun-  12Jun-
## 6Friday    -0.705 -0.130  0.088 -0.063 -0.822
## 7Saturday   0.440 -0.731 -0.319 -0.148 -0.173
## 1Sunday    -0.662  1.375 -1.939 -0.579 -1.097
## 2Monday    -0.392 -0.403 -0.124 -1.013 -0.533
## 3Tuesday   -0.202 -2.003  1.252 -0.180 -0.296
## 4Wednesday -0.445  0.258 -0.274 -0.551       
## 5Thursday  -0.341  0.289 -1.231 -0.221

Table 3. The doublings/halvings per week, based on the ratios in Table 2. It is the number of doublings in a week if positive, and the number of halvings in a week if negative.

Figure 3. The doublings/halvings per week plotted against time. For the epidemic to reduce at the same rate it increased, the later figures would have to reach the same magnitude as the earlier figures, but be negative. Unfortunately, the early doublings per week are high, being greater than 2 for a number of weeks. The halvings per week reach only low numbers, and indicate a long “shoulder” to the decline in deaths.

More formal prediction modelling

Analysis of the data can provide some information about how the epidemic will proceed in the absence of further change in conditions. I adopted a less formal approach before, and here you can find the last analysis of that kind. I decided it was important to have a more systematic way of looking for good fits to the time course of the epidemic, and I developed a different method for estimating the time course – you will also find on that page the R code needed to pre-load to get this page’s code to work. Once we have a model of the time course, we can ask what that model predicts. I’ve assumed the next 6 months will be enough.

From late May, we have been in great uncertainty. The figures have been discouraging, with some recent days showing an increase in deaths over the previous week. Here, I show the predictions from two different patterns. The first stops short alllows three t.kinks, which shape the overall pattern of the epidemic, with two changes in day-of-the-week pattern. The second allows two further (one very recent) change in day-of-the-week pattern.

pat.1<-list(t.kinks = c(25, 33, 44), dow.steps = c(47, 79))

make.pred(pat.1)
## 
## The model fits 103 days of data from 2020-03-06 to 2020-06-16 and has the following pattern:
##   t.kinks1   t.kinks2   t.kinks3 dow.steps1 dow.steps2 
##         25         33         44         47         79 
## and leaves residual deviance 1082.3 on 80 degrees of freedom.
## 
## Total number in last week = 1086, and fitted number = 1191.2
## 
## initial slope   final slope         ratio 
##         0.232        -0.030         7.619 
## 
##       weekly ratio rem. mult. n pred    fit pred 
## lo.95    0.7924       3.8172  4145.4329 4546.9200
## pred     0.8081       4.2105  4572.5843 5015.4412
## hi.95    0.8238       4.6765  5078.6307 5570.4984
## 
## The predicted future 26 weekly totals are:
## 962.6 777.8 628.5 507.9 410.4 331.7 268.0 216.6 175.0 141.4 114.3  92.3  74.6  60.3  48.7  39.4  31.8  25.7  20.8  16.8  13.6  11.0   8.9   7.2   5.8   4.7,
## which sum to 4995.8.

This output has four sections, and will serve to explain all the sets of predictions with a weekly ratio of less than one. First, it shows the details of the time-pattern fitted to the data. The numbers are the days on which the different kinds of addition to the model take effect. A step change in the figures is allowed at each t.step day; a kink in slope on time is allowed at each t.kink day; a sudden change in the day of the week effects is allowed at each dow.step day; and a change in the time-drift of day of the week effects is allowed at each dow.kink day. Second, it shows the slope of the epidemic against time at the start, and at the end of the most recent data. It went up rapidly at the start, doubling more than twice a week, and on a log scale for the number of deaths, the slope against time is about 0.22 (per day). The epidemic is currently going down rather slowly, and the final slope is about -0.33. The ratio shows how much faster it went up than it is coming down — and tell us how many weeks now have to be spent getting the epidemic down, for each week the lockdown was delayed. The answer is somewhere between 6 and 8, which shows the vital importance of promptness of action.

The third section gives the actual number of deaths in the previous seven days, and the same number for the fitted values. Using the weekly ratio of decrease, these can both be used to give a prediction for how many future deaths there will be in this wave. The weekly ratio decrease is calculated from the slope on times, and the confidence interval for the slope can give a confidence interval for the weekly ratio, and this gives a prediction interval for the estimates of the remaining number of deaths.

The fourth section uses the model to predict the number of deaths in succeeding seven-day periods from today, for 26 weeks. These are printed out, and then the total of those numbers is printed.

The Bank Holiday on Monday 26th May has a low figure, and the figures on the following Wednesday and Thursday are very disappointing, as they are an increase on the previous week. We need to hope this is not the beginning of an upsurge in the number of deaths.

The important conclusions from this set of predictions are

We should therefore be alert to changes in the pattern of the epidemic over time. The relaxation of the lockdown may well have effects, and they should be happening soon. The predictions are similar.

pat.2<-list(t.kinks = c(23, 33, 46), dow.steps = c(40, 47, 79, 85))

make.pred(pat.2)
## 
## The model fits 103 days of data from 2020-03-06 to 2020-06-16 and has the following pattern:
##   t.kinks1   t.kinks2   t.kinks3 dow.steps1 dow.steps2 dow.steps3 dow.steps4 
##         23         33         46         40         47         79         85 
## and leaves residual deviance 390.7 on 68 degrees of freedom.
## 
## Total number in last week = 1086, and fitted number = 1153.6
## 
## initial slope   final slope         ratio 
##         0.254        -0.032         7.911 
## 
##       weekly ratio rem. mult. n pred    fit pred 
## lo.95    0.7870       3.6948  4012.5389 4262.4420
## pred     0.7985       3.9618  4302.5236 4570.4871
## hi.95    0.8099       4.2613  4627.7396 4915.9577
## 
## The predicted future 26 weekly totals are:
## 921.1 735.5 587.3 468.9 374.4 298.9 238.7 190.6 152.2 121.5  97.0  77.5  61.9  49.4  39.4  31.5  25.1  20.1  16.0  12.8  10.2   8.2   6.5   5.2   4.2   3.3,
## which sum to 4557.3.

A final and different analysis explores the possibility of recent change. We don’t want to allow recent dow.kinks, because that gives separate time trends for each day of the week, which can lead to an implausible divergence over time when predicting. The following analysis instead allows for two further time kinks after day 44. We choose one for day 67 (setting “starter<-68”), and then allow the other to vary from 68 up to the end of the period. The final line has one more residual DF, because a kink starts the day after its nominal day, and so this final line gives us the final slope with only the extra kink at starter==67. The estimate of the current slope on time is at the moment always negative. The confidence interval is wider when there is less data to pin down the current slope. One recent stretch of 5 days saw the confidence interval include positive values, but it is now more mixed.

starter<-68
outa<-array(NA,dim=c((nrow(df)-starter+1),6))
colnames(outa)<-c("last kink day","res.dev.","res.df","lo.95","est.slope","hi.95")
for (i in starter:nrow(df)) {
    fm<-fitpat(Deaths~t+dow,pat=list(t.steps=c(),t.kinks=c(23,33,45,starter-1,i),dow.steps=c(44),dow.kinks=c()),breakdir=-1)$m
    est<-coef(fm)["t"]
    ci<-suppressMessages(confint(fm,"t"))
    outa[i-starter+1,]<- c(i,fm$deviance,fm$df.residual,ci[1],est,ci[2])
#   print(paste(i,fm$deviance,ci[1],est,ci[2]))
}
print(outa)
##       last kink day res.dev. res.df       lo.95   est.slope        hi.95
##  [1,]            68 1253.205     84 -0.03801807 -0.03035332 -0.022766953
##  [2,]            69 1256.272     84 -0.03816618 -0.03009724 -0.022112662
##  [3,]            70 1256.778     84 -0.03856038 -0.03012433 -0.021778779
##  [4,]            71 1257.257     84 -0.03891067 -0.03011878 -0.021423893
##  [5,]            72 1255.202     84 -0.03991737 -0.03072316 -0.021636868
##  [6,]            73 1254.831     84 -0.04060412 -0.03096612 -0.021448442
##  [7,]            74 1253.453     84 -0.04142929 -0.03140810 -0.021517597
##  [8,]            75 1251.855     84 -0.04222889 -0.03187286 -0.021655569
##  [9,]            76 1251.931     84 -0.04288457 -0.03206451 -0.021396726
## [10,]            77 1250.769     84 -0.04389659 -0.03254645 -0.021365805
## [11,]            78 1249.426     84 -0.04503323 -0.03310311 -0.021362128
## [12,]            79 1246.624     84 -0.04662169 -0.03402199 -0.021637387
## [13,]            80 1242.042     84 -0.04868098 -0.03534101 -0.022248338
## [14,]            81 1244.507     84 -0.04948514 -0.03531836 -0.021430659
## [15,]            82 1246.194     84 -0.05033988 -0.03536078 -0.020690556
## [16,]            83 1241.104     84 -0.05299776 -0.03707228 -0.021498910
## [17,]            84 1237.864     84 -0.05553381 -0.03848592 -0.021842328
## [18,]            85 1238.421     84 -0.05751597 -0.03916339 -0.021275754
## [19,]            86 1240.066     84 -0.05957252 -0.03966177 -0.020294234
## [20,]            87 1240.097     84 -0.06244699 -0.04070872 -0.019617185
## [21,]            88 1239.019     84 -0.06598845 -0.04222405 -0.019231115
## [22,]            89 1237.631     84 -0.06995960 -0.04399400 -0.018938916
## [23,]            90 1236.129     84 -0.07488107 -0.04618991 -0.018589951
## [24,]            91 1237.895     84 -0.07947748 -0.04747367 -0.016786394
## [25,]            92 1237.242     84 -0.08622799 -0.05016112 -0.015709306
## [26,]            93 1240.885     84 -0.09233698 -0.05111795 -0.011911959
## [27,]            94 1244.041     84 -0.10038633 -0.05243023 -0.007079520
## [28,]            95 1245.535     84 -0.11195939 -0.05525748 -0.002060686
## [29,]            96 1245.099     84 -0.12889463 -0.06082665  0.002409213
## [30,]            97 1247.045     84 -0.14931774 -0.06532049  0.011845610
## [31,]            98 1251.584     84 -0.17205393 -0.06561417  0.030942516
## [32,]            99 1254.755     84 -0.20657768 -0.06637428  0.058974151
## [33,]           100 1257.749     84 -0.25610788 -0.06143166  0.110401859
## [34,]           101 1259.429     84 -0.30342912 -0.01060951  0.246736691
## [35,]           102 1255.750     84 -0.47098869  0.11355652  0.624643030
## [36,]           103 1259.693     85 -0.03507341 -0.02886518 -0.022757169