Learn R Programming

serocalculator (version 1.4.0)

stratify_data: Split data by stratum

Description

Split biomarker data, decay curve parameters, and noise parameters to prepare for stratified incidence estimation.

Usage

stratify_data(
  data,
  curve_params,
  noise_params,
  strata_varnames = "",
  curve_strata_varnames = NULL,
  noise_strata_varnames = NULL,
  antigen_isos = get_biomarker_levels(data)
)

Value

a "biomarker_data_and_params.list" object (a list with extra attributes "strata", "antigen_isos", etc)

Arguments

strata_varnames

character() vector of names of variables in data to stratify by

Examples

Run this code
if (FALSE) {
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

stratified_data =
  stratify_data(
   data = xs_data,
   curve_params = curve,
   noise_params = noise,
   strata_varnames = "catchment",
   curve_strata_varnames = NULL,
   noise_strata_varnames = NULL
   )
}

Run the code above in your browser using DataLab