Function will return a summary data frame of information related to a given count-by-location-and-date dataset, provided the user gives the count data, a set of locations, and the length of the baseline and test intervals, and and end date for the test interval. Note that a guard, a buffer between the end of the baseline interval and the test interval can be provided.
generate_summary_table(
data,
end_date = NULL,
locations = NULL,
baseline_length = 90,
test_length = 7,
guard = 0,
cut_vec = c(0, 1.5, 2.5, 5.5, 10.5, Inf),
cut_labels = c("Nr. Locs, daily mean 1 or less", "Nr. Locs, daily mean 2",
"Nr. Locs, daily mean 3-5", "Nr. Locs, daily mean 6-10", "Nr. Locs, daily mean >10")
)data frame of summary statistics
data frame with (at least) three columns: location, date, count
date indicating end of test interval; if not provided the last date in `dt` will be used
a vector of locations to subset the table; if none provided then all locations will be used
numeric (default=90) number of days in baseline interval
numeric (default=7) number of days in test interval
numeric (default=0) number of days between baseline and test interval
numeric vector of n cut points to examine categories of daily mean counts
character vector of labels for the n-1 categories created by `cut_vec`
generate_summary_table(
data = example_count_data
)
Run the code above in your browser using DataLab