Create a data.frame with a constant baseline for an intercept only regression model.
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.
Usage
create_baseline(
ts_len,
intervention_start = NULL,
min_timepoints_baseline = 12,
past_weeks_not_included = 4
)
Arguments
- ts_len
integer, specifying the length of the time series.
- intervention_start
integer, default NULL, specifying the row number in the time series corresponding to an intervention date. When NULL no intervention is modeled.
- min_timepoints_baseline
integer, default 12, specifying the minimum number of time points required after the intervention to fit a new baseline.
- past_weeks_not_included
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`.