These helpers expose the Leontief matrices already computed by
compute_sube(), build comparison datasets that align Leontief and SUBE
estimates, and generate plots modeled on the archived paper workflow.
Usage
extract_leontief_matrices(
results,
matrix = c("A", "L"),
format = c("list", "long", "wide")
)
prepare_sube_comparison(
leontief,
models,
measure = c("multiplier", "elasticity"),
aggregate_years = TRUE,
variables = c("GO", "VA", "EMP", "CO2"),
apply_paper_filters = TRUE
)
plot_paper_comparison(
data,
kind = c("by_country", "by_product", "density"),
measure = c("multiplier", "elasticity"),
variables = c("GO", "VA", "EMP"),
type = NULL,
label_outliers = TRUE
)
plot_paper_regression(
data,
method = c("between", "pooled", "ols"),
measure = c("multiplier", "elasticity"),
variables = c("GO", "VA", "EMP"),
include_ci = TRUE
)
plot_paper_interval_ranges(
models,
by = c("country", "product"),
variables = c("GO", "VA", "EMP")
)Arguments
- results
A
sube_resultsobject returned bycompute_sube().- matrix
Which matrix to extract. One of
"A"or"L".- format
Output format. One of
"list","long", or"wide".- leontief
A
sube_resultsobject.- models
A
sube_modelsobject returned byestimate_elasticities().- measure
Which quantity to compare. One of
"multiplier"or"elasticity".- aggregate_years
Whether yearly Leontief and OLS results should be averaged over time as in the paper comparison tables.
- variables
Variables to include.
- apply_paper_filters
Whether to apply the 2024 paper exclusion rules.
- data
A tidy comparison table returned by
prepare_sube_comparison().- kind
Plot type:
"by_country","by_product", or"density".- type
Comparison types to plot. Defaults to all available types.
- label_outliers
Whether to annotate Tukey outliers.
- method
Model type to compare against Leontief in regression plots.
- include_ci
Whether to include the prediction interval ribbon.
- by
Orientation for interval range plots.
Value
extract_leontief_matrices() returns a list or data.table.
prepare_sube_comparison() returns a tidy data.table.
plot_paper_comparison(), plot_paper_regression(), and
plot_paper_interval_ranges() return named lists of ggplot objects.