Description Usage Arguments Value See Also Examples
View source: R/internal_functions.R
Build algo object from an sts object class using either FarringtonFlexible or GLRNB surveillance algorithm
1 | algoSD(x.sts, algo = "FarringtonFlexible", timeUnit = "Month", testingPeriod = 5)
|
x.sts |
sts class object (see |
algo |
character string containing the name of the algorithm to use. Options are "FarringtonFlexible" (default) or "GLRNB". |
timeUnit |
character string for the time unit of the time series. Options are "Week" or "Month". |
testingPeriod |
numeric: number of time units (months, weeks) back in time to test the algorithm on (to detect outbreaks in) |
sts
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 | #-- Setting the parameters to run the report for
input <- list(
disease = "Salmonellosis",
country = "EU-EEA - complete series",
indicator = "Reported cases",
stratification = "Confirmed cases",
unit = "Month",
daterange = c("2010-01-01", "2016-12-31"),
algo = "FarringtonFlexible",
testingperiod = 5
)
#-- Example dataset
dataset <- EpiSignalDetection::SignalData
#-- Filtering on declared input parameters
dataset <- filterAtlasExport(dataset, input)
#-- Aggregating the data by geographical level and time point
dataset <- aggAtlasExport(dataset, input)
#-- Bulding the corresponding sts object
dataset.sts <- stsSD(observedCases = dataset$NumValue,
studyPeriod = dataset$StudyPeriod,
timeUnit = input$unit,
startYM = c(as.numeric(format(as.Date(input$daterange[1], "%Y-%m-%d"), "%Y")),
as.numeric(format(as.Date(input$daterange[1], "%Y-%m-%d"), "%m"))))
#-- Building the corresponding algo object
dataset.algo <- algoSD(dataset.sts,
algo = input$algo,
timeUnit = input$unit,
testingPeriod =
input$testingperiod)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.