# Understanding the data

# Intro

In many cases, users of this package will want to use the outputs of the analyses for further processing, such as additional analyses or making visualizations based on the design guide of their own organisation. To facilitate such additional use cases, but also simplify interpretation of the outputs generated with this package, this data dictionary documents each type of output table in detail, focusing on data types and definitions.

This article is structured based on the output tables generated by `pacta.multi.loanbook` and follows the standard flow of the user experience as much as possible, so it can be read in the same sequence as the analysis is run.

# Tables

The main steps that generate output tables are:

- Diagnostics and coverage
- Standard PACTA analysis
- Aggregated PACTA metrics

## Diagnostics

The diagnostics section is split into determining the match success rate of the loan books analysed and inspecting the real economy activity related to the financing made by the banks through the matched loan books. The former is influenced by the quality of the input loan book data and the completeness of the reference production data against which the loan books are matched. The latter, while it depends on a solid match success rate, is mainly driven by the financing decisions and the portfolio allocation made by the banks. If a sector split is applied to the loan book, any companies that are lost in the process are documented for every loan book.

### Match success rate

    dplyr::filter(data_dictionary, .data[["dataset"]] == "lbk_match_success_rate")

### Loan book coverage

    dplyr::filter(data_dictionary, .data[["dataset"]] == "summary_statistics_loanbook_coverage")

### Companies lost in sector split

    dplyr::filter(data_dictionary, .data[["dataset"]] == "lost_companies_sector_split")

## Standard PACTA analysis

The standard PACTA analysis is run across all input banking books, but produces the same output metrics as known from the `r2dii.*` packages. Results are given at portfolio level grouped by banking book. Beyond the standard output format, tables are provided that can be used as input for visualizations, for each of the standard sectors and technologies.

### Target Market Share results (all groups)

Target market share results at the portfolio level for each included banking book

    dplyr::filter(data_dictionary, .data[["dataset"]] == "tms_results")

### Sectoral Decarbonization Approach results (all groups)

SDA results at the portfolio level for each included banking book

    dplyr::filter(data_dictionary, .data[["dataset"]] == "sda_results")

### Data tech mix

Results for a given portfolio and sector, tailored to be used in the tech mix chart

    dplyr::filter(data_dictionary, .data[["dataset"]] == "data_tech_mix")

### Data trajectory

Results for a given portfolio, sector and technology, tailored to be used in the volume trajectory chart

    dplyr::filter(data_dictionary, .data[["dataset"]] == "data_trajectory")

### Data emission intensity

Results for a given portfolio and sector, tailored to be used in the emission intensity chart

    dplyr::filter(data_dictionary, .data[["dataset"]] == "data_emission_intensity")

### Companies included

Lists all companies including exposures, that were analysed for the given loan book and that are therefore included in the data to be visualized.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "companies_included")

## Aggregated PACTA metrics

The aggregated PACTA metrics are also run across all input banking books. The calculations produce the net aggregate alignment metric, which is defined in the vignettes “Calculation of a company alignment metric” and “Calculation of exposure-weighted aggregated alignment metric” and allows producing the corresponding plots. Results are grouped at the level defined by the `by_group` parameter.

### Company technology deviation

For each company in the analyzed banking books, shows the deviation of the technology build-out in the final year of the analysis from the corresponding allocated scenario value. This is an intermediate result that is further processed in the calculation of the net aggregate alignment metric. Only available for sectors, which have technology level calculations using the target market share, namely `automotive, coal, oil and gas, power`.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "company_technology_deviation_tms")

### Company net alignment metric for TMS sectors

For each company in the analyzed banking books, shows the net aggregate alignment metric for sectors, which have technology level calculations using the target market share, namely `automotive, coal, oil and gas, power`. See `vignette("company_alignment_metric")` for methodological documentation.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "company_alignment_net_tms")

### Disaggregated company buildout/phaseout alignment metric for TMS sectors

For each company in the analyzed banking books, shows the aggregate alignment metric - disaggregated into its buildout and phaseout components - for sectors, which have technology level calculations using the target market share, namely `automotive, coal, oil and gas, power`. See `vignette("company_alignment_metric")` for methodological documentation.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "company_alignment_bo_po_tms")

### Company net alignment metric for SDA sectors

For each company in the analyzed banking books, shows the net aggregate alignment metric for sectors, which have sector level calculations using the sectoral decarbonization approach (SDA), namely `aviation, cement, steel`. See `vignette("company_alignment_metric")` for methodological documentation.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "company_alignment_net_sda")

### Company net aggregate alignment metric with financial exposures

For each company in the analyzed banking books, shows the net aggregate alignment metric for all available sectors. This table includes the financial exposure to each of the analyzed parts of the banking books, split as defined in `by_group`.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "company_exposure_net_aggregate_alignment")

### Disaggregated company buildout/phaseout alignment metric with financial exposures

For each company in the analyzed banking books, shows the net aggregate alignment metric - disaggregated by its buildout and phaseout components - for all sectors that use technology level TMS calculations, namely `automotive, coal, oil and gas, power`. This table includes the financial exposure to each of the analyzed parts of the banking books, split as defined in `by_group`. Note that the financial exposure is not disaggregated, the alignment metric is.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "company_exposure_bo_po_aggregate_alignment")

### Loan book net aggregate alignment metric with financial exposures

For each loan book level group (split as defined in `by_group`), shows the net aggregate alignment metric for all available sectors. This table includes the financial exposure to each of the analyzed parts of the banking books. Company level results are aggregated to the loan book level, using their relative financial exposure as weights.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "loanbook_exposure_net_aggregate_alignment")

### Disaggregated loan book buildout/phaseout alignment metric with financial exposures

For each loan book level group (split as defined in `by_group`), shows the net aggregate alignment metric - disaggregated by its buildout and phaseout components - for all sectors using technology level TMS calculations, namely `automotive, coal, oil and gas, power`. Company level results are aggregated to the loan book level, using their relative financial exposure as weights.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "loanbook_exposure_bo_po_aggregate_alignment")

### Input data for Sankey plot

Data set meant to be used as input into `plot_sankey()`.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "data_sankey")

### Input data for alignment-by-exposure scatter plot

Data set meant to be used as input into `plot_scatter_alignment_exposure()`.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "data_scatter_alignment_exposure")

### Input data for buildout/phaseout scatter plot

Data set meant to be used as input into `plot_scatter()`.

    dplyr::filter(data_dictionary, .data[["dataset"]] == "data_scatter_sector")