load_tables_vectors function

Load the Input-Output and Final Demand Tables

Load the Input-Output and Final Demand Tables

This function loads the demand tables and creates all matrices and variables required for the GVC decompositions.

load_tables_vectors( iot, x, y, k, i, o = NULL, v = NULL, null_inventory = FALSE )

Arguments

  • iot: a Input Output Table object - a list with elements 'inter' (= x), 'final' (= y), 'output' (= o), 'countries' (= k) and 'industries' (= i) of class 'iot'. Alternatively these objects can be passed directly to the function, at least x, y, k and i need to be supplied.
  • x: intermediate demand table supplied as a numeric matrix of dimensions GN x GN (G = no. of country, N = no. of industries). Both rows and columns should be arranged first by country, then by industry (e.g. C1I1, C1I2, ..., C2I1, C2I2, ...) and should match (symmetry), such that rows and columns refer to the same country-industries.
  • y: final demand table supplied as a numeric matrix of dimensions GN x MN (M = no. of final demand categories recorded for each country). The rows of y need to match the rows of x, and the columns should also be arranged first by country, then by final demand category (e.g. C1FD1, C1FD2, ..., C2FD1, C2FD2, ...) with the order of the countries the same as in x.
  • k: character. A vector of country or region names of length G, arranged in the same order as they occur in the rows and columns of x, y.
  • i: character. A vector of country or region names of length N, arranged in the same order as they occur in the rows and columns of x and rows of y.
  • o: numeric. A vector of final outputs for each country-industry matching the rows of x and y. If not provided it will be computed as rowSums(x) + rowSums(y).
  • v: numeric. A vector of value added for each country-industry matching the columns of x. If not provided it will be computed as o - colSums(x).
  • null_inventory: logical. TRUE sets the inventory (last final demand category for each country) to zero.

Returns

A 'decompr' class object - a list with the following elements:

AmImported / Exported goods IO shares matrix ( x column-normalized by output o , with domestic entries set to 0).
BLeontief Inverse matrix (IA)1(I - A)^{-1} where AA is x column-normalized by output o .
BdDomestic part of Leontief Inverse matrix (inter-country elements of BB set to 0, needed for WWZ decomposition).
BmImported / Exported part of Leontief Inverse matrix (domestic elements of BB set to 0, needed for WWZ decomposition).
LDomestic economy Leontief Inverse matrix (IAd)1(I - Ad)^{-1} where AdAd is AA with all inter-country elements set to 0.
ETotal Exports (output of each country-industry servicing foreign production or foreign final demand).
ESRTotal Exports by destination country.
EintExports for intermediate production by destination country.
EfdExports for final demand by destination country.
VcValue added content of output ( v / o ).
GNumber of countries.
NNumber of industries.
GNNumber of country-industries.
kVector of country names.
iVector of industry names.
rownamUnique country-industry names identifying the rows / columns of x and rows of y.
XTotal Output ( = o ).
YTotal Final Demand by destination country.
YdDomestic Final Demand.
YmForeign Final Demand.

Details

Adapted from code by Fei Wang.

Examples

# Load example data data(leather) # Create intermediate object (class 'decompr') decompr_object <- load_tables_vectors(leather) # Examine the object str(decompr_object)

See Also

leontief, kww, wwz, decompr-package

Author(s)

Bastiaan Quast