Aggregates daily mortality reporting data to a weekly basis. For more details see the help vignette:
Arguments
- data
Raw data containing doe (Date of event), dor (Date of registration or reporting) and location_code. The columns must have these exact names.
- aggregation_date
Date of aggregation
- max_week_delay
Maximum weeks of delay taken into account. Must be greater than 2.
- keep_weekly_prob
Binary. If True, the final aggregated data has weekly reporting percentile.
Value
Aggregated weekly data with number of events happened each week and reporting delay distribution
Examples
data <- nowcast::data_fake_nowcasting_raw
aggregation_date <- as.Date("2020-01-01")
max_week_delay <- 4
weekly_counts <- count_weekly_reporting(data, aggregation_date, max_week_delay)
weekly_counts_p <- count_weekly_reporting(data, aggregation_date, max_week_delay, keep_weekly_prob = TRUE)