| surv_prevalence_by | R Documentation |
Applies surv_lineage_prevalence() within subgroups defined by
a grouping variable. Analogous to survey::svyby() for stratified
survey analysis.
surv_prevalence_by(
design,
lineage,
by,
time = "epiweek",
method = "hajek",
conf_level = 0.95
)
design |
A |
lineage |
Character. Target lineage. |
by |
Character. Column name to group by (e.g., |
time |
Character. Time aggregation. Default |
method |
Character. Estimation method. Default |
conf_level |
Numeric. Default 0.95. |
A tibble with columns: group, time, lineage, prevalence, se, ci_lower, ci_upper, n_obs, effective_n.
surv_lineage_prevalence(), surv_filter()
sim <- surv_simulate(n_regions = 4, n_weeks = 10, seed = 1)
d <- surv_design(sim$sequences, ~ region,
sim$population[c("region", "seq_rate")],
sim$population, source_type = "source_type")
surv_prevalence_by(d, "BA.2.86", by = "region")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.