Learn R Programming

serocalculator (version 1.4.0)

summary.seroincidence.by: Summary Method for "seroincidence.by" Objects

Description

Calculate seroincidence from output of the seroincidence calculator est_seroincidence_by().

Usage

# S3 method for seroincidence.by
summary(
  object,
  confidence_level = 0.95,
  show_deviance = TRUE,
  show_convergence = TRUE,
  verbose = FALSE,
  ...
)

Value

A summary.seroincidence.by object, which is a tibble::tibble, with the following columns:

  • incidence.rate maximum likelihood estimate of lambda (seroincidence)

  • CI.lwr lower confidence bound for lambda

  • CI.upr upper confidence bound for lambda

  • Deviance (included if show_deviance = TRUE) Negative log likelihood (NLL) at estimated (maximum likelihood) lambda)

  • nlm.convergence.code (included if show_convergence = TRUE) Convergence information returned by stats::nlm()

The object also has the following metadata (accessible through base::attr()):

  • antigen_isos Character vector with names of input antigen isotypes used in est_seroincidence_by()

  • Strata Character with names of strata used in est_seroincidence_by()

Arguments

object

A dataframe containing output of est_seroincidence_by().

confidence_level

desired confidence interval coverage probability

show_deviance

Logical flag (FALSE/TRUE) for reporting deviance (-2*log(likelihood) at estimated seroincidence. Default = TRUE.

show_convergence

Logical flag (FALSE/TRUE) for reporting convergence (see help for optim() for details). Default = FALSE.

verbose

a logical scalar indicating whether to print verbose messages to the console

...

Additional arguments affecting the summary produced.

Examples

Run this code
library(dplyr)

xs_data <-
  sees_pop_data_pk_100

curve <-
  typhoid_curves_nostrat_100 |>
  filter(antigen_iso %in% c("HlyE_IgA", "HlyE_IgG"))

noise <-
  example_noise_params_pk

# estimate seroincidence
est2 <- est_seroincidence_by(
  strata = c("catchment"),
  pop_data = xs_data,
  sr_params = curve,
  noise_params = noise,
  antigen_isos = c("HlyE_IgG", "HlyE_IgA"),
  # num_cores = 8 # Allow for parallel processing to decrease run time
)

# calculate summary statistics for the seroincidence object
summary(est2)

Run the code above in your browser using DataLab