robustALERT: Cross-validating ALERT over a set of rules.

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ALERT.R

Description

The robustALERT function finds the optimal threshold for starting an ALERT season for a vector of rules. For each rule specified, evalALERT tests the rule against every flu season for the given data and outputs summary statistics. robustALERT aggregates these statistics together for easy comparison. This function can be used to validate the results from createALERT.

Usage

1
2
3
robustALERT(data, minPercent = NULL, maxDuration = NULL, firstMonth = 9,
  lag = 7, minWeeks = 8, allThresholds = FALSE, k = 0,
  target.pct = NULL, caseColumn = "Cases")

Arguments

data

the historical data to use in the analysis. A data.frame with a "Date" column (must be Date objects) and a "Cases" column.

minPercent

value or vector that specifies the minimum percent of cases to be captured at least 50% of the time by ALERT. This enables automated threshold selection.

maxDuration

value or vector that specifies the maximum number of weeks to be captured at least 50% of the time by ALERT. This enables automated threshold selection.

firstMonth

firstMonth month number which is counted as the first month of the 'flu year'

lag

lag time in days between date of cases and action taken

minWeeks

minimum number of weeks to be in ALERT

allThresholds

If TRUE, all integer threshold values between the 10th and 50th percentile are examined. If FALSE, only the 10th, 20th, 30th, 40th, and 50th percentiles are examined.

k

if not 0, the number of weeks around the peak to evaluate ALERT coverage for

target.pct

can specify the percentage of cases the user is targeting during the ALERT period when testing maxDuration (optional)

caseColumn

the name of the column with the case counts in it. Defaults to 'Cases'

Value

A table of the median threshold and ALERT results determined by each rule with evalALERT with the following columns:

rule

each rule that was specified by the user, either by minPercent or maxDuration

threshold

the median threshold number of cases needed to begin a sufficient ALERT period

duration

the median duration of the ALERT period

ALERT.cases

the median number of cases in the ALERT period

ALERT.cases.pct

the median fraction of cases in the ALERT period

peak.captured

the fraction of the time the peak was captured

peak.ext.captured

the fraction of the time the peak +/- k weeks was captured

low.weeks.incl

the mean number of weeks included in the ALERT period with counts less than threshold

duration.diff

if target.pct specified, the mean difference between the duration of the ALERT period and the duration of the shortest period needed to capture target.pct using postcastALERT.

Author(s)

Nicholas G Reich and Stephen A Lauer

See Also

createALERT

Examples

1
2
3
## view the performance of ALERT over three levels of minimum case percentage and maximum duration length
data(fluData)
robustALERT(minPercent=c(.8, .85, .9), maxDuration=c(12, 13, 14), data=fluData, k=2, target.pct=0.85)

reichlab/ALERT documentation built on Jan. 8, 2020, 7:26 p.m.