create_baseline.Rd
This function generates a baseline data.frame for use in modeling, which can account for different baselines before and after an intervention. If no intervention is done (intervention_start = NULL) NULL is returned as the regression can just use ~1 in the formula.
create_baseline(
ts_len,
intervention_start = NULL,
min_timepoints_baseline = 12,
past_weeks_not_included = 4
)
integer, specifying the length of the time series.
integer, default NULL, specifying the row number in the time series corresponding to an intervention date. When NULL no intervention is modeled.
integer, default 12, specifying the minimum number of time points required after the intervention to fit a new baseline.
An integer specifying the number of past weeks to exclude from the fitting process. This can be useful for excluding recent data with outbreaks or data that may not be fully reported. Default is `4`.
NULL when intervention_start = NULL, otherwise a data frame with a column representing the baseline before and after the intervention (if applicable).
A data frame with columns representing the time trend before and after the intervention (if applicable).
if (FALSE) {
create_baseline(100)
create_baseline(100, intervention_start = 50)
}