Refers to section 7.1. and 7.2.
Arguments
- age
the age vector.
- 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).
- kern
Weight function, default = "tcub". Other choices are "rect", "trwt", "tria", "epan", "bisq" and "gauss". Choices may be restricted when derivatives are required; e.g. for confidence bands and some bandwidth selectors.
- nn
Nearest neighbor component of the smoothing parameter. Default value is 0.7, unless either h is provided, in which case the default is 0.
- h
The constant component of the smoothing parameter. Default: 0.
- deg
Degree of polynomial to use. Default: 2.
Value
a list of class lp_model with 6 items
- datatype
type of datatype used for model fitting (aggregated or linelisting)
- df
the dataframe used for fitting the model
- pi
fitted locfit object for pi
- eta
fitted locfit object for eta
- sp
seroprevalence
- foi
force of infection
Examples
df <- mumps_uk_1986_1987
model <- lp_model(
df$age, pos = df$pos, tot = df$tot,
nn=0.7, kern="tcub"
)
plot(model)