createALERT: Producing the ALERT thresholds table

Description Usage Arguments Value Author(s) See Also Examples

View source: R/ALERT.R

Description

The createALERT function calculates the ALERT thresholds table given data and other parameters.

Usage

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

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.

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

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 (optional)

caseColumn

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

lastDate

a string in unambigous date format. All cases after this date will be removed prior to running the createALERT algorithm

Value

By utilizing the applyALERT function, createALERT uses prior hospital data to prospectively determine the start and end to a period of elevated influenza incidence in a community.

createALERT()$details creates a list of matrices. Each matrix contains raw statistics for the performance of a threshold for each flu season in data (these statistics can be found in applyALERT).

createALERT()$out produces a matrix summarizing the performance of different ALERT thresholds. The columns for this matrix are as follows:

threshold

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

median.dur

the median ALERT period duration in weeks

median.pct.cases.captured

across all seasons, the median percentage of all influenza cases contained within the ALERT period

min.pct.cases.captured

the minimum percentage of annual cases captured during the ALERT period in any season

max.pct.cases.captured

the maximum percentage of annual cases captured during the ALERT period in any season

pct.peaks.captured

the percentage of seasons in which the ALERT period contained the peak week

pct.ext.peaks.captured

the percentage of seasons in which the ALERT period contained the peak week +/- k weeks

median.low.weeks.incl

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

median.duration.diff

if target.pct specified, the median difference between the duration of the ALERT period in a season and the duration of the shortest period needed to capture target.pct of cases for that season

Author(s)

Nicholas G Reich and Stephen A Lauer

See Also

evalALERT cross-validates ALERT data over a rule

robustALERT cross-validates ALERT data over a series of rules

Examples

1
2
3
4
## Find the ALERT thresholds table for fluData over all thresholds
data(fluData)
x <- createALERT(data=fluData, allThresholds=TRUE, k=2, target.pct=0.85)
x$out

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