Learn R Programming

serosv (version 1.1.0)

farrington_model: The Farrington (1990) model.

Description

Refers to section 6.1.2.

Usage

farrington_model(data, start, fixed = list())

Value

a list of class farrington_model with 5 items

datatype

type of datatype used for model fitting (aggregated or linelisting)

df

the dataframe used for fitting the model

info

fitted "glm" object

sp

seroprevalence

foi

force of infection

Arguments

data

the input data frame, must either have `age`, `pos`, `tot` columns (for aggregated data) OR `age`, `status` for (linelisting data)

start

Named list of vectors or single vector. Initial values for optimizer.

fixed

Named list of vectors or single vector. Parameter values to keep fixed during optimization.

See Also

[stats::glm()] for more information on the fitted glm object

Examples

Run this code
df <- rubella_uk_1986_1987
model <- farrington_model(
  df,
  start=list(alpha=0.07,beta=0.1,gamma=0.03)
  )
plot(model)

Run the code above in your browser using DataLab