Description Usage Arguments Value Examples
The response for an observed data point at time t
is defined as the mean of observed values on
days t + s
through t + e
(inclusive) multiplied by e - s
, where s
and e
are the number
of days from forecast_date
to the start and end, respectively, of the next full
incidence_period
. We choose to take the mean and multiply by the incidence period length
rather than simply sum the observed values in order to avoid treating missing values as 0.
1 2 3 4 5 6 7 | add_response_columns(
signals,
response_name,
forecast_date,
incidence_period,
ahead
)
|
signals |
Wide data frame of signals. We expect the following columns:
|
response_name |
Name of response signal. The value of the response variable on a single
day should be located in column |
forecast_date |
Date on which the forecast will be made |
incidence_period |
Time period over which the response should be summed. |
ahead |
integer or vector of integer ahead values |
Data frame of signals equal to signals
with length(ahead)
additional columns with
names response+{a}:{response_name}
corresponding to the response variable at ahead a
.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | ## Not run:
add_response_columns(
tibble(
geo_value = "mi"
time_value = seq.Date(as.Date("2020-07-01"), as.Date("2020-07-14"), "day"),
`value+0:sig` = 1:14
),
"sig",
as.Date("2020-07-15"),
"epiweek",
1:2
)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.