Computes epidemiological proportion, defined as the relative fraction of cases attributable to specific pathogen(s) or strain(s) at a given time point, calculated as the ratio of incidence from selected pathogen(s) to a reference group: $$P_t = \frac{I_{\text{numerator}}(t)}{I_{\text{denominator}}(t)}$$
Arguments
- fitted_model
Fitted model object with class
EpiStrainDynamics.fitwithmultipleorsubtypedpathogen structure.- numerator_combination
Named pathogens or subtypes to be included in proportion numerator, or NULL. If NULL, it will use each pathogen.
- denominator_combination
Named pathogens or subtypes to be included in proportion denominator, or NULL. If NULL, it will use all pathogens.
- ...
Additional arguments passed to metrics calculation
Value
named list of class EpiStrainDynamics.metric containing a dataframe
of the calculated metric outcome ($measure), the fit object ($fit), the
constructed model object ($constructed_model), the resolved pathogen names
used as the numerator ($numerator_combination), and the resolved pathogen
names used as the denominator ($denominator_combination). When
numerator_combination is left as the default (NULL), every pathogen name
is listed in $numerator_combination, but each was computed as its own
separate proportion line (one per pathogen), not summed into a single group
the way $denominator_combination always is. The measure data frame
contains the median of the epidemiological quantity (y), the 50% credible
interval of the quantity (lb_50 & ub_50), the 95% credible interval
(lb_95 & ub_95), the proportion greater than a defined threshold value
(prop), the pathogen name (pathogen), and the time label (time).
Details
Where incidences are derived from the exponential of log-incidence estimates: $$P_t = \frac{\sum_{i \in \text{numerator}} \exp(\log\text{-incidence}_{i,t})}{\sum_{j \in \text{denominator}} \exp(\log\text{-incidence}_{j,t})}$$
Where the numerator and denominator are each a user-specified set of
pathogens or subtypes (via numerator_combination/denominator_combination),
and \(i\), \(j\) index the pathogens included in each.
This metric quantifies the relative contribution of specific pathogen(s) or strain(s) to the total disease burden. Key characteristics:
Values between 0 and 1 (\(0 \leq P_t \leq 1\)) when denominator includes numerator components
Values can exceed 1 (\(P_t > 1\)) when denominator excludes numerator components
Represents the fractional share of cases at each time point
Time-varying to capture changing pathogen/strain dynamics
Flexible combinations:
Individual proportions: Each pathogen relative to all pathogens (default)
Custom numerator: Specific pathogen(s) of interest (e.g., variant of concern)
Custom denominator: Either 'all' pathogens or a specified subset
Subset comparisons: Compare specific groups (e.g., Alpha vs. Delta + Omicron)
This metric function can be run directly on the fitted model output.
See also
Other metrics:
Rt(),
growth_rate(),
incidence()
Examples
if (FALSE) { # interactive()
mod <- construct_model(
pathogen_structure = multiple(
case_timeseries = sarscov2$cases,
time = sarscov2$date,
component_pathogen_timeseries = list(
alpha = sarscov2$alpha,
delta = sarscov2$delta,
omicron = sarscov2$omicron,
other = sarscov2$other
)
),
method = p_spline()
)
fit <- fit_model(mod)
prop <- proportion(fit)
# or a unique combination, compared to all pathogens
prop2 <- proportion(fit,
numerator_combination = c("alpha", "delta", "omicron")
)
# or a user-specified combination in both numerator and denominator
prop3 <- proportion(fit,
numerator_combination = "alpha",
denominator_combination = c("alpha", "delta", "omicron")
)
}
