All functions |
|
---|---|
Add missing isoweeks to an aggregated dataframe of case counts by year and week |
|
Age Group Format Check |
|
Creates age grouping variable for a given data set |
|
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 |
|
List Available Signal Detection Algorithms |
|
Create an Empty DataTable with a Custom Message |
|
Builds the aggregated signal detection results table with different formating options. |
|
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". |
|
Helper function to check for presence of age variable or instead age_group |
|
Helper to check that values of a character variable are in given levels |
|
check whether there is a completely empty row in provided surveillance data |
|
Varible names which should be checked for missing values |
|
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 presence of mandatory variables in surveillance data |
|
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 |
|
Check whether the region and corresponding region_id columns only have one region name per ID |
|
Checking type and values of the age_group column |
|
Checking type of case_id, duplication or missing case_id |
|
Checking type and values of date variables date variable can be of type character or date |
|
Checking those mandatory variables which are present in the data for their type |
|
Checking correct type and value of optional variables which are present in the data |
|
Checking type and values of variables which should have yes,no,unknown values |
|
Complete Age Group Array |
|
Conjure Filename |
|
Convert specified columns to integer type |
|
Turns aggregated data into surveillance's sts format |
|
Creation of age_group levels from different formats of the age_group column |
|
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. |
|
Create a data.frame with a constant baseline for an intercept only regression model. |
|
Create a factor out of the stratum column with transforming NA to unknown |
|
Create a data.frame with 10 seasgroups components for harmonic modeling. |
|
Create a model formula based on the columns in the model_data dataframe. |
|
Decider for creating a map or a table based on whether all NUTS_ids are found in the shapefile |
|
Create Model Data for Generalized Linear Modeling |
|
Create a data.frame with sine and cosine components for harmonic modeling. |
|
Create a data.frame with variable time trend for regression modeling. |
|
Wrapper around the algo.cusum_with_reset Copied from the code of the surveillance package and adapted for algo.cusum_with_reset |
|
Decider function whether create_map_or_table or create_barplot_or_table is used |
|
Filter Data Frame by Date Range |
|
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. |
|
Finds correct age interval for given age |
|
Format the signal results to an interactive or static table |
|
Checking for duplicates in case_id |
|
Establish a Database Connection (Example Implementation) |
|
Retrieve a Configuration Value from DATA_CONFIG |
|
Retrieveing which columns in the dataset only contain missing values |
|
Get the numeric columns that are not integer columns |
|
Get row number of aggregated data which is the isoweek and isoyear corresponding to the date given |
|
Get isoweek and isoyear from a given date |
|
retrieve 'case_id's which have missing values in computationally crucial variables |
|
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 Possible GLM Methods Based on Available Data |
|
Function to extract corresponding region to the region_id variable |
|
Function to get the region_id variable names from the region variables |
|
Get Shapefile: Read from Config or Use Internal Dataset |
|
Get Signals |
|
Automated and Early Detection of Disease Outbreaks |
|
Get signals of CUSUM algorithm with reset |
|
Get signals of surveillance's EARS algorithm |
|
Get signals of surveillance's farringtonFlexible algorithm |
|
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 Signals Stratified |
|
retrieve variables which are in provided in surveillance linelist but are not used in the tool |
|
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. |
|
Example input data |
|
Input metadata |
|
Create a Date from ISO Year and Week |
|
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. |
|
checking YYYYY-mm-dd format of date variables |
|
detailed check of date variables check that months are numbers between 01-12 and days are from 01-31 |
|
checking the format of the last/biggest age group to follow the format digit separator digit, digit+ or >digit |
|
Load Data from Database (Example Implementation) |
|
NUTS-Regions |
|
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 |
|
Plot age-groups grouped by another variable |
|
Barplot visualising the number of cases and information about any signals |
|
Plot number of cases with number of signals by region |
|
Plot time-series based on the results of a signal detection algorithm, being alarms, threshold and expectation |
|
Prepares aggregated signals of one category for producing a table. |
|
Prepare the signal detection results for creation of table with results |
|
Preprocessing of linelist surveillance data with or without outbreak_ids |
|
Query Database (Example Implementation) |
|
Read csv files which can have seperators ; or , |
|
Read csv or excel files Checks the input file for its type and then reads the file |
|
Variable names of the region_id variables including those which do not necessarily follow NUTS format |
|
Variable names of the region_id variables including those which do not necessarily follow NUTS format |
|
Removing columns from data which only contain missing values |
|
Run the Shiny Application |
|
Renders signal detection report |
|
Save signals |
|
Allowed levels for sex in preprocessed surveillance data used for all calculations |
|
Allowed levels for sex in raw surveillance data |
|
Transform Data to Required Format (Example Implementation) |
|
Allowed levels for variables with yes, no, unknown levels in preprocessed surveillance data used for calculations |
|
Allowed levels for variables with yes, no, unknown levels in raw surveillance data |
|
Variable names of the variables which have yes, no , unknown levels |