View source: R/growth_rate_ratio.R
growth_rate_ratio | R Documentation |
Calculate the growth rate ratio as defined in Badr et al.
growth_rate_ratio(v, Ws = 3, Wl = 7, smooth_window = 7)
v |
a numeric vector of new cases per day (incidence) |
Ws |
integer(1), the number of days to average for the shorter window |
Wl |
integer(1), the number of days to average to the longer window |
smooth_window |
integer(1), the size of the window to apply rolling mean smoothing to. The smoothing is applied before the summary process occurs |
The Growth Rate Ratio is defined as the logarithmic rate of change (number of newly reported cases) over the previous Ws days relative to the logarithmic rate of change over the longer Wl days. GR for any county j on a day t was calculated as follows: where Cjt is the number of new cases reported in county j on a day t.
a numeric vector
Sean Davis seandavi@gmail.com
if(requireNamespace("zoo")) { nyt= nytimes_state_data() %>% dplyr::filter(fips=='00053' & subset=='confirmed') %>% add_incidence_column() mgr = nyt %>% dplyr::pull(inc) %>% growth_rate_ratio() }
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.