View source: R/forecasting_practical.R
linear_regression | R Documentation |
linear_regression
takes the incidence data (already subsetted for
country and year) and performs linear regression.
We also specify the "current week" and how many previous weeks' worth of data
to use.
linear_regression(
incidence_data,
current_week = 47,
n_weeks_prior = 4,
log_transform = TRUE
)
incidence_data |
data frame extracted by |
current_week |
numeric vector of length 1: week number of the current week |
n_weeks_prior |
numeric vector of length 1: number of weeks' previous data to use |
log_transform |
logical vector of length 1: if TRUE, perform linear regression on log transformed data, otherwise perform linear regression on original data |
linear regression object (see documentation for lm
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.