Learn R Programming

decompr (version 6.4.0)

decomp: Interface Function for Decompositions

Description

This function loads an ICIO table and runs a specified decomposition. It provides a compact interface for quick analysis.

Usage

decomp(
  iot,
  x,
  y,
  k,
  i,
  o = NULL,
  v = NULL,
  method = c("leontief", "kww", "wwz"),
  ...
)

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).

method

character. The decomposition method, either "leontief", "kww" or "wwz".

further arguments passed to leontief, kww or wwz.

Value

Depends on the decomposition, see leontief, kww or wwz.

Details

For more detailed analysis with multiple decompositions consider using load_tables_vectors to create a 'decompr' class object and then run the decomposition functions leontief, kww and wwz on the object.

References

Timmer, Marcel P. (ed) (2012), "The World Input-Output Database (WIOD): Contents Sources and Methods", WIOD Working Paper Number 10, downloadable at http://www.wiod.org/publications/papers/wiod10.pdf

Wang, Zhi, Shang-Jin Wei, and Kunfu Zhu (2013). Quantifying international production sharing at the bilateral and sector levels. No. w19677. National Bureau of Economic Research.

See Also

decompr-package

Examples

Run this code
# NOT RUN {
# Load leather example data
data(leather)

# Explore the data
str(leather)

## Decomposing gross exports:

# Perform the Leontief decomposition
decomp(leather, method = "leontief")

# Perform the KWW decomposition
decomp(leather, method = "kww")

# Perform the WWZ decomposition
decomp(leather, method = "wwz")

# }

Run the code above in your browser using DataLab