Applies the six exclusion layers from the 2024 paper's outlier treatment to a SUBE comparison table or results summary. These are historical, paper-specific filters - not general-purpose data-quality rules.
Usage
filter_paper_outliers(
data,
variables = c("GO", "VA", "EMP", "CO2"),
apply_bounds = TRUE
)Arguments
- data
A tidy comparison table (the shape returned by
prepare_sube_comparison) or a SUBE results summary withCOUNTRY, YEAR, CPAagg, variable, measure, valuecolumns.- variables
Character vector subset of
c("GO", "VA", "EMP", "CO2")indicating which metrics to retain. Rows whosevariableis not in this set are dropped before the layered filters apply. Defaults to all four.- apply_bounds
Logical; whether to apply layer 5 (multiplier plausibility bounds). Defaults to
TRUE. SetFALSEto keep multiplier outliers in the output.
Details
The six layers:
Drop whole countries:
CAN,CYP.Drop country-year range:
BEL2000-2008; dropCO2rows withYEAR > 2009.Drop 38 country-product pairs across 14 countries (e.g.
LUXP04/P05/P06/...).Drop
CO2rows forCHE,HRV,NOR.Multiplier plausibility bounds (only when
apply_bounds = TRUE):GOin[1, 4],VAin[0, 1],EMP/CO2>= 0.Drop rows where elasticity is negative.
Examples
if (FALSE) { # \dontrun{
comp <- prepare_sube_comparison(leontief, models)
filt <- filter_paper_outliers(comp)
filt_no_bounds <- filter_paper_outliers(comp, apply_bounds = FALSE)
} # }