evalALERT: Cross-validating ALERT output under a rule

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ALERT.R

Description

The evalALERT function uses the ALERT algorithm to test a rule (either minPercent or maxDuration) on hospital influenza data. For each season in the dataset, createALERT finds an optimal ALERT threshold when leaving that year out. Then applyALERT tests that threshold in that year. The metrics are saved and summarized.

Usage

1
2
3
evalALERT(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

specify the minimum percent of cases to be captured at least 50% of the time by ALERT. This enables automated threshold selection.

maxDuration

specify the maximum number of weeks to be captured at least 50% of the time by ALERT. This enables automated threshold selection.

firstMonth

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

lag

lag time between report date 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

the number of weeks around the peak to evaluate ALERT coverage for

target.pct

the percentage of cases the user is targeting during the ALERT period when

caseColumn

the name of the column with the case counts in it. Defaults to 'Cases' testing maxDuration (optional)

Value

Returns a table with the following columns:

season

each flu season in the data that was able to be evaluated for the given rule, with the final row reserved for summary statistics

threshold

the minimum threshold number of cases needed to begin the ALERT period

tot.cases

total number of cases for the season

duration

duration of the ALERT period

ALERT.cases

total number of cases in the ALERT period

ALERT.cases.pct

fraction of cases in the ALERT period

peak.captured

1 if peak was captured, 0 otherwise

peak.ext.captured

1 if peak +/- k weeks captured, 0 otherwise

low.weeks.incl

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

duration.diff

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

Each row in the table represents a season from the data. The final row outputs summary statistics: the median of threshold, tot.cases, duration, ALERT.cases, and ALERT.cases.pct and the mean of peak.captured, peak.ext.captured, low.weeks.incl, and duration.diff.

Author(s)

Nicholas G Reich and Stephen A Lauer

See Also

robustALERT cross-validates ALERT output under a set of rules

Examples

1
2
3
4
5
6
## find the highest threshold captures at least 85% half of the time
data(fluData)
evalALERT(minPercent=.85, data=fluData, k=2)

## find the lowest threshold that has a median duration of less than 12 weeks
evalALERT(maxDuration=12, data=fluData, k=2)

nickreich/ALERT documentation built on Jan. 8, 2020, 5:25 p.m.