Filter Profiles to Classes with Actual RR Estimates
Source:R/burden.R, R/yll.R
filter_profiles_to_rr_classes.RdAfter assign_rr_to_profiles(), some profiles may be resistant only to
antibiotic classes that have no RR estimate in the 7-centres LOS data (e.g.
a class present in the susceptibility dataset but not tested in the LOS
cohort). Those profiles receive fallback_rr = 1 and contribute zero
to the PAF numerator while their probability mass still enters the
denominator, silently distorting the estimate.
Drops profiles where every resistant class is absent from the RR table (they would receive fallback_rr = 1 and silently distort the PAF), then re-normalises the surviving profile probabilities to sum to 1.
Usage
filter_profiles_to_rr_classes(
profiles_with_rr,
rr_table,
pathogen_col = "pathogen",
class_col = "antibiotic_class",
probability_col = "probability",
fallback_rr = 1
)
filter_profiles_to_rr_classes(
profiles_with_rr,
rr_table,
pathogen_col = "pathogen",
class_col = "antibiotic_class",
probability_col = "probability",
fallback_rr = 1
)Arguments
- profiles_with_rr
Named list from
assign_rr_to_profiles().- rr_table
Data frame. Must have
pathogen_colandclass_col.- pathogen_col
Character. Default
"pathogen".- class_col
Character. Default
"antibiotic_class".- probability_col
Character. Default
"probability".- fallback_rr
Numeric. Default
1.