key: cord-0922739-gnph5fy7 authors: Lonergan, Mike; Chalmers, James D. title: Estimates of the ongoing need for social distancing and control measures post-“lockdown” from trajectories of COVID-19 cases and mortality date: 2020-06-01 journal: Eur Respir J DOI: 10.1183/13993003.01483-2020 sha: 72fe0655f5b8b484d918e4893d25aaa7bdc33474 doc_id: 922739 cord_uid: gnph5fy7 By 21st May 2020, SARS-CoV-2 had caused more than 5 million cases of COVID-19 across more than 200 countries. Most countries with significant outbreaks have introduced social distancing or “lockdown” measures to reduce viral transmission. So the key question now is when, how, and to what extent, these measures can be lifted. Publically available data, on daily numbers of newly-confirmed cases and mortality, were used to fit regression models estimating trajectories, doubling times and the reproduction number (R(0)) of the disease, before and under the control measures. These data ran up to 21st May 2020, and were sufficient for analysis in 89 countries. The estimates of R(0), before lockdown, based on these data were broadly consistent with those previously published: between 2.0 and 3.7 in the countries with the largest number of cases available for analysis (USA, Italy, Spain, France and UK). There was little evidence to suggest that the restrictions had reduced R far below 1 in many places, with France having the most rapid reductions – R(0) 0.76 (95%CI 0.72–0.82), based on cases and 0.77 (95%CI 0.73–0.80) based on mortality. Intermittent lockdown has been proposed as a means of controlling the outbreak while allowing periods of increase freedom and economic activity. These data suggest that few countries could have even 1 week per month unrestricted without seeing resurgence of the epidemic. Similarly, restoring 20% of the activity that has been prevented by the lockdowns looks difficult to reconcile with preventing the resurgence of the disease in most countries. COVID-19 is a respiratory disease caused by a novel coronavirus (SARS-CoV-2). 1 Its spread has already been the defining event of 2020. [1] [2] [3] Two other coronaviruses, severe acute respiratory syndrome coronavirus (SARS-CoV) and Middle Eastern respiratory syndrome coronavirus (MERS-CoV) had been identified in 2002 and 2012. 4 While both of these caused significant outbreaks of disease, they were more lethal and less transmissible, and did not cause pandemics. SARS-CoV-2 has already spread through most of the world. And most countries have restricted travel, closed large parts of industry, restructured their economies, and focussed their efforts on its control. By the 29 th April, 3,053,457 cases of COVID-19 had been confirmed by testing and 214,862 of those individuals had died. 5 Cases have been reported in 207 countries. Various measures have been adopted to control the spread of the virus. The most stringent of these have been termed "lockdown", and almost entirely restricted people to their own homes. The exact forms of the restrictions, and the exemptions allowed, have varied between countries and regions 6 , but all have been expensive in terms of reducing economic activity and painful through restricting social interaction. The question of when and how far to ease the restrictions is, therefore, urgent. 7, 8 At the end of April, some European countries began to try relaxing some of restrictions, but, in late-May, there continue to be large numbers of mortalities in most parts of the world. 5 We therefore need to understand both the transmissibility of the virus and the effectiveness of the social distancing and lockdown measures that have been taken. The difference between the initial spread of the virus, before the restrictions were imposed, and its spread under lockdown gives an estimate of how effective lockdown measures have been. It can also suggest how far those measures can be relaxed without a resurgence of infection. This paper uses publically available data from multiple countries to model the spread of SARS-CoV-2, both before and under the lockdown, and estimate the scope for relaxing the current restrictions. Data on the numbers of new confirmed cases of COVID-19, and numbers of deaths reported for people known to have COVID-19, are available from the European Centre for Disease Prevention and Control (ECDC) website ( https://www.ecdc.europa.eu/en/publications-data/download-todays-datageographic-distribution-COVID-19-19-cases-worldwide ). These were downloaded on the 22 nd May. Mortality data was used for countries that had reported at least 100 deaths, and numbers of cases for those where at least 1000 confirmed cases had been reported. The pattern of arrival of infectious individuals determines the course of the initial stages of outbreaks, therefore days before a total of 10 deaths or 100 cases had been reported in each country were discarded. That left 89 countries with sufficient data for further consideration. Both these types of data have important limitations: varying proportions of infections and deaths were not recorded, in each country and over time. But they do provide a large, stable, and standardised source of information that covers most countries. Confirmed cases are individuals who have tested positive for SARS-CoV-2. Unfortunately, no country has managed complete and continuous testing, and limitations and changes in testing strategies make this data particularly problematic. Data are skewed towards hospitalized cases and asymptomatic or paucisymptomatic cases, in particular, will be underreported. However, it is the best information on current prevalence, and recent changes in prevalence, that is available. The mortality data have an intrinsic lag that reduces their sensitivity to recent changes. Nevertheless, most countries have systematic testing of hospitalized cases and most mortality occurs in hospitals, so disease specific mortality is potentially less biased than confirmed cases. The mortality data is therefore preferred in cases where the results conflict. Data for each included country were examined for inconsistencies and artefacts. The 10 occasions where countries reported negative numbers of cases were discarded. The data for China on 18th April showed a spike that appears to be an artefact of redefinition, and was also discarded. Iran reported nothing on the 4 th April and a spike on the 5 th , so those reports were split evenly across the two days. The number of people a directly transmitted disease will infect each day is proportional to the number of infectious people multiplied by the number of susceptible people. While the absolute numbers of COVID-19 cases and deaths are shocking, the daily numbers are very small proportions of each country's population and, therefore, the numbers of susceptible individuals are almost constant. This means that, during periods of constant behaviour, exponential trajectories can be expected. And this should hold whether the daily numbers were increasing or decreasing. Each country introduced restrictions in a different pattern, so rather than attempting to interpret those rules, and how people responded to them, the data were used to identify periods of steady increase and decline. The aim was to calculate exponential growth rates for each country before and under lockdown. This required identifying, and discarding, the transitional period where the data were affected by both the original, pre-lockdown, and modified, lockdown behaviour. The data were loaded into R 3.6.1 (R Core Team 2019) 9 and mortality and cases from each country were analysed separately. Preliminary examination of the data showed that residuals around models fitted to almost all the datasets were overdispersed relative to the Poisson distribution. All the models therefore used the negative binomial error family, with a log link function. To find the best representation of the initial, exponential growth, phase, a pair of generalised linear models were fitted for each combination of start and finish date at least 10 days apart such that the finish date was no later than 5 days before the day that the maximum number of events was observed. The five day interval was chosen after exploration of the Spanish and Italian data, where tight lockdowns were associated with obvious changes in the trajectory. These changes were particularly visible because of the large numbers of infections in those countries at that time. Adjusting this interval changes the estimates, and estimability, of individual countries' trajectories but produces similar overall patterns The first model, of each pair, simply contained a linear term for time. The second model contained both linear and quadratic terms for time. BIC, the Bayesian information criterion 10 was calculated and compared for each pair of models. The choice of BIC as the criterion for identifying exponential periods was entirely pragmatic. Exploratory analyses using AIC 11 showed this selected very short intervals, and the small sample correction, AICc, worsens this problem. In BIC the penalty for additional parameters is proportional to the natural logarithm of the number of datapoints, so it is less eager to increase the complexity of models as sample size increases. Linear models were considered potential representations of the initial exponential growth phase if they: ; 1) had positive point estimates of slope; and 2) had BIC lower than their parallel quadratic model. If multiple models satisfied these criteria, the model where BIC was furthest below that of its quadratic equivalent was used. For the exponential period under lockdown, the model was chosen in a similar way, but with its data not beginning before five days after the finish of the first exponential period. No requirement was placed on the slope of the second exponential period, so this could be negative or positive. It could even be larger than that for the first period, if that produced a better fit to the data. No explicit allowance for the lifting of restrictions was included because this would curve the trajectory, and such periods therefore automatically be selected against. One exponential period was identified in the case data from 19 countries, and two exponential periods for 68 others. For the mortality data, these numbers were 1 and 53. To provide a visual check on these models, a generalised additive model (GAM) of the whole trajectory was also fitted 12 . In most cases, the ends of this curve are similar to the exponential models. It should be noted that GAMs favour steady change and curvature, while many of the changes in behaviour were quite sudden. For a few countries the mismatch between the GAM and exponential models gave, subjectively, cause for concern. These are indicated in the figures. The slopes, and confidence intervals around them, are of limited direct use. However, dividing the natural logarithm of 2 by them gives the doubling time of epidemic growth or halving time of its decay. R 0 , the basic reproduction number for the disease, is the expected number of people one infected person would pass the disease to in a naïve population. It is critical to disease spread: above 1 an epidemic will accelerate, below that the outbreak will fade away. Because these data include only a fraction of the cases in each country, they cannot be directly used to estimate R 0 . Instead, the R0 library 13 was used to apply the method of Wallinga and Lipsitch 14 to convert the estimates, and associated uncertainties, of the exponential trajectories into estimates of R 0 both before and under lockdown. This approach requires an estimated distribution for the serial interval of infection. The lognormal with mean 4 days and standard deviation of 2.9 days calculated by Nishiura, Linton and Akhmetzhanov 15 was used for this. While changing this distribution changes the individual estimated values for R 0 , the relationship between the estimates before and under lockdown is relatively insensitive to plausible choices. Most discussion of R considers it as either indicating whether a disease outbreak will grow or fade away. At best the size of R is used as an indication of these changes. However, it is also a measure of how frequently individuals come into sufficiently close contact to pass the disease. The difference between the value of R and 1 therefore contains information on how much behaviour needs to change to stop the spread of a disease, or how much restrictions on contact between individuals can be relaxed without causing a resurgence in infections. Four estimates of the scope for relaxing lockdown were then considered (table 1). The first, which will be called the time ratio, was a simple ratio of the exponential rates before and under lockdown. This indicates the number of days under lockdown required to balance a single day of previous behaviour. The second, the inverse of R 0 on lockdown minus 1, is the leeway. It is the proportion that contact under lockdown could be increased without causing a resurgence of the epidemic. As the continuing behaviour is quite different from that prevented, partly because much of what is permitted is within the domestic environment and most of that restricted is external to it, this measure is relatively uninformative and not discussed further. The third measure is the reclaimable fraction. It was calculated as: Provided R 0lockdown is less than both 1 and R 0before , this gives an estimate of the proportion of the behaviour, prevented by the lockdown, that can be resumed and result in an overall R 0 equal to 1. The first and third approaches give different results because daily changes combine multiplicatively. An example that demonstrates this would be for a disease with a generation time of 1 week that had R 0 of 2 initially and ½ under lockdown: alternate weeks of doubling and halving would oscillate around a constant value, with a mean contact rate of 1.25, higher than the continuous R of 1 that would produce stability. Counterintuitively, that suggests more activity overall might be possible under a strategy of intermittent lockdown. Confidence intervals around each estimate were generated by drawing 1000 values from the relevant model parameter distributions. While the current restrictions and lockdowns have very few precedents in public health, it is possible that they similar approaches might be needed to control future outbreaks of other diseases. The current measures might be expected to reduce disease transmission by a similar proportion for other respiratory diseases. A fourth measure, the ratio of the two R values was, therefore, also calculated. This, the stop limit, is the maximum pre-lockdown R 0 for a hypothetical disease or society where a lockdown of the current observed effectiveness, in proportion of contacts stopped, could halt an epidemic. (1-R 0lockdown )/ (R 0before -R 0lockdown ) R 0before ≥1≥ R 0lockdown the proportion of the contacts between individuals forgone under lockdown that could be resumed without raising R beyond 1 Stop Limit R 0before /R 0lockdown R 0lockdown ≤1 maximum initial R 0 for lockdown to be able to stop the epidemic. β 1 ; β 2 : slopes of the exponential periods before and under lockdown. R 0before ; R 0lockdown : the reproduction number of COVID-19 before and under lockdown. Results are presented for 89 countries. Because so many countries were considered, some results can be expected to appear significant by chance, and caution is needed in interpreting individual results. The discussion below will therefore largely focus on general patterns that show consistency across multiple countries. Figure 1 shows trajectories for the five countries with the highest number of deaths in this dataset, and table 2 parameter estimates for each of them. Equivalent graphs for the remaining countries are in the supplementary material. It can be seen that the intervals of exponential growth are in the early stages of the epidemic. That is consistent with the behavioural change to be expected, and that was intended, as regulations were imposed and public awareness of the urgency of the COVID-19 problem spread. While it could be argued that the decline in Spanish cases appears to slow in early May, when they tentatively began easing their lockdown, this effect is small and removing this period produces very similar results. For cases in the UK, the identified second exponential phase is almost flat, and followed by a decline that more nearly resembles the concurrent decline in mortality. This is pattern probably results from dramatic increases in testing within the UK during April 2020. The confidence intervals around the exponential models are noticeably narrower than those around the GAMs, this is largely due to the information the GAMs require for the extra parameters that describe their curvature. Visual inspection of the plots suggests that the method has selected subperiods that do not seem representative for cases in 9 countries (Algeria, Bosnia, Canada,China, Greece, Iran, Moldova, Panama and Poland) and for mortality for 2 (Canada and Romania). In most cases these involve relatively small numbers of individuals or have their highest daily totals close to the end of the timeperiod. Trimming the data can resolve this problem for most of these countries, but would need to be done differently for each one and introduce a subjective element into the analysis. For Canada, there are three apparently exponential periods, broadly similar to the pattern for cases in the UK. These results are included, but indicated, in the figures. The models ignored the first, small, outbreak in Singapore and picked up only the larger growth since then. . Supplementary Table 1 contains the estimated slopes, and standard errors, for the two best exponential models of cases and mortality trajectories in each model. As doubling times are more immediately interpretable, these are shown ( Figure 2A ). Many of these are too imprecise to be useful. However, for those countries with sufficient data, estimates of doubling times from mortality data are generally around 2 to 5 days. The estimates of halving time under lockdown ( Figure 2B ) are generally over 7 days, and much higher than the equivalent pre-lockdown doubling times. This impression is confirmed by inspection of individual trajectories, most of which decline more slowly than they increase. The dots are numbers of new cases (left) or deaths (right) reported to the ECDC for each day up to 21st May 2020. Each grey pipe shows the 95% confidence interval around a smooth trajectory (black line) estimated by a generalised additive model. In red are exponential patterns (mean & 95% CI) fitted to subsets of the data. Details of the models are in the main text. Table 1 contains all these data. A) doubling time in the first (pre lockdown) exponential phase of the epidemic. Lines that meet 0, the left hand side of the box, indicate a more than 2.5% chance that the epidemic was slowing over this period. B) halving time in the second (locked down) exponential phase. The vertical dotted line is at 7 days in panes A and B, and shows that almost all declines were slower than the preceding increases. C) The basic reproduction number, R 0 , for COVID-19 in each country during the first The estimates of R 0 contain essentially the same information as those of doubling times. The definition of the initial exponential period requires all the point estimates of R 0 to be greater than 1, though the lower bounds of some of the confidence intervals fall below that threshold ( Figure 2C and Supplementary Table 1 ). Almost all the values under lockdown ( Figure 2D ) are between 0.6 and 1.5. And the reductions in many countries are substantial (table 2) . While previous versions of this analysis, using data uo to 29th April 2020 showed little evidence for countries having reduced R 0 below 0.9, the additional data available now suggests that values close to 0.75 have been achieved. 16 That suggests these countries have up to 33% leeway for the expansion of the permitted activities under lockdown, and that the stop limit for these lockdowns to prevent more contagious diseases is up to 25% higher than the initial R 0 of COVID-19. Because it is such a short time since most countries have introduced restrictions and changed the behaviour of their populations, there is a lot of uncertainty in the estimated trajectories under lockdown. But most of the more precise estimates (Figure 3 ) suggest that periodical release of lockdown beyond one week in each month is very likely to result in the acceleration of the epidemic in many countries. And even this is based on the assumption that behaviour during intermittent releases from lockdown resembling typical behaviour in the period before the behavioural changes associated with the COVID19 epidemics. It would be useful to understand what the countries where more time outside lockdown looks achievable have done differently. For each country the exponential rate calculated before lockdown was divided by that under lockdown to give a mean and 95% confidence interval. Black is again based on mortality and red on confirmed cases. Thin lines and hollow points indicate countries where plots of the modelled trajectories led to subjective doubts of the model fits. Lines that meet 0, the left hand side of the box, indicate a more than 2.5% chance that the epidemic was actually spreading faster over the second period than the first. The vertical dotted line indicates the effect of relaxing lockdown for one week (during which previous behaviour would be resumed) each month. Most of the more Similarly, the reclaimable fraction of forgone contacts is less than 0.2 for most countries where reasonably precise data are available (Figure 4 ).For ten countries (Austria, Belgium, China, France, Hungary, Italy, the Netherlands, Spain, Turkey, and the USA) models of both the case and mortality data exclude 0 from the 95% confidence intervals around their estimates of the proportional easing of restrictions that would not raise R 0 above 1. For seven other countries, the mortality models capture their reported success in containing COVID-19, but the models of numbers of cases do not. In the figure, it can be seen that most of the confidence intervals around the estimates of the proportional easing in restrictions that would be consistent with avoiding a second peak of transmission extend to the left of the vertical line at 0.2, and most of the more precise point estimates are also below that value. Resuming even 20% of currently prevented behaviour therefore looks extremely ambitious in most countries, with even a 10% easing appearing potentially risky in many of them. The Reclaimable fraction, one minus R 0 under lockdown divided by the difference between the R 0 's before and under lockdown, is an estimate of the proportion of the behaviour, that lockdown has prevented, that can be resumed without increasing R 0 past 1, and restarting epidemic spread (table 1) . Each row is the mean and 95% confidence interval for a country, black uses mortality data, red confirmed cases. Thin lines and hollow points indicate countries where plots of the modelled trajectories led to subjective doubts of the model fits. Lines that cut the left hand edge (0) indicate countries for whom lockdown may not yet have halted the epidemic. The vertical dotted line at 0.2 is a guide to highlight that there is little evidence for it being sustainable to resume more than 20% of discontinued activity without the epidemic resuming its spread. These analyses are, by their nature, provisional. They attempt to provide estimates and predictions from limited datasets. The models differ from most of the infectious disease models that have been applied to the COVID epidemics: they are based entirely on behaviour observed during the present pandemic of SARS-CoV-2 and do not incorporate assumptions based on the behaviour and spread of other respiratory viruses. Only the conversion of the slope parameters to estimates of R 0 uses a previously estimated distribution of generation times. This simplicity avoids reliance on the uncertain assumptions, necessary for more traditional epidemiological models, instead increasing the confidence intervals are the estimates. And both the results and the confidence intervals it produces appear similar to many of those from far more computationally intensive methods. However, the simplicity does limit the details of human and viral behaviour, and the differences between countries, that can be resolved. Despite this, a surprisingly clear picture is visible: if COVID-19 had been 25% more transmissible the current lockdown measures would have been unable to halt the epidemic in Europe. In most datarich countries its spread has been contained, though . Where it has been stopped, the margins for loosening the controls are limited: nowhere looks able to confidently resume half of what has been stopped. And the slow rates of decline in mortality suggest uncomfortable lower bounds on future mortality: sustaining a 10% per day decline, a rate faster than the best estimate for almost all the lasting declines in these data, implies that there will be a total of another 9 times as many deaths to come as were reported yesterday; 5% per day increases that to 19 times. There has been talk of lockdown being "a cure worse than the disease", but it is not a cure. At 5% per day it will take 35 days to claw back from 600 to 100 deaths per day; and another 45 to then get down to 10. If 10% per day could be sustained it would only require 18 plus 20 days. Outside Europe, many countries are not yet clearly past, or even close to, the peak. That suggests easing in the near future will imply continuing mortality, and substantial easing is very likely to require the rapid reimposition of lockdown. R 0 , or more precisely R t , seems to be the key to this problem: until and unless a vaccine or effective treatment becomes available, we need a liveable way to keep R below 1. Lockdown, to a point beyond what most societies would have previously imagined accepting, can contain the disease's spreadbut it is hard to see it continuing indefinitely. These data suggest that unless a vaccine becomes rapidly available, discussions around exit strategy from current restrictions therefore need to move on from optimistic concepts of returning rapidly to normal activity. The data is more consistent with a need to adopting a "new normal" that can provide the optimal balance between allowing economic activity while ensuring very substantial reductions in prior social contacts (at least 80% reductions according to our best estimates). It is beyond the scope of this paper to describe what the components of a new normal may be but discussions will include continuing social distancing, public use of face-coverings, testing, tracking and isolating infected individuals and contacts and widespread screening of asymptomatic individuals among other considerations. [17] [18] [19] In summary, a simple analysis based on the behaviour of the SARS-CoV-2 pandemic to date across 73 countries suggests remarkably consistent effects of both exponential growth and slow decline in cases and mortality. Without a vaccine, these estimates are incompatible with a return to previous activities post "lockdown". Figure 1 , for all the countries listed in Supplementary table 1 3) The R code used for these calculations. 2) Supplementary plots of trajectories, similar to those in Figure 1 of the paper, for all the countries listed in Supplementary table 1 3) The R code used for the calculations. The dots are numbers of new cases or deaths reported to the ECDC for each day up to May 22 nd 2020. Each grey pipe shows the 95% confidence interval around a smooth trajectory (black line) estimated by a generalised additive model. In red are increasing and decreasing exponential patterns (mean & 95% CI) fitted to subsets of the data. Details of the models are in the main text. Only countries for which at least one exponential period was identified are shown. For some countries the approach produces convincing results, for others, especially where there is little data, the results are much less convincing. Adjusting the constraints and model selection approach will, subjectively, improve some results but worsen others. It was felt more important to use a consistent method than optimise the results for each individual country, and the poor fits are included to give a fair impression of the approach and its limitations. While visually very strong, the grey pipe around each GAM result should not be mistaken for the truth: it is also the output of a model with a set of assumptions. # data from: # https://www.ecdc.europa.eu/en/publications-data/download-todays-data-geographicdistribution-covid-19-cases-worldwide dat11<-read.csv("C:/mike/covid/COVID-19-geographic-disbtribution-worldwide.csv",as.is=TRUE) # reverse so in order of increasing date dat11<-dat11[nrow(dat11):1,] # shorten country names(dat11)<-ifelse(names(dat11)=="countriesAndTerritories","country",names(dat11)) # shorten some names dat11$country[dat11$country=="United_States_of_America"]<-"USA" dat11$country[dat11$country=="United_Kingdom"]<-"UK" dat11$country[dat11$country=="Dominican_Republic"]<-"Dominican_R" dat11$country[dat11$country=="United_Arab_Emirates"]<-"UAE" dat11$country[dat11$country=="Bosnia_and_Herzegovina"]<-"Bosnia" dat11$country[dat11$country=="North_Macedonia"]<-"N_Macedonia" dat11$country[dat11$country=="Democratic_Republic_of_the_Congo"]<-"DR_Congo" dat11$d2020<-dayssince1900(strptime2(dat11$dateRep))-120*365-28 [1, 1] ,res [1, 2] ,1],sa [,,4] ,NA_real_) # filter out any that start less than gap after the end of the first exponential growth if(!is.na(res [1, 2] [2, 1] ,thesebounds [2, 2] ,2] } if(slopetab[i,1] %in% names(slopelistc)) { eval(parse(text=paste("theseslopes<-slopelistc$",slopetab[i,1],sep=""))) thesebounds<-minse ( [1, 1] ,thesebounds [1, 2] ,1] slopetab$cbse[i]<-theseslopes[thesebounds [1, 1] ,thesebounds [1, 2] ,2] slopetab$caslope[i]<-theseslopes[thesebounds [2, 1] ,thesebounds [2, 2] ,1] slopetab$case[i]<-theseslopes[thesebounds [2, 1] ,thesebounds [2, 2] ,2] } } # discard those with no initial exponential models slopetab<-slopetab[!is.na(slopetab$dbfirstday) | !is.na(slopetab$cbfirstday),] # doubling times : also need version that just does halving slopetab$dbdble<-log(2)/slopetab$dbslope slopetab$dbdblel<-log(2)/(slopetab$dbslope+2*slopetab$dbse) slopetab$dbdbleu<-log(2)/(slopetab$dbslope-2*slopetab$dbse) slopetab$dadble<-log(2)/abs(slopetab$daslope) slopetab$dadblel<-log(2)/(abs(slopetab$daslope)+2*slopetab$dase) slopetab$dadbleu<-log(2)/(abs(slopetab$daslope)-2*slopetab$dase) # using 1000000 for Inf to ease plotting slopetab$dahalve<-ifelse(slopetab$daslope<0,slopetab$dadble,NA_real_) slopetab$dahalvel<-slopetab$dadblel slopetab$dahalveu<-ifelse((slopetab$daslope+2*slopetab$dase)<0,slopetab$dadbleu,1000000) slopetab$cbdble<-log(2)/slopetab$cbslope slopetab$cbdblel<-log(2)/(slopetab$cbslope+2*slopetab$cbse) slopetab$cbdbleu<-log(2)/(slopetab$cbslope-2*slopetab$cbse) slopetab$cadble<-log(2)/abs(slopetab$caslope) slopetab$cadblel<-log(2)/(abs(slopetab$caslope)+2*slopetab$case) slopetab$cadbleu<-log(2)/(abs(slopetab$caslope)-2*slopetab$case) slopetab$cahalve<-ifelse(slopetab$caslope<0,slopetab$cadble,NA_real_) slopetab$cahalvel<-slopetab$cadblel slopetab$cahalveu<-ifelse((slopetab$caslope+2*slopetab$case)<0,slopetab$cadbleu,1000000) # r0 # 4 day -old way slopetab$dbr4<-exp(4*slopetab$dbslope) slopetab$dbr4l<-exp(4*(slopetab$dbslope-2*slopetab$dbse)) slopetab$dbr4u<-exp(4*(slopetab$dbslope+2*slopetab$dbse)) slopetab$dar4<-exp(4*slopetab$daslope) slopetab$dar4l<-exp(4*(slopetab$daslope-2*slopetab$dase)) slopetab$dar4u<-exp(4*(slopetab$daslope+2*slopetab$dase)) slopetab$cbr4<-exp(4*slopetab$cbslope) slopetab$cbr4l<-exp(4*(slopetab$cbslope-2*slopetab$cbse)) slopetab$cbr4u<-exp(4*(slopetab$cbslope+2*slopetab$cbse)) slopetab$car4<-exp(4*slopetab$caslope) slopetab$car4l<-exp(4*(slopetab$caslope-2*slopetab$case)) slopetab$car4u<-exp(4*(slopetab$caslope+2*slopetab$case)) # new library(R0) # Nishiura et al 2020: lognormal mean 4.7 sd 2.9 mGT <-generation.time("lognormal", c(4.7,2.9)) # because these are only a sample of the people, R0 doesn't like working directly off them # so go via the slope estimates slopetab$dbr0<-NA_real_ slopetab$dbr0l<-NA_real_ slopetab$dbr0u<-NA_real_ slopetab$dar0<-NA_real_ slopetab$dar0l<-NA_real_ slopetab$dar0u<-NA_real_ A Novel Coronavirus from Patients with Pneumonia in China First known person-to-person transmission of severe acute respiratory syndrome coronavirus 2 (SARS-CoV-2) in the USA Clinical course and risk factors for mortality of adult inpatients with COVID-19 in Wuhan, China: a retrospective cohort study Middle East respiratory syndrome: the need for better evidence in severe respiratory viral infections European Centres for Disease Control Coronavirus Data Estimating the Number of Infections and the Impact of Non-Pharmaceutical Interventions on COVID-19 in 11 European Countries. London The effect of control strategies to reduce social mixing on outcomes of the COVID-19 epidemic in Wuhan, China: a modelling study Impact assessment of non-pharmaceutical interventions against coronavirus disease 2019 and influenza in Hong Kong: an observational study R: A language and environment for statistical computing. R Foundation for Statistical Computing Estimating the Dimension of a Model Model Selection and Multimodel Inference: A Practical Information-Theoretic Approach Generalized Additive Models: An Introduction with R. 2nd Editio R0: Estimation of R0 and Real-Time Reproduction Number from Epidemics. R package version 1.2-6 How generation intervals shape the relationship between growth rates and reproductive numbers Serial interval of novel coronavirus (COVID-19) infections Estimates of the ongoing need for social distancing and control measures post-"lockdown" from trajectories of COVID-19 cases and mortality. medRxiv Projecting the transmission dynamics of SARS-CoV-2 through the postpandemic period ],na.action=na.exclude) pgb<-predict(gb,newdata=datc max(datc$d2020)),type="response"),col=2,lty= exp(pga$fit+2*pga$se.fit),col=2,lty="dashed",lwd=2) lines(datc$d2020 xlim=c(0,12),ylim=c(0,nrow(slopetabt)+1),yaxs="i 1:nrow(slopetabt), slopetabt$country ,las=2) segments(slopetabt$dbdblel :nrow(slopetabt)+0.2,col=2, pch=ifelse(slopetabt$country %in% badcases abline(v=7,lty="dotted") ylim=c(0,nrow(slopetabt)+1),yaxs="i",yaxt="n",ylab= "", xlab="B) halving time (days) 1:nrow(slopetabt), slopetabt$country ,las=2) segments(slopetabt$dahalvel , 1:nrow(slopetabt),slopetabt$dahalveu ,1:nrow(slopetabt), lwd=ifelse(slopetabt$country %in% baddeaths :nrow(slopetabt)+0.2,col=2, pch=ifelse(slopetabt$country %in% badcases abline(v=7,lty="dotted") 1:nrow(slopetabt),ylim=c(0,nrow(slopetabt)+1),yaxs="i 1:nrow(slopetabt), slopetabt$country ,las=2) segments(exp(4*(slopetabt$dbslope -2*slopetabt$dbse )),1:nrow(slopetabt), exp(4*(slopetabt$dbslope +2*slopetabt$dbse )),1:nrow(slopetabt), lwd=ifelse(slopetabt$country %in% baddeaths *(slopetabt$cbslope )),1:nrow(slopetabt)+0.2,col=2, pch=ifelse(slopetabt$country %in% badcases *(slopetabt$cbslope -2*slopetabt$cbse )),1:nrow(slopetabt)+0.2, exp(4*(slopetabt$cbslope +2*slopetabt$cbse )),1:nrow(slopetabt)+0.2,col=2, lwd=ifelse(slopetabt$country %in% badcases,1,2)) #abline(v=1 1:nrow(slopetabt), ylim=c(0,nrow(slopetabt)+1),yaxs="i 1:nrow(slopetabt), slopetabt$country ,las=2) segments(exp(4*(slopetabt$daslope -2*slopetabt$dase )),1:nrow(slopetabt), exp(4*(slopetabt$daslope +2*slopetabt$dase )),1:nrow(slopetabt), lwd=ifelse(slopetabt$country %in% baddeaths *(slopetabt$caslope )),1:nrow(slopetabt)+0.2,col=2, pch=ifelse(slopetabt$country %in% badcases *(slopetabt$caslope -2*slopetabt$case )),1:nrow(slopetabt)+0.2, exp(4*(slopetabt$caslope +2*slopetabt$case )),1:nrow(slopetabt)+0.2,col=2, lwd=ifelse(slopetabt$country %in% badcases C:/mike/covid/trajectories submitted erj/ms figs2/fig3.tif <-NA_real_ slopetabt$dpropunlocku[is.na(slopetabt$dpropunlock)]<-NA_real_ slopetabt$cpropunlock[slopetabt$cpropunlocku-slopetabt$cpropunlockl>=1]<-NA_real_ slopetabt$cpropunlockl[is.na(slopetabt$cpropunlock)]<-NA_real_ slopetabt$cpropunlocku[is.na(slopetabt$cpropunlock)]<-NA_real_ slopetabt<-slopetabt[!is.na(slopetabt$dpropunlock) | !is.na(slopetabt$cpropunlock Time ratio: the proportion of time off lockdown without epidemic resurgance 1:nrow(slopetabt), slopetabt$country ,las=2) segments(slopetabt$dpropunlockl ,1:nrow(slopetabt),slopetabt$dpropunlocku ,1:nrow(slopetabt), lwd=ifelse(slopetabt$country %in% baddeaths :nrow(slopetabt)+0.2,col=2, pch=ifelse(slopetabt$country %in% badcases :nrow(slopetabt)+0.2, slopetabt$cpropunlocku ,1:nrow(slopetabt)+0.2,col=2, lwd=ifelse(slopetabt$country %in% badcases,1,2)) -slopetab C:/mike/covid/trajectories submitted erj/ms figs2/fig4.tif !is.na(slopetabt$dprf) & slopetabt$dprfu<1) | (!is.na(slopetabt$cprf) & slopetabt$cprfu<1 <-NA_real_ slopetabt$dprfu[is.na(slopetabt$dprf)]<-NA_real_ slopetabt$cprf[slopetabt$cprfu-slopetabt$cprfl>=1]<-NA_real_ slopetabt$cprfl[is.na(slopetabt$cprf)]<-NA_real_ slopetabt$cprfu[is.na(slopetabt$cprf)]<-NA_real_ slopetabt<-slopetabt Reclaimable fraction: the proportion of contacts, forgone under lockdown, reclaimable without epidemic resurgance 1:nrow(slopetabt), slopetabt$country ,las=2) segments(slopetabt$dprfl ,1:nrow(slopetabt),slopetabt$dprfu ,1:nrow(slopetabt), lwd=ifelse(slopetabt$country %in% baddeaths :nrow(slopetabt)+0.2,col=2, pch=ifelse(slopetabt$country %in% badcases abline(v=0.2,lty="dotted") slopetab)) { if(!is.na(slopetab$cbfirstday # first and last d2020, slopes, ses, doubling time + CI, r0 + CI C:/mike/covid/trajectories submitted erj/ms figs2/slopetab2 ceiling(dat11[dat11$country=="Iran" & dat11$dateRep=="05/04/2020",c("cases","deaths")]/2) # in China a huge pile got added on the 17/04/2020; discard that day dat11<-dat11[dat11$country!="China" | dat11$dateRep!="17/04/2020",] # add running totals for each country dat11$cumdeaths<-0 dat11$cumcases<-0 # need utility so cumsum copes with NAs cumsum2<-function(x) cumsum(ifelse(is.na(x),0,x)) for ( plot(datc$d2020, datc$cases,pch=20,type="b", xlab="days from Jan 1st", ylab="cases",main=paste(slopetabc$country[i],sum(datc$cases))) } } slopetabc par(mfrow=c (4, 4) ) for(i in 1:16) plot(datc$d2020, datc$deaths,pch=20,type="b", xlab="days from Jan 1st", ylab="deaths",main=paste(slopetab$country[i],sum(datc$deaths))) } } slopetab [1:30,] ####################################### # estimate exponential rates # do for each possible start and end point that gives at least 5 datapoints # don't include days before a total of 10 deaths/ 100 cases had been recorded # only do for countries with 100 deaths, or 1000 cases, spread over at least 6 days # neg binomial glms -use +-2se in 95%CI for simplicity # store results in array: first two dimensions start and end times only fill above diagonal # 3rd dimension: slope then slope se, then dAIC for quadratic, then dBIC for quadratic, then theta # mark date of peak with -1 in the diagonal of the theta layer so can use it to # prevent overlapping of the first and second intervals slopearray<-array(NA_real_,c(length(unique(dat11$d2020)),length(unique(dat11$d2020)),5)) slopelistd<-list() library(MASS) library(MuMIn) library(mgcv) # deaths for(i in 1: [2, 2] if("glm" %in% class (g2) { datc$resp<-datc$deaths firstnlast<-as.numeric(slopetable[slopetable$country==ctry, c("dbfirstday", "dblastday", "dafirstday", "dalastday")]) datc<-datc[cumsum2(datc$resp)>10,] } else { datc$resp<-datc$cases firstnlast<-as.numeric(slopetable[slopetable$country==ctry, c("cbfirstday", "cblastday", "cafirstday", "calastday")]) datc<-datc[cumsum2(datc$resp)>100,] } require(mgcv) gam1<-gam(resp~s(d2020),data=datc,family=nb(),na.action=na.exclude) pgam1<-predict(gam1,newdata=datc,se=TRUE) plot(datc$d2020,datc$resp,pch=20, xlab="days from January 1st",ylab=paste("daily",response),main=ctry) polygon(c(datc$d2020, rev(datc$d2020)), c(exp(pgam1$fit+2*pgam1$se.fit),rev(exp(pgam1$fit-2*pgam1$se.fit))), col="grey") lines(datc$d2020,exp(pgam1$fit)) points(datc$d2020, datc$resp,pch=20)if(!is.na(firstnlast [2] ))