estimateSeroincidence: Estimate Seroincidence

Description Usage Arguments Value Examples

View source: R/estimateSeroincidence.R

Description

Function to estimate seroincidences based on cross-section serology data and longitudinal response model.

Usage

1
2
estimateSeroincidence(data, antibodies, strata = "", params, censorLimits,
  par0, start = -6, numCores = 1L)

Arguments

data

Data frame with cross-sectional serology data per antibody and age, and additional columns to identify possible strata.

antibodies

Character vector with one or more antibody names. Values must match data.

strata

Character vector of strata. Values must match with data. Default = "".

params

List of data frames of all longitudinal parameters. Each data frame contains Monte Carlo samples for each antibody type.

censorLimits

List of cutoffs for one or more named antibody types (corresponding to data).

par0

List of parameters for the (lognormal) distribution of antibody concentrations for true seronegatives (i.e. those who never seroconverted), by named antibody type (corresponding to data).

start

A starting value for log(lambda). Value of -6 corresponds roughly to 1 day (log(1/365.25)), -4 corresponds roughly to 1 week (log(7 / 365.25)). Default = -6.

numCores

Number of processor cores to use for calculations when computing by strata. If set to more than 1 and package parallel is available, then the computations are executed in parallel. Default = 1L.

Value

A set of lambda estimates for each strata.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
## Not run: 
estimateSeroincidence(data = csData,
                      antibodies = c("IgG", "IgM", "IgA"),
                      strata = "",
                      params = campylobacterDelftParams4,
                      censorLimits = cutOffs,
                      par0 = baseLn,
                      start = -4)

estimateSeroincidence(data = csData,
                      antibodies = c("IgG", "IgM", "IgA"),
                      strata = "",
                      params = campylobacterDelftParams4,
                      censorLimits = cutOffs,
                      par0 = baseLn,
                      start = -4,
                      numCores = parallel::detectCores())

## End(Not run)

seroincidence documentation built on May 2, 2019, 7 a.m.