Given raw case counts by location, and some dates and other params return candidate clusters and counts
generate_case_grids(
cases,
detect_date,
baseline_length = 90,
max_test_window_days = 7,
guard_band = 0,
baseline_adjustment = c("add_one", "add_one_global", "add_test", "none"),
adj_constant = 1
)an object of class `CaseGrids` contain a list of items
`baseline_counts_by_location`: a frame of counts over the baseline interval by location
`case_grid`: a frame of cases during the test dates, with reverse cumulative counts within location, by date
`case_grid_totals_by_date`: reverse cumulative sum of counts over all locations, by date
`test_cases`: case location counts only during the test dates
`detect_date`: the detect date passed to this function
`baseline_total`: an integer holding the total counts over all locations and dates
frame of cases with counts, location(s) and dates
date to end examination of detection of clusters
number of days (integer) used for baseline detection (default = 90)
integer, max number of days in a detected cluster, defaults to 7
integer (default=0) number of days buffer between test interval and baseline
one of three string options: "add_one" (default), "add_test", or "none". All methods except for "none" will ensure that the log(obs/expected) is always defined (i.e. avoids expected =0). For the default, this will add 1 to the expected for any individual calculation if expected would otherwise be zero. For "add_test_interval", each location in the baseline is increased by the number of cases in that location during the test interval. If "none", no adjustment is made.
numeric (default=1.0); this is the constant to be added
if baseline_adjustment == 'add_one' or baseline_adjustment ==
'add_one'
dd <- example_count_data[, max(date)]
generate_case_grids(
cases = example_count_data,
detect_date = dd
)
Run the code above in your browser using DataLab