Count observations by stratum

Description

Count observations by stratum

Usage

count_strata(
  data,
  strata_varnames,
  biomarker_names_var = get_biomarker_names_var(data)
)

Arguments

data a “pop_data” object (e.g., from as_pop_data())
strata_varnames a vector of character strings matching colnames to stratify on from data
biomarker_names_var a character string indicating the column of data indicating which biomarker is being measured

Value

a tibble::tbl_df counting observations by stratum

Examples

Code
library("serocalculator")

sees_pop_data_pk_100 |> count_strata(strata_varnames = "catchment")
# A tibble: 2 × 3
  Stratum   catchment     n
  <chr>     <chr>     <int>
1 Stratum 1 aku          53
2 Stratum 2 kgh          47