Takes the per-patient YLL data produced by daly_calc_yll_associated()
(which already contains life_expectancy, death_weight, and
yll_contribution) and multiplies by the mortality PAF from
daly_calc_paf_mortality() to produce AMR-attributable YLL.
Usage
daly_calc_yll_attributable(
yll_patient_data,
paf_mort,
pathogen_col,
patient_col,
age_bin_col,
sex_col = ".sex_norm",
resistance_profile_col = NULL,
profile_col = "profile",
facility_col = NULL,
syndrome_col = NULL,
stratify_by = NULL
)Arguments
- yll_patient_data
Data frame: the
patient_dataelement fromdaly_calc_yll_associated(), withlife_expectancy,death_weight, andyll_contributioncolumns.- paf_mort
Named list returned by
daly_calc_paf_mortality().- pathogen_col
Character. Pathogen column.
- patient_col
Character. Patient identifier column.
- age_bin_col
Character. Age bin column.
- sex_col
Character. Normalised sex column. Default
".sex_norm".- resistance_profile_col
Character or
NULL. Column holding the resistance profile identifier per patient row. When supplied, per-profile PAF is applied instead of a scalar PAF_k. DefaultNULL.- profile_col
Character. Profile identifier column in the
paf_mortper-profile data frames. Default"profile".- facility_col
Character or
NULL. Facility identifier column. When supplied results include aby_facilitybreakdown. DefaultNULL.- syndrome_col
Character or
NULL. Syndrome column.- stratify_by
Character vector or
NULL. Additional columns to aggregate results by. DefaultNULL.
Value
A list:
- total
Scalar: total AMR-attributable YLL.
- per_pathogen
One row per pathogen:
pathogen_col,n_patients,YLL_associated_k,PAF_k_mort,YLL_attributable_k.- by_age_sex
YLL attributable stratified by age_bin x sex.
- by_pathogen_age_sex
YLL attributable by pathogen x age_bin x sex.
- by_facility
Per-facility breakdown (when
facility_colsupplied).- by_syndrome
Per-syndrome breakdown (when
syndrome_colsupplied).- by_syndrome_pathogen
Per-syndrome x pathogen (when
syndrome_colsupplied).- stratified
User-defined stratification (when
stratify_bysupplied).- patient_data
Patient-level data augmented with
PAF_kdandYLL_attributable_contribution.
Details
Two PAF modes:
- PAF_k scalar mode (default)
When
resistance_profile_colisNULL, the overall mortality PAF per pathogen k (PAF_k_mort) frompaf_mortis used as a scalar multiplier.- Per-profile mode
When
resistance_profile_colis supplied, each patient row is matched to its resistance profile delta and the profile-specificPAF_mortalityis applied. Patients whose profile does not appear inpaf_mortreceiveNAand a warning is issued.
$$\text{YLL}^{\text{attr}}_{i,k} = \text{yll\_contribution}_{i,k} \times \text{PAF}_{k(,\delta)}$$
Examples
if (FALSE) { # \dontrun{
yll_assoc <- daly_calc_yll_associated(data = cohort, ...)
mort_or <- fit_mortality_rr_logistic(data = rr_data, ...)
profiles_or <- assign_rr_to_profiles(profiles_out,
rr_table = mort_or,
rr_col = "OR_death"
)
paf_mort <- daly_calc_paf_mortality(profiles_or)
yll_attr <- daly_calc_yll_attributable(
yll_patient_data = yll_assoc$patient_data,
paf_mort = paf_mort,
pathogen_col = "organism_name",
patient_col = "PatientInformation_id",
age_bin_col = "Age_bin",
sex_col = ".sex_norm",
facility_col = "center_name",
syndrome_col = "infectious_syndrome",
stratify_by = c("location", "infectious_syndrome")
)
} # }