Performs the standard data preparation steps:
Remove specified location IDs (e.g., 533 for Melanesia aggregate)
Standardize measure names (shorten verbose GBD names)
Filter to specified countries using location_type metadata
Filter to specified age categories
Filter to Rate metric and reshape to wide format
Usage
qci_clean(
data,
loc_types = NULL,
keep_types = "Country",
age_categories = "Age-standardized",
exclude_location_ids = 533L
)Arguments
- data
A data.frame or data.table of raw GBD data (output of
qci_load()).- loc_types
A data.frame of location metadata. If
NULL, uses the bundled location_type dataset.- keep_types
Character vector of location types to retain. Default
"Country". UseNULLto skip location type filtering.- age_categories
Character vector of age groups to include. Default
"Age-standardized".- exclude_location_ids
Integer vector of location_ids to exclude. Default
533.
Value
A list with two data.table elements:
- wide_rate
Wide-format data for Rate metric, used for the final merged output.
- wide_number
Wide-format data used for ratio/PCA computation. Uses Rate data (ratios of rates equal ratios of numbers).
Each has columns like val_Deaths, val_Incidence, upper_Deaths,
lower_Deaths, etc.