::opts_chunk$set( knitrcollapse = TRUE, comment = "#>" )library(iotables) require(dplyr); require(tidyr)
The Germany example is used to test the code of the package. It follows the examples in Eurostat Manual of Supply, Use and Input-Output Tables. by Joerg Beutel (Eurostat Manual).
germany_1990 dataset is a simplified 6x6 sized SIOT taken from the Eurostat Manual (page 481). It is brought to a long form similar to the Eurostat bulk files. The testthat infrastructure of the iotables package is checking data processing functions and analytical calculations against these published results.
The following data processing functions select and order the data from the Eurostat-type bulk file. Since the first version of this package, Eurostat moved all SIOT data products to the ESA2010 vocabulary, but the manual still follows the ESA95 vocabulary. The labels of the dataset were slightly changed to match the current metadata names. The changes are minor and self-evident, the comparison of the
germany_1990 dataset and the Manual should cause no misunderstandings.
<- iotable_get( labelling = "iotables" ) data_table <- input_flow_get ( input_flow data_table = data_table, households = FALSE) <- primary_input_get ( data_table, "output" ) de_output print (de_output[c(1:4)]) #> iotables_row agriculture_group industry_group construction #> 15 output 43910 1079446 245606
This vignette uses
library(tidyverse), more particularly
tidyr, just like all analytical functions of
iotables. Even if you do not use
tidyverse, this packages will be installed together with
iotables. These functions are only used in the vignette to print the output, and they are not essential for the examples.
The input coefficient matrix shows what happens in the whole domestic economy when an industry is facing additional demand, increases production. In the Germany example, all results are rounded to 4 digits for easier comparison with the Eurostat manual.
The input coefficients for domestic intermediates are defined on page 486. You can check the following results against Table 15.8 of the Eurostat manual. (Only the top-right corner of the resulting input coefficient matrix is printed for readability.)
input_coefficient_matrix_create() function relies on the following equation. The numbering of the equations is the numbering of the Eurostat Manual.
It checks the correct ordering of columns, and furthermore it fills up 0 values with 0.000001 to avoid division with zero.
<- input_coefficient_matrix_create( de_input_coeff data_table = data_table, digits = 4) #> Warning: `funs()` was deprecated in dplyr 0.8.0. #> Please use a list of either functions or lambdas: #> #> # Simple named list: #> list(mean = mean, median = median) #> #> # Auto named with `tibble::lst()`: #> tibble::lst(mean, median) #> #> # Using lambdas #> list(~ mean(., trim = .2), ~ median(., na.rm = TRUE)) ## which is equivalent to: <- coefficient_matrix_create( data_table, de_input_coeff total = "output", return_part = "products", households = FALSE, digits = 4) print ( de_input_coeff[1:3, 1:3]) #> iotables_row agriculture_group industry_group #> 1 agriculture_group 0.0258 0.0236 #> 2 industry_group 0.1806 0.2822 #> 3 construction 0.0097 0.0068
Similarly, the output coefficient matrix is the following:
#> iotables_row agriculture_group industry_group #> 1 agriculture_group 0.0258 0.5803 #> 2 industry_group 0.0073 0.2822 #> 3 construction 0.0017 0.0299
These results can be checked on page 468 in the Manual.
The Leontieff matrix is derived from Leontieff equation system.
The Leontieff matrix is defined as and it is created with the
The Leontieff inverse is and it is created with the
leontieff_inverse_create() function from the Leontieff-matrix.
<- leontieff_matrix_create ( technology_coefficients_matrix = L_de de_input_coeff )<- leontieff_inverse_create(de_input_coeff) I_de <- leontieff_inverse_create(de_input_coeff, digits = 4) I_de_4 print (I_de_4[,1:3]) #> iotables_row agriculture_group industry_group #> 1 industry_group 1.4155 0.5605 #> 2 construction 0.0441 1.0462 #> 3 trade_group 0.2180 0.2292 #> 4 business_services_group 0.2892 0.3237 #> 5 other_services_group 0.1089 0.1014 #> 6 total 1.1152 1.3025
You can check the Leontieff matrix against Table 15.9 on page 487 of the Euorstat manual, and the Leontieff inverse against Table 15.10 on page 488. The ordering of the industries is different in the manual.
Technical indicators assume constant returns to scale and fixed relationship of all inputs to each industry. With these conditions the technical input coefficients show how much input products, labour or capital is required to produce a unit of industry output.
The helper function
primary_input_get() selects a row from the SIOT and brings it to a conforming form. The
input_indicator_create() creates the vector of technical input coefficients.
<- primary_input_get ( data_table, de_emp primary_input = "employment_domestic_total" ) <- input_indicator_create ( de_emp_indicator data_table = data_table, input_vector = "employment_domestic_total") print ( tidyr::gather( de_emp_indicator, indicators, values, !!2:ncol(de_emp_indicator))[,-1] ) #> indicators values #> 1 agriculture_group 0.024960146 #> 2 industry_group 0.007764168 #> 3 construction 0.013175574 #> 4 trade_group 0.017129483 #> 5 business_services_group 0.006148852 #> 6 other_services_group 0.020054311
Often we want to analyze the effect of growing domestic demand on some natural units, such as employment or \(CO_2\) emissions. The only difficulty is that we need data that is aggregated / disaggregated precisely with the same industry breakup as our SIOT table.
European employment statistics have greater detail than our tables, so employment statistics must be aggregated to conform the 60 (61, 62) columns of the SIOT. There is a difference in the columns based on how national statistics offices treat imputed real estate income and household production, and trade margins. Czech SIOTs are smaller than most SIOTs because they do not have these columns and rows.
In another vignette we will show examples on how to work with these real-life data. For the sake of following the calculations, we are continuing with the simplified 1990 German data.
The input coefficients for value added are created with
<- primary_input_get ( data_table, de_gva primary_input = "gva") <- input_indicator_create( de_gva_indicator data_table = data_table, input_vector = "gva") print( tidyr::gather(de_gva_indicator, indicators, values,!!2:ncol(de_gva_indicator))[,-1] ) #> indicators values #> 1 agriculture_group 0.4933728 #> 2 industry_group 0.3659488 #> 3 construction 0.4707703 #> 4 trade_group 0.5766124 #> 5 business_services_group 0.5999044 #> 6 other_services_group 0.7172413
This is equal to the equation on page 495 of the Eurostat Manual. The results above can be checked on the bottom of page 498.
You can create a matrix of input indicators, or direct effects on (final) demand with
direct_supply_effects_create(). The function by default creates input requirements for final demand. With the code below it re-creates the Table 15.14 of the Eurostat manual.
<- coefficient_matrix_create( direct_effects_de data_table = data_table, total = 'output', return_part = 'primary_inputs') ::kable ( direct_effects_de[1:6,1:4])knitr
The ‘total’ row above is labelled as Domestic goods and services in the Eurostat Manual. The table can be found on p498.
The SIOTs contain (with various breakups) three types of income:
Employee wages, which is usually a proxy for all household income.
Gross operating surplus, which is a form of corporate sector income.
Taxes that are the income of government.
These together make gross value added (GVA). If you are working with SIOTs that use basic prices, then GVA = GDP at producers’ prices, or basic prices.
The GVA multiplier shows the additional gross value created in the economy if demand for the industry products is growing with unity. The wage multiplier (not shown here) shows the increase in household income.
The following equation is used to work with different income effects and multipliers:
B = vector of input coefficients for wages or GVA or taxes.
Z = direct and indirect requirements for wages (or other income)
The indicator shows that manufacturing has the lowest, and other services has the highest gross value added component. This is hardly surprising, because manufacturing needs a lot of materials and imported components. When the demand for manufacturing in the domestic economy is growing by 1 unit, the gross value added is 0.3659488.
You can check these values against the Table 15.16 of the Eurostat Manual on page 501 (row 10).
You can recreate the whole matrix, when the data data permits, with
input_multipliers_create() as shown here. Alternatively, you can create your own custom multipliers with
multiplier_create() as shown in the following example.
<- coefficient_matrix_create( input_reqr data_table = iotable_get (), total = 'output', return_part = 'primary_inputs') <- input_multipliers_create( multipliers input_requirements = input_reqr, inverse = I_de) ::kable(multipliers, digits= 4)knitr
You can check these results against the Table 15.16 on p501 of the Eurostat manual. the label ‘total’ refers to domestic intermediaries. The ordering of the rows is different from the Manual.
These multipliers are Type-I multipliers. The type-I GVA multiplier shows the total effect in the domestic economy. The initial extra demand creates new orders in the backward linking industries, offers new product to build on in the forward-linking industry and creates new corporate and employee income that can be spent. Type-II multipliers will be introduced in a forthcoming vignette [not yet available.]
The E matrix contains the input coefficients for labor (created by
input_indicator_create()). The following matrix equation defines the employment multipliers.
multiplier_create() function performs the matrix multiplication, after handling many exceptions and problems with real-life data, such as different missing columns and rows in the national variations of the standard European table.
Please send a bug report on Github if you run into further real-life problems.
<- input_indicator_create ( de_emp_indicator data_table = data_table, input = 'employment_domestic_total') <- multiplier_create ( employment_multipliers input_vector = de_emp_indicator, Im = I_de, multiplier_name = "employment_multiplier", digits = 4 ) print (tidyr::gather(employment_multipliers, multipliers, values, !!2:ncol(employment_multipliers))[-1]) #> multipliers values #> 1 agriculture_group 0.0665 #> 2 industry_group 0.0574 #> 3 construction 0.0625 #> 4 trade_group 0.0548 #> 5 business_services_group 0.0423 #> 6 other_services_group 0.0431
You can check against page 501 that these values are correct and on page 501 that the highest employment multiplier is indeed \(z_i\) = 0.0665, the employment multiplier of agriculture.
For working with real-life, current employment data, there is a helper function to retrieve and process Eurostat employment statistics to a SIOT-conforming vector
employment_get(). This function will be explained in a separate vignette.
Output multipliers and
forward linkages are calculated with the help of output coefficients for product as defined on p486 and p495 of the the Eurostat Manual. The Eurostat Manual uses the definition of output at basic prices to define output coefficients which is no longer part of SNA as of SNA2010.
\(x_i\): output of sector i
<- input_coefficient_matrix_create( de_input_coeff data_table = iotable_get(), digits = 4) <- output_multiplier_create ( output_multipliers input_coefficient_matrix = de_input_coeff ) ::kable ( knitr::gather(output_multipliers, multipliers, values)[-1,] tidyr )
These multipliers can be checked against the Table 15.15 on p500 of the Eurostat Manual.