Learn R Programming

seroincidence (version 2.0.0)

estimateSeroincidence: Estimate Seroincidence

Description

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

Usage

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

Run this code
# NOT RUN {
# }
# 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())
# }
# NOT RUN {
# }

Run the code above in your browser using DataLab