create_truth: Creates observed truth to score entry against

Description Usage Arguments Value Examples

View source: R/create_truth.R

Description

Determines observed true values for each target

Usage

1
2
create_truth(fluview = TRUE, year = NULL, weekILI = NULL,
  challenge = "ilinet", start_wk = NULL, end_wk = NULL)

Arguments

fluview

A logical value (default TRUE) indicating whether to download ILINet from Fluview.

year

Calendar year during which the flu season of interest begins. For the 2015/2016 flu season, year = 2015. Required whether downloading data from fluview or providing observed data

weekILI

A data.frame of observed values (default NULL). Must be NULL when downloading data using fluview = TRUE. Required if fluview = FALSE.

For challege = "ilinet" or challenge = "state_ili", must contain columns location, week, and wILI. For challenge = "hospital", must contain columns age_grp, week, and weeklyrate.

challenge

one of "ilinet", "hospital" or "state_ili", indicating which challenge the submission is for (default "ilinet")

start_wk

MMWR week that defines the start of the challenge. Default value provided for years greater than 2014 that aligns with start week of CDC challenge. Otherwise defaults to MMWR week 42 for challenge == "ilinet" and challenge == "state", or MMWR week 48 for challenge == "hospital"

end_wk

MMWR week that defines the end of the challenge. Default value provided for years greater than 2014 that aligns with end week of CDC challenge. Otherwise defaults to MMWR week 18 for challenge == "ilinet" and challenge == "state", or MMWR week 17 for challenge == "hospital"

Value

A data.frame with columns location, target, and bin_start_incl or columns age_grp, target, and bin_start_incl if challenge = "hospital"

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
truth <- create_truth(year = 2015)
truth <- create_truth(fluview = TRUE, year = 2015, challenge = "ilinet")
truth <- create_truth(fluview = FALSE, weekILI = valid_ILI)
truth <- create_truth(fluview = TRUE, year = 2015, challenge = "hospital")

## Not run: 
truth <- create_truth(weekILI = valid_ILI)
truth <- create_truth(fluview = FALSE)

## End(Not run)

jarad/FluSight documentation built on Oct. 24, 2020, 9:58 p.m.