Selects a single resistance class per event using beta-lactam hierarchy and relative risk (RR) values. Prevents double-counting in burden estimation by choosing the most clinically relevant resistant class.
Usage
select_resistance_class(
data,
event_col = "event_id",
class_col = "antibiotic_class",
susceptibility_col = "antibiotic_value",
rr_col = "rr_value",
hierarchy = NULL,
filter_resistant = TRUE
)Arguments
- data
Data frame with resistance and RR information
- event_col
Character. Event ID column. Default "event_id".
- class_col
Character. Antibiotic class column. Default "antibiotic_class".
- susceptibility_col
Character. Susceptibility column. Default "antibiotic_value".
- rr_col
Character. RR value column. Default "rr_value". If missing, only hierarchy is used.
- hierarchy
Named numeric vector. Custom hierarchy (class name -> rank). If NULL, uses default from get_beta_lactam_hierarchy().
- filter_resistant
Logical. If TRUE, only consider resistant (R) classes. Default TRUE.