Skip to contents

Refers to section 6.1.2.

Usage

farrington_model(
  age,
  start,
  pos = NULL,
  tot = NULL,
  status = NULL,
  fixed = list()
)

Arguments

age

the age vector.

start

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

pos

the positive count vector (optional if status is provided).

tot

the total count vector (optional if status is provided).

status

the serostatus vector (optional if pos & tot are provided).

fixed

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

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

See also

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

Examples

df <- rubella_uk_1986_1987
model <- farrington_model(
  df$age, pos = df$pos, tot = df$tot,
  start=list(alpha=0.07,beta=0.1,gamma=0.03)
  )
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
#> Warning: NaNs produced
plot(model)
#> Warning: No shared levels found between `names(values)` of the manual scale and the
#> data's fill values.