View source: R/polynomial_models.R
farrington_model | R Documentation |
Refers to section 6.1.2.
farrington_model(
age,
start,
pos = NULL,
tot = NULL,
status = NULL,
fixed = list()
)
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. |
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 |
[stats::glm()] for more information on the fitted glm object
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)
)
plot(model)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.