fluglm: fluglm: Generate fitted prediction values with generalized...

Description Usage Arguments Value References Examples

Description

Similar to serflm, but allows for more specifications.

Usage

1
2
3
4
fluglm(data=NULL, outc=NULL, season, viral, 
              time=NULL, period=52, echo=F, poly=T, 
              model_form='none', int_type="ci", alpha=0.05, offset,
              glmnb=F, ...)

Arguments

data

A dataframe class object, must contain time variable, epidemic indicator, and measure of influenza morbidity

outc

an unquoted name of a column in data which corresponds to the outcome variable of interest

season

Either 'T', where the epidemic baseline model will be created assuming time variable is a date, and Oct-May is epidemic season, or the name of a column which is a logical vector flagging a given week as epidemic or not

viral

a string vector naming 1 or more viral specimens

time

an unquoted name of a column in data object, must be a numeric/integer class variable in dataframe which corresponds to a unit of time, must be unique (i.e. non-repeating)

period

a numeric vector indicating period length, i.e. 52 weeks in year

echo

A logical, if T will print variables used in model.

poly

A logical, if T will include a quadratic, cubic, quartic and quintic term.

model_form

An object of type formula, allowing for user-specified model to be passed on to glm(). Default missing.

int_type

Specifies type of upper interval to be output, currently only allows for confidence intervals. Prediction intervals to be added, but are only approximate for Poisson families.

alpha

The threshold for CI interval, default is 0.05 (one-sided).

offset

Specify if offset term to be used, must specify log(object)

glmnb

Logical, if True will run a negative binomial model using MASS::nb.glm

...

other options passed on to glm model (e.g. family=poisson, see ?glm)

Value

an object of class data.frame, fit, upper and lower confidence bounds

References

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

Examples

1
2
3
4
5
require(flumodelr)
fludta <- flumodelr::fludta
flu_fit <- fluglm(fludta, outc = fludeaths, time = week_in_order, season=epi)  
              
head(flu_fit)

kmcconeghy/flumodelr documentation built on June 7, 2019, 8:47 p.m.