Aggregates case data (linelist, i.e. one row per case) by isoyear and isoweek and adds missing isoweeks to the aggregated dataset. Additionally number of cases part of a known outbreak is added if the variable outbreak_status exists in the data.
Aggregate cases and signals over the number of weeks. First the signals are filtered to obtain the signals for the last n weeks aggregating the number of cases observed, create variable any signal generated and the aggregate the number of signals
Implementation of the CUSUM algorithm retrieved from the surveillance package and adapted so that after a signal was triggered the cusum is set to 0 Parameters are inherited from surveillance algo.cusum
Builds the signal detection results table with different formating options. To get the raw data.frame containing method ald number_of_weeks as well use format = "data.frame", to obtain nicely formated tables in an interactive DataTable or as Flextable use format = "DataTable" or format = "Flextable".
checking mandatory variables in the surveillance data check if mandatory variables are present in the data check if they have the correct type and correct values
Checking whether raw surveillance linelist fulfills requirements to the data specified in the SOP Checking presence and correct type of mandatory variables Checking type and values of optional variables
Decider function to create barplot or table of aggregated cases with signals Depending on the number of unique levels to visualise it is decided whether a barplot or a table is shown. The aggregated number of cases for each stratum and whether any signal are shown.
Filter the data so that only the data of the last n weeks are returned This function can be used to filter for those last n weeks where signals were generated.
Function to retrieve name from named vector given its value Can be used to retrieve the "pretty" names to show to the user and in the background work with the values
Get signals based on a weigthed GLM quasipoisson regression model for the expected case counts The GLM is flexible being able to just fit a mean, add a time trend, fit a harmonic sin/cos model or the seasons from the farringtonflexible.
Get a default and minimum and maximum date for the intervention time point for the glm algorithms with pandemic correction. This is based on the data provided and the settings for the delays.
checking age_group column only containing digits, separators and <,>,+ For the first age_group using seperator, i.e. 00-05, <5 is allowed. For the last age group using seperators, i.e. 95-100, >100 and 100+ is allowed. Separators like - (dash), _ (underscore), and — (em dash) are also allowed for intermediate age ranges.
Extend the computed threshold and expectation of the signal detection method to the past for visualisation purposes but not for signal generation Inside the function it is computed what the maximum number of timepoints is the signal detection algorithms can be applied for. This depends on the algorithm and the amount of historic data. The already generated signals dataframe is then extended with the expectation and threshold into the past