-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathreport.Rmd
More file actions
68 lines (51 loc) · 5.27 KB
/
report.Rmd
File metadata and controls
68 lines (51 loc) · 5.27 KB
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
---
title: "Summary text"
author: "SACEMA"
date: "`r format(Sys.Date(), '%Y-%m-%d')`"
output: html_document
---
```{r setup, include=FALSE}
knitr::opts_chunk$set(echo = TRUE)
require(data.table)
cons.dt <- readRDS("results/consolidated.rds")
n_cntrys_ended_first <- cons.dt[,
sum(done_first, na.rm = TRUE)
]
n_total_cntrys <- cons.dt[,.N]
n_cntrys_mult_waves <- cons.dt[,
sum(have_second, na.rm = TRUE)
]
n_cntrys_mult_waves_ended <- cons.dt[,
sum(done_more, na.rm = TRUE)
]
qnames <- c("lwr","med", "upr")
time_to_end_first_wave <- round(cons.dt[
done_first == TRUE,
quantile(wave1timing, probs = c(.25, .5, .75))
])
names(time_to_end_first_wave) <- qnames
CCpMP_end_first_wave_all <- round(cons.dt[done_first == TRUE, quantile(wave1cases, probs = c(.25, .5, .75))])
CCpMP_end_first_wave_has2 <- round(cons.dt[have_second == TRUE, quantile(wave1cases, probs = c(.25, .5, .75))])
CCpMP_end_first_wave_has1 <- round(cons.dt[(done_first == TRUE) & (have_second == FALSE), quantile(wave1cases, probs = c(.25, .5, .75), na.rm = TRUE)])
names(CCpMP_end_first_wave_all) <- names(CCpMP_end_first_wave_has2) <- names(CCpMP_end_first_wave_has1) <- qnames
ratio_peak_trough_inc <- round(cons.dt[, quantile(peaktotrough, probs = c(.25, .5, .75), na.rm = TRUE)])
ratio_peak_trough_pos <- round(cons.dt[, quantile(tposratio, probs = c(.25, .5, .75), na.rm = TRUE)])
names(ratio_peak_trough_inc) <- names(ratio_peak_trough_pos) <- qnames
interwave_period <- round(cons.dt[, quantile(one_to_two, probs = c(.25, .5, .75), na.rm = TRUE)])
names(interwave_period) <- qnames
resurg_days_4wk_prior_wave2 <- round(cons.dt[, quantile(days_resurge_28, probs = c(.25, .5, .75), na.rm = TRUE)])
resurg_days_2wk_prior_wave2 <- round(cons.dt[, quantile(days_resurge_14, probs = c(.25, .5, .75), na.rm = TRUE)])
names(resurg_days_4wk_prior_wave2) <- names(resurg_days_2wk_prior_wave2) <- qnames
n_enter_w2_within_4wk_first_resurg <- cons.dt[, sum(two_within_28, na.rm = TRUE)]
n_has_postwave_resurg <- cons.dt[, sum(have_post_resurge, na.rm = TRUE)]
n_w2_bigger <- cons.dt[, sum(greater_follow, na.rm = TRUE)]
n_w2_appear_smaller <- NA
```
## Summary text
To date, `r n_cntrys_ended_first` countries of the `r n_total_cntrys` countries analyzed have concluded their first epidemic wave and, of these, `r n_cntrys_mult_waves` have experienced additional wave(s) and `r n_cntrys_mult_waves_ended` have seen one or more of those additional waves end. For those countries ending the first wave, the median time from the peak to the end of the first wave was `r time_to_end_first_wave['med']` days (Interquartile Range: `r time_to_end_first_wave['lwr']`-`r time_to_end_first_wave['upr']`), and the median number of cumulative confirmed cases per million population at the end of the first wave was `r CCpMP_end_first_wave_all['med']` (IQR: `r CCpMP_end_first_wave_all['lwr']`-`r CCpMP_end_first_wave_all['upr']`; `r CCpMP_end_first_wave_has2['med']`, IQR: `r CCpMP_end_first_wave_has2['lwr']`-`r CCpMP_end_first_wave_has2['upr']` for only those experiencing a second wave and `r CCpMP_end_first_wave_has1['med']`, IQR: `r CCpMP_end_first_wave_has1['lwr']`-`r as.character(CCpMP_end_first_wave_has1['upr'])` for those not yet experiencing a second wave). The median ratio of the magnitude of the wave peak to the size of the post wave trough was `r ratio_peak_trough_inc['med']` (IQR: `r ratio_peak_trough_inc['lwr']`-`r ratio_peak_trough_inc['upr']`). The median ratio of test positivity at the peak of the first wave to the end of the first wave was `r ratio_peak_trough_pos['med']` (IQR: `r ratio_peak_trough_pos['lwr']`-`r ratio_peak_trough_pos['upr']`). The median time from the end of the first wave to the beginning of the second wave was `r interwave_period['med']` days (IQR: `r interwave_period['lwr']`-`r interwave_period['upr']`). The median number of days in a resurgence within the four weeks preceding the beginning of the second wave was `r resurg_days_4wk_prior_wave2['med']` (IQR: `r resurg_days_4wk_prior_wave2['lwr']`-`r resurg_days_4wk_prior_wave2['upr']`). The median number of days in a resurgence within the two weeks preceding the beginning of the second wave was `r resurg_days_2wk_prior_wave2['med']` (Range: `r resurg_days_2wk_prior_wave2['lwr']`-`r resurg_days_2wk_prior_wave2['upr']`). `r n_enter_w2_within_4wk_first_resurg` of the `r n_has_postwave_resurg` countries that have experienced a post-wave resurgence entered a second wave within four weeks of the beginning of the first resurgence after ending the initial wave. X of these countries also had at least one day identified as a resurgence prior to the month preceding the beginning of the second wave, and X of the X countries that have (a) concluded the first wave and (b) had at least one day identified as a resurgence have not yet experienced a second wave. In `r n_w2_bigger` of the `r n_cntrys_mult_waves` countries experiencing subsequent waves, the peak of those waves has exceeded the magnitude of the first wave peak, and `r n_w2_appear_smaller` countries appear to have experienced smaller peaks than in the first wave (though may yet resurge to a larger peak value).
## Including Plots
You can also embed plots, for example:
```{r pressure, echo=FALSE}
plot(pressure)
```
Note that the `echo = FALSE` parameter was added to the code chunk to prevent printing of the R code that generated the plot.