General function wrapper to perform a variety of forecasted models. The output will always be a set of fitted values.
flum(data=NULL, model=NULL, ...)
data | A dataframe class object, must contain time variable, epidemic indicator, and measure of influenza morbidity |
---|---|
model | A character of length 1, indicates which model to fit. Options include "ird" (see ?ird), "serflm" (see ?serflm), "fluglm", "flunb", "arima" (see ?flurima). |
... | Extra arguments depending on model requested, see examples and vignettes. |
an object of class data.frame, with fitted values, threshold if applicable, and computed excess morbidity
Thompson WW1, Weintraub E, Dhankhar P, Cheng PY, Brammer L, Meltzer MI, Bresee JS, Shay DK. Estimates of US influenza-associated deaths made using four different methods. Influenza Other Respir Viruses. 2009 Jan;3(1):37-49. /urlhttps://www.ncbi.nlm.nih.gov/pubmed/19453440
require(flumodelr) fludta <- flumodelr::fludta flu_fit <- flum(fludta, model="fluserf", outc = fludeaths, time = yrweek_dt) head(flu_fit)#> # A tibble: 6 x 12 #> year week fludeaths alldeaths perc_fludeaths yrweek_dt fluyr prop_flupos #> <int> <int> <int> <int> <dbl> <date> <int> <dbl> #> 1 1962 1 646 13033 4.96 1961-12-31 1961 NA #> 2 1962 2 663 13238 5.01 1962-01-07 1961 NA #> 3 1962 3 701 13324 5.26 1962-01-14 1961 NA #> 4 1962 4 646 13241 4.88 1962-01-21 1961 NA #> 5 1962 5 614 13044 4.71 1962-01-28 1961 NA #> 6 1962 6 609 13163 4.63 1962-02-04 1961 NA #> # ... with 4 more variables: week_in_order <int>, epi <lgl>, y0 <dbl>, #> # y0_ul <dbl>