-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathiotables-vignettes.txt
More file actions
1746 lines (1311 loc) · 69.5 KB
/
Copy pathiotables-vignettes.txt
File metadata and controls
1746 lines (1311 loc) · 69.5 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
---
title: "Environmental Impacts"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Environmental Impacts}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
---
```{r setupknitr, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
load(system.file(
file.path("extdata", "environmental_impact_vignette.rda"),
package = "iotables"
))
```
```{r setup, echo=FALSE, message=FALSE}
library(iotables)
library(dplyr, quietly = TRUE)
library(tidyr, quietly = TRUE)
```
In this example, we show which economic activities contribute most to greenhouse gas emissions in Belgium. We want to know how much an additional unit of production increases the CO₂-equivalent of various greenhouse gases, including methane (CH₄), nitrous oxide (N₂O), and fluorinated gases (e.g., chlorofluorocarbons, hydrochlorofluorocarbons, and halons).
While CO₂ is emitted in the greatest quantity, it is not the only culprit for global warming, and fluorinated gases have a particularly high potential to increase the greenhouse effect; therefore, in this example, we will work with the combined CO₂-equivalent effect of all greenhouse gases, abbreviated with `GHG`.
## Importing the data
The following expression will import the symmetric input-output table for Belgium (product-by-product, ESA 2010 transmission `naio_10_cp1700`). The \`stk_flow = "TOTAL"\`\`makes clear that we are not only considering effects in the domestic (Belgian) economy, but imports, too, because TOTAL covers both domestic and imported intermediate and final uses (ESA 2010 code TOTAL = DOM + IMP)
More about importing and working with matrices can be found in the articles ([Introduction to iotables](https://iotables.dataobservatory.eu/articles/intro.html), [Working with Eurostat Data](https://iotables.dataobservatory.eu/articles/working_with_eurostat.html).)
```{r getiotable, eval=FALSE}
# For faster building this data can be loaded from "../extdata/environmental_impact_vignette.rda"
BE <- iotable_get(
source = "naio_10_cp1700",
geo = "BE",
year = 2020,
labelling = "short",
unit = "MIO_EUR",
stk_flow = "TOTAL"
)
```
The following expression gets the the greenhouse gas emissions in CO₂ CO₂ equivalent thousand tons for Belgium in 2020. Under the hood, we download the air emissions accounts from the Eurostat data warehouse. Air Emissions Accounts (AEA), an official satellite account compiled according to the SEEA-CF (*System of Environmental-Economic Accounting 2012: Central Framework*), present data on air emissions in a way that is fully compatible with the concepts, principles and data of the national accounts, but needs further adjustment to input-output tables, which is accomplished by `airpol_get()`
```{r getairpol, eval=FALSE}
# For faster building this data has been loaded from "../extdata/environmental_impact_vignette.rda"
ghg <- airpol_get(
airpol = "GHG",
geo = "BE",
year = 2020,
unit = "THS_T"
)
```
See `?airpol_get` for the type of air pollutants that you can add to a European standard SIOT. In this case, we will first use the calculated CO₂-equivalent of mix of gases. We are calculating in thousands of tons in this case (`unit="THS_T"`).
Because we work with the `naio_10_cp1700` matrix, which is derived from product x product sources, the industry names of the SIOT start with `CPA`.
```{r siotnames}
names(BE)[1:3]
```
The AEA uses NACE Rev. 2 (industry basis):
```{r ghgnames}
names(ghg)[1:3]
```
The following utility will adjust the supplementary data. This corresponds to the bridge matrix (B) defined in Eurostat Manual §15.4.2 that is used to transform industry-based extensions to product-based form.
You do not need to make this step if you work with `naio_10_cp1750` SIOT data, which is estimated from industry x industry sources, and it uses NACE-like abbreviations.
```{r convertocpa}
ghg_prod <- convert_industry_to_product(ghg)
names(ghg_prod)[1:3]
```
## Direct and multiplied effects
The direct effects will show how many thousand tons of extra greenhouse gases will be emitted per million euros of output at basic prices (t CO₂-eq / million €) from Belgium's industries. We are adding with `supplementary_add()`—which wraps `rows_add()`—the greenhouse gas vector in a conforming form to inter-industry matrix of Belgium. We will only print the top five emitters.
```{r ghgindicators}
be_io <- BE %>%
supplementary_add(ghg_prod)
ghg_indicator <- input_indicator_create(
data_table = be_io,
input_row = "GHG_emission"
)
```
The greenhouse gas intensity indicator (direct emissions per unit of output):
```{r ghgindicator}
# Only the top 5 is printed, rename, arrange and top_n are tidyverse functions:
ghg_indicator %>%
vector_transpose_longer(.keep = TRUE) %>%
rename(GHG_emission_indicator = .data$value) %>%
arrange(-.data$GHG_emission_indicator) %>%
top_n(5)
```
In Belgium (based on the 2020 structure of the economy and considering 2020 emission levels) the most greenhouse gas intensive sectors are the usual suspects, but with a bit surprising top emitter.
| NACE code | Activity |
|:----------------------------|:-----------------------------------------:|
| A03 | Fishing and aquaculture |
| A01 | Crop and animal production, hunting and related service activities |
| H51 | Air transport |
| C23 | Manufacture of other non-metallic mineral products |
| D | Electricity, gas, steam and air conditioning supply |
This indicator shows only the direct greenhouse-gas emissions (CO₂, CH₄, N₂O and fluorinated gases) generated by each economic activity itself. It does not yet include the indirect emissions that occur along the value chain — the upstream supplier industries that provide intermediate inputs (backward linkages) or the downstream users that purchase and transform the outputs (forward linkages).
To capture the full environmental impact of final demand, these indirect effects are estimated using the Leontief inverse, which traces how additional demand for one product propagates through all interconnected industries.
The category *Manufacture of other non-metallic mineral products* requires some clarification. It covers a range of activities transforming mined or quarried non-metallic minerals — such as sand, gravel, stone, clay and refractory materials — by grinding, mixing, cutting, shaping or firing them into products for intermediate or final use. In practice, these are largely construction-related materials, so this sector reflects the environmental footprint of the building-products supply chain.
Let's make a reality check, and calculate only with CO₂:
```{r getco2indicators, eval=FALSE}
co2 <- airpol_get(
airpol = "CO2",
geo = "BE",
year = 2020,
unit = "THS_T"
)
```
```{r co2indicators}
be_io_c <- BE %>%
supplementary_add(
co2 %>% convert_industry_to_product()
)
co2_indicator <- input_indicator_create(
data_table = be_io_c,
input_row = "CO2_emission"
)
# Only the top 5 is printed:
co2_indicator %>%
vector_transpose_longer(.keep = TRUE) %>%
rename(CO2_emission_indicator = .data$value) %>%
arrange(-.data$CO2_emission_indicator) %>%
top_n(5)
```
*Crop and animal production, hunting and related service activities* falls out, and *CPA_H50 Water transport* comes back. Are those barges really so clean? And what happened with the agriculture?
Let's check methane, which is a far more potent green house gas than CO₂.
```{r getmethaneindicators, eval=FALSE}
methane <- airpol_get(
airpol = "CH4",
geo = "BE",
year = 2020,
unit = "THS_T"
)
```
```{r methaneindicators}
be_io_m <- BE %>%
supplementary_add(
methane %>% convert_industry_to_product()
)
methane_indicator <- input_indicator_create(
data_table = be_io_m,
input_row = "CH4_emission"
)
# Only the top 5 is printed:
methane_indicator %>%
vector_transpose_longer(.keep = TRUE) %>%
rename(CH4_emission_indicator = .data$value) %>%
arrange(-.data$CH4_emission_indicator) %>%
top_n(5)
```
| NACE code | Activity |
|:----------------------------|:-----------------------------------------:|
| A01 | Crop and animal production, hunting and related service activities |
| E37-39 | Sewerage, waste management, remediation activities |
| D | Electricity, gas, steam and air conditioning supply |
| B | Mining and quarrying |
| A02 | Forestry and logging |
The appearance of *Mining and quarrying* is important, because it is the main input for the *Manufacture of other non-metallic mineral products*. Their effect may or may not be combined *in Belgium*, because the Belgian manufacturers can import mined or quarried products, too.
## Total effects
The multiplier considers these indirect effects, too. The top five polluters remain the same, but their ordering changes. *Crop and animal production, hunting and related service activities* goes ahead of *Fishing and aquaculture*---because methane is a more potent green house gas than CO₂. Cattle and sheep emit plenty of methane, and there are plenty of cattle and sheep in Belgium. The reason why it is important to consider these effects for each and every country, or, when possible, for regions, is that different countries produce different crops and animals. Producing poultry is far less problematic from a green house emission point of view than producing beef products.
As expected, the *Manufacture of other non-metallic mineral products* gets ahead of *Air transport* as it is highly interrelated with *Mining and quarrying*. Making building more sustainable would be a great achievement, but there is no really clear path: as we can see, *Forestry and logging* come with their problems, too.
```{r ghgmultiplier, message=FALSE, eval=FALSE}
I_be <- input_coefficient_matrix_create(
data_table = BE,
digits = 4
) %>%
leontief_inverse_create()
ghg_multipliers <- multiplier_create(
input_vector = ghg_indicator,
Im = I_be,
multiplier_name = "GHG_multiplier",
digits = 4
)
# Only the top 5 is printed:
ghg_multipliers %>%
vector_transpose_longer(.keep = TRUE) %>%
rename(GHG_multiplier = .data$value) %>%
arrange(-.data$GHG_multiplier) %>%
top_n(5)
```
## Validation Summary
All analytical and extension functions used in this vignette were validated against the official numerical examples published in **Beutel (2008)**, *Eurostat Manual of Supply, Use and Input–Output Tables* (Luxembourg: Office for Official Publications of the European Communities).\
The table below lists the correspondence between each function and the reference table reproduced during package testing.
```{r validation, results='asis'}
cat(knitr::kable(
data.frame(
Function = c(
"input_coefficient_matrix_create()",
"leontief_matrix_create()",
"leontief_inverse_create()",
"supplementary_add()",
"input_indicator_create()",
"multiplier_create()"
),
Concept = c(
"Direct requirements (A)",
"Leontief matrix (I − A)",
"Total requirements (L = (I − A)⁻¹)",
"Environmental extension (CO₂, CH₄)",
"Input indicators (GVA, Compensation)",
"Total multipliers (GVA, Employment)"
),
Table = c("15.6", "15.9", "15.10", "15.13", "15.14", "15.16"),
Page = c("485", "487", "488", "494", "498", "503–504")
),
caption = "Cross-reference of package functions with Eurostat Manual (Beutel 2008)"
))
```
All functions were numerically cross-checked against the corresponding Eurostat tables within rounding tolerance (\< 1e-3), confirming that the `iotables` analytical pipeline—\
**A → (I − A) → L → extensions → indicators → multipliers**—\
faithfully reproduces the canonical Eurostat and UN SNA 2010 results.
```{r savevignettedata, eval=FALSE}
save(methane, co2, ghg, BE,
file = here::here(
"inst", "extdata", "environmental_impact_vignette.rda"
)
)
```
---
title: "Introduction to iotables"
author: "Daniel Antal, based on the work of Jorg Beutel"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Introduction to iotables}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r setupknitr, include=FALSE, message=FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup, message=FALSE}
library(iotables)
library(dplyr, quietly = T)
library(tidyr, quietly = T)
```
This introduction shows the reproducible workflow of iotables with the examples of the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0). by Joerg Beutel (*Eurostat Manual*).
This vignette uses `library(tidyverse)`, more particularly `dplyr` and `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.
## Germany sample files
The `germany_1995` dataset is a simplified 6x6 sized SIOT taken from the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0) (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_1995` dataset and the Manual should cause no misunderstandings.
```{r iotables}
germany_io <- iotable_get(labelling = "iotables")
input_flow <- input_flow_get(
data_table = germany_io,
households = FALSE
)
de_output <- primary_input_get(germany_io, "output")
print(de_output[c(1:4)])
```
The `input_flow()` function selects the first quadrant, often called the input flow matrix, or inter-industry matrix, from the German input-output table. The `primary_input_get()` selects one of the primary inputs, in this case, the output from the table.
## Direct effects
The input coefficient matrix shows what happens in the whole domestic economy when an industry is facing additional demand, and it 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 in the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0) 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.)
\deqn{sum_{i=1}^n X_i}
The `input_coefficient_matrix_create()` function relies on the following equation. The numbering of the equations is the numbering of the *Eurostat Manual*.
(9) \deqn{a_{ij} = X_{ij} / x_{j}}{a_ij = X_ij / x_j} [recap: (43) is the same, and the same equation is (2) on page 484 with comparative results]
It checks the correct ordering of columns, and furthermore it fills up 0 values with 0.000001 to avoid division with zero.
```{r inputcoeff, echo=TRUE}
de_input_coeff <- input_coefficient_matrix_create(
data_table = germany_io,
digits = 4
)
## which is equivalent to:
de_input_coeff <- coefficient_matrix_create(
data_table = germany_io,
total = "output",
return_part = "products",
households = FALSE,
digits = 4
)
print(de_input_coeff[1:3, 1:3])
```
These results are identical after similar rounding to the Table 15.6 of the Manual (on page 485.)
Similarly, the output coefficient matrix is defined in the following way:
(5) \eqn{o_{ij}} = \eqn{x_{ij} / x_{i}}
\eqn{o_{ij}} = output coefficient for domestic goods and services (i = 1, ..., 6; j = 1, ..., 6)
\eqn{x_{ij}= flow of commodity i to sector j
\eqn{x_{i} = output of sector i
```{r outputcoeff, echo=FALSE}
de_out <- output_coefficient_matrix_create(
data_table = germany_io,
total = "tfu",
digits = 4
)
# Rounding is slightly different in the Eurostat manual:
print(de_out[1:3, 1:3])
```
These results are identical after similar rounding to the Table 15.7 of the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0) on page 485. The diagonal values are the same in the input coefficient matrix and the output coefficient matrix.
The Leontief matrix is derived from Leontief equation system.
(19) \eqn{(I-A)x = y}
The Leontief matrix is defined as \eqn{(I-A)} and it is created with the `leontief_matrix_create()` function.
The Leontief inverse is \eqn{(I-A)^{-1}} and it is created with the `leontief_inverse_create()` function from the Leontief-matrix.
```{r leontief}
L_de <- leontief_matrix_create(
technology_coefficients_matrix = de_input_coeff
)
I_de <- leontief_inverse_create(de_input_coeff)
I_de_4 <- leontief_inverse_create(
technology_coefficients_matrix = de_input_coeff,
digits = 4
)
print(I_de_4[, 1:3])
```
*You can check the Leontief matrix against Table 15.9 on page 487 of the* Eurostat Manual, *and the Leontief inverse against Table 15.10 on page 488. The ordering of the industries is different in the manual.*
## Creating indicators
### Creating technical indicators
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.
(60) $a_{ij}$ = $z_{ij}$ / $x_j$ [technical input coefficients]
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.
```{r employment_indicator}
de_emp <- primary_input_get(germany_io,
primary_input = "employment_domestic_total"
)
de_emp_indicator <- input_indicator_create(
data_table = germany_io,
input_row = "employment_domestic_total"
)
vector_transpose_longer(de_emp_indicator)
```
Often we want to analyse 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 or 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.
### Creating income indicators
The input coefficients for value added are created with `input_indicator_create()`.
```{r gva_indicator}
de_gva <- primary_input_get(germany_io,
primary_input = "gva"
)
de_gva_indicator <- input_indicator_create(
data_table = germany_io,
input_row = "gva"
)
vector_transpose_longer(de_gva_indicator)
```
This is equal to the equation on page 495 of the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0). The results above can be checked on the bottom of page 498.
(44) $w_{ij}$ = $W_{j}$ / $x_j$ [input coefficients for value added]
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*.
```{r input_indicator}
direct_effects_de <- coefficient_matrix_create(
data_table = germany_io,
total = "output",
return_part = "primary_inputs"
)
direct_effects_de[1:6, 1:4]
```
*The 'total' row above is labelled as Domestic goods and services in the* Eurostat Manual. *The table can be found on page 498.*
## Multipliers
### Income multipliers
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:
(63) Z = B(I-A)^-1^
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 `r as.numeric(de_gva_indicator[3])`.
*You can check these values against the Table 15.16 of the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0) on page 501 (row 10).*
You can recreate the whole matrix, when the 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.
```{r inputmultipliers}
input_reqr <- coefficient_matrix_create(
data_table = iotable_get(),
total = "output",
return_part = "primary_inputs"
)
multipliers <- input_multipliers_create(
input_requirements = input_reqr,
Im = I_de
)
multipliers
```
*You can check these results against the Table 15.16 on page 501 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.]
### Employment multipliers
The E matrix contains the input coefficients for labour (created by `input_indicator_create()`). The following matrix equation defines the employment multipliers.
(64) Z = E(I-A)^-1^
The `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](https://github.com/rOpenGov/iotables/issues) if you run into further real-life problems.
```{r employment_multiplier}
de_emp_indicator <- input_indicator_create(
data_table = germany_io,
input = "employment_domestic_total"
)
employment_multipliers <- multiplier_create(
input_vector = de_emp_indicator,
Im = I_de,
multiplier_name = "employment_multiplier",
digits = 4
)
vector_transpose_longer(employment_multipliers,
values_to = "employment_multipliers"
)
```
You can check against the [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0) page 501 that these values are correct and on page 501 that the highest employment multiplier is indeed $z_i$ = `r max (as.numeric(employment_multipliers), na.rm=TRUE)`, 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
`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.
(5) $b_{ij}$ = $X_{ij}$ / $x_i$ [also (45) output coefficients for products / intermediates].
$x_i$: output of sector i
```{r outputmult}
de_input_coeff <- input_coefficient_matrix_create(
data_table = iotable_get(),
digits = 4
)
output_multipliers <- output_multiplier_create(input_coefficient_matrix = de_input_coeff)
vector_transpose_longer(output_multipliers,
values_to = "output_multipliers"
)
```
*These multipliers can be checked against the Table 15.15 (The 8th, 'Total' row) on the page 500 of the* Eurostat Manual.
## Interindustrial linkage analysis
The `backward linkages`, i.e. demand side linkages, show how much incremental demand is created in the supplier sector when an industry is facing increased demand, produces more, and requires more inputs from suppliers.
`Forward linkages` on the other hand show the effect of increased production, which gives either more or cheaper supplies for other industries that rely on the output of the given industry.
For example, when a new concert is put on stage, orders are filled for real estate, security services, catering, etc, which show in the backward linkages. The concert attracts visitors that creates new opportunities for the hotel industry in forward linkages.
### Backward linkages
```{r backward}
de_coeff <- input_coefficient_matrix_create(iotable_get(), digits = 4)
I_de <- leontief_inverse_create(de_coeff)
vector_transpose_longer(backward_linkages(I_de),
values_to = "backward_linkage_strength"
)
```
*You can check the results against Table 15.19 on page 506 of the* Eurostat Manual.
Manufacturing has the highest backward linkages, and other services the least. An increased demand for manufacturing usually affects supplier industries. Service industry usually have a high labour input, and their main effect is increased spending of the wages earned in the services.
### Forward linkages
Forward linkages show the strength of the new business opportunities when industry i starts to increase its production. Whereas backward linkages show the increased demand of the suppliers in industry i, forward linkages show the increased availability of inputs for other industries that rely on industry i as a supplier.
The forward linkages are defined as the sums of the rows in the Ghosh-inverse. The Ghosh-inverse is not explicitly named in the *Eurostat Manual*, but it is described in more detail in the United Nations' similar manual [Handbook on Supply and Use Tables and Input-Output Tables with Extensions and Applications](https://unstats.un.org/unsd/nationalaccount/docs/SUT_IOT_HB_Final_Cover.pdf) (see pp 636--638).
```{r ghoshinverse}
de_out <- output_coefficient_matrix_create(
data_table = germany_io,
total = "final_demand",
digits = 4
)
ghosh_inverse_create(de_out, digits = 4)[, 1:4]
```
The Ghosh-inverse is \deqn{G = (I-B)^-1}
where B = the output coefficient matrix.
The forward linkages are the row-wise sums of the Ghosh-inverse
```{r forwardlinkages}
forward_linkages(output_coefficient_matrix = de_out)
```
*You can check the values of the forward linkages against the Table 15.20 on page 507 of* the Eurostat Manual.
## Environmental Impacts
At last, let's extend the input-output system with emissions data. For getting Eurostat's air pollution account data, use `airpol_get()`. We have included in the package the German emissions data from the *Eurostat Manual*.
```{r emissions}
data("germany_airpol")
emissions_de <- germany_airpol[, -3] %>%
vector_transpose_wider(
names_from = "iotables_col",
values_from = "value"
)
```
```{r emissionsprint}
emissions_de
```
```{r outputbp}
output_bp <- output_get(germany_io)
```
The output coefficients are created from the emission matrix with
\eqn{B_{ij}} = \eqn{Em_{ij} / output_{j}}
```{r emmissioncoeffs}
emission_coeffs <- germany_io %>%
supplementary_add(emissions_de) %>%
input_indicator_create(input_row = as.character(emissions_de$airpol), digits = 4)
```
The emissions coefficients are expressed as 1000 tons per millions of euro output (at basic prices).
```{r emmissioncoeffsprint}
emission_coeffs[-1, 1:3]
```
And the multipliers (which include both the direct and indirect emissions of the industries) are created with
\eqn{B(I-A)^{-1}}
You can create a single multiplier with `?multiplier_create`.
```{r CO2multiplier}
multiplier_create(
input_vector = emission_coeffs[2, ],
Im = I_de,
multiplier_name = "CO2_multiplier",
digits = 4
)
```
To create a tidy table of indicators of using a loop:
```{r emissionmultipliers}
names(emission_coeffs)[1] <- names(I_de)[1]
emission_multipliers <- cbind(
key_column_create(
names(emission_coeffs)[1],
gsub("_indicator", "_multiplier", unlist(emission_coeffs[-1, 1]))
),
do.call(
rbind,
lapply(
2:nrow(emission_coeffs),
function(x) equation_solve(emission_coeffs[x, ], I_de)
)
) %>% as.data.frame()
)
emission_multipliers[, -1] <- round(emission_multipliers[, -1], 4)
emission_multipliers[1:3, 1:4]
```
*You can check the results against the Table 15.13 of the* [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0) *on page 494.*
Because the equation of the final demand is:
`r paste0("final_demand = ", paste(names(germany_io)[9:13], collapse = " + "))`
we can calculate the final demand for the products of industries with creating the row-wise sums of the appropriate columns
```{r finaldemand}
final_demand <- rowSums(germany_io[1:6, 9:13])
```
And at last the emission content of the final demand is given by
\eqn{Z = B(I-A)^{-1}Y}
where the term
\eqn{B(I-A)^{-1}}
is the definition of the emission multipliers.
```{r emissioncontent}
emission_content <- as.data.frame(
round(as.matrix(emission_multipliers[1:3, -1]) %*% diag(final_demand), 0)
)
names(emission_content) <- names(emission_multipliers[, -1])
emission_content <- data.frame(
iotables_row = gsub("_multiplier", "_content", emission_multipliers[1:3, 1])
) %>%
cbind(emission_content)
emission_content[, 1:4]
```
*This final result can be found on the bottom of the page 494 of the* [Eurostat Manual of Supply, Use and Input-Output Tables](https://ec.europa.eu/eurostat/documents/3859598/5902113/KS-RA-07-013-EN.PDF/b0b3d71e-3930-4442-94be-70b36cea9b39?version=1.0).
---
title: "Metadata Vocabularies for Input–Output Analysis"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Metadata Vocabularies for Input–Output Analysis}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---
```{r, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
```
```{r setup}
library(iotables)
```
## Import and Normalisation Workflow
The five Eurostat vocabularies —\
`ind_ava`, `ind_use`, `prd_ava`, `prd_use`, and `cpa2_1` — were imported directly from the official Eurostat metadata registry (<https://dd.eionet.europa.eu/vocabulary/eurostat/>).\
Each dataset mirrors the structure of its corresponding SDMX codelist and preserves Eurostat’s identifiers and validity information.
### Data Sources
| Vocabulary | Description | Source URL |
|------------------------|------------------------|------------------------|
| `ind_ava` | Industries, adjustments and value added (rows for industry × industry SIOTs) | <https://dd.eionet.europa.eu/vocabulary/eurostat/ind_ava/> |
| `ind_use` | Industry uses (columns for industry × industry SIOTs) | <https://dd.eionet.europa.eu/vocabulary/eurostat/ind_use/> |
| `prd_ava` | Products, adjustments and value added (rows for product × product SIOTs) | <https://dd.eionet.europa.eu/vocabulary/eurostat/prd_ava/> |
| `prd_use` | Product uses (columns for product × product SIOTs) | <https://dd.eionet.europa.eu/vocabulary/eurostat/prd_use/> |
| `cpa2_1` | Statistical Classification of Products by Activity (CPA 2.1) | <https://dd.eionet.europa.eu/vocabulary/eurostat/cpa2_1/> |
### Import Steps
1. **Raw Download**\
Each vocabulary was retrieved as an Excel export from EIONET’s vocabulary registry.
2. **Column Standardisation**\
Columns were renamed to a unified schema: `id, label, status, status_modified, notation, group, quadrant, numeric_order, iotables_label, block, uri`
3. **Quadrant and Block Assignment**\
Each item was assigned a `quadrant` and a semantic `block` consistent across vocabularies:
- `10` = intermediate (Quadrant 1)
- `20` = primary_inputs (Quadrant 3)
- `30` = final_use (Quadrant 2)
- `50` = extension / diagnostic\
Control totals such as *“Total supply at basic prices”* were retained as `block = "control_total"`.
4. **Ordinal Ordering**\
`numeric_order` was reindexed within each quadrant with consistent gaps (10, 20, …) to ensure reproducible ordering for matrix construction.
5. **URI Generation**\
Each code was linked to its SKOS concept using:
```{r uri, eval=FALSE}
df$uri <- sprintf(
"https://dd.eionet.europa.eu/vocabularyconcept/eurostat/%s/%s",
vocabulary_id,
df$notation
)
```
6. **Validation**\
Each table was checked for:
- missing or duplicate IDs
- monotone numeric order
- alignment of quadrant ↔ block semantics
7. **Storage and Naming**
The cleaned tibbles were stored as exported data objects:
```
data/ind_ava.rda data/ind_use.rda data/prd_ava.rda data/prd_use.rda
```
Each dataset can be loaded directly with `data(<name>)`.
### Adjustments to Vocabularies
Although the four Eurostat vocabularies (`ind_ava`, `ind_use`, `prd_ava`, `prd_use`) were imported directly from the official Eurostat metadata registry, some modifications were necessary to ensure compatibility with the actual Eurostat input–output datasets. The main data sources, in particular `naio_10_cp1750` and `naio_10_cp1700`, occasionally include variables that are not coded according to the published and standardised vocabularies. While these inconsistencies are usually clear to a manual user, they can create ambiguity in a reproducible workflow where automated matching is required.
For example, the *product × product* SIOTs for the Slovak Republic contain a more detailed industry breakdown than that defined in prd_ava and prd_use. To maintain alignment across datasets, all 0-, 1-, and 2-digit codes from the `cpa2_1` vocabulary were imputed into the four vocabularies. Each entry includes a validity flag in the status column, indicating whether the code is valid in the official Eurostat vocabulary or was adopted from observed but non-standard codes in the data. This approach preserves reproducibility while ensuring complete coverage of all codes encountered in current Eurostat data releases.
### Versioning
All four vocabularies correspond to the 2025 Eurostat CPA 2.1 / ESA 2010 edition.
---
title: "Terminology"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{Terminology}
%\VignetteEncoding{UTF-8}
%\VignetteEngine{knitr::rmarkdown}
---
```{r setupvignette, include = FALSE}
knitr::opts_chunk$set(
collapse = TRUE,
comment = "#>"
)
options(scipen = 999)
```
## Introduction
This vignette reviews the terminology used in input–output analysis, with reference to the *Eurostat Manual of Supply, Use and Input–Output Tables* (Beutel, 2008).
This vignette is therefore descriptive, documenting how the `iotables` package uses *Eurostat-style terminology* consistent with ESA 2010 and the System of National Accounts (SNA 2008).
```{r setup}
library(iotables)
```
Retrieve the demo dataset, the Germany 1995 Symmetric Input-Output Table:
```{r germany}
germany_siot <- iotable_get()
```
## Structure of input–output tables
An *input–output table (IOT)* describes the flow of products and services in an economy, linking industries (producers) with their inputs, outputs, and final uses. In a *symmetric input–output table (SIOT***)**, both rows and columns represent either products or industries.
Eurostat distinguishes four *quadrants* of a SIOT:
| Quadrant | Description | ESA 2010 / SNA 2008 Category |
|----|----|----|
| **I** | Intermediate consumption — flows between industries or products | *Intermediate use* |
| **II** | Final demand — purchases by households, government, investment, exports | *Final use* |
| **III** | Primary inputs — compensation of employees, net taxes, gross operating surplus | *Primary inputs* |
| **IV** | Output totals — column sums at basic prices | *Output (P.1)* |
Quadrants I–III correspond to the *rows* of the table, while the column totals in Quadrant IV represent the total output of each industry or product.
## Core matrices and notation
Input–output analysis is built on a small set of matrices and vectors.\
The `iotables` package follows the same notation used in Beutel (2008).
| Symbol | Meaning | Definition | Function in `iotables` |
|----|----|----|----|
| **Z** | Intermediate-consumption matrix | Flows of products between industries | `iotable_get()` |
| **A** | Input (technical) coefficient matrix | `A_ij = Z_ij / X_j` | `input_coefficient_matrix_create()` |
| **(I − A)** | Leontief matrix | Identity minus A | `leontief_matrix_create()` |
| **L = (I − A)⁻¹** | Leontief inverse | Total (direct + indirect) requirements | `leontief_inverse_create()` |
| **f** | Final-demand vector | Exogenous demand by category | retrieved from IOT |
| **x = Lf** | Total output vector | Fundamental Leontief equation | – |
**Eurostat equation references:**
- $a_ij$ = $x_ij$ / $x_j$ — technical coefficient (19), (43) identical formulations for SIOTs
- $x$ = $(I − A)⁻¹$ — total output
## Input and output coefficients
### Input coefficients (technical coefficients)
Each element of the **input coefficient matrix** A shows the share of input *i* used in producing one unit of output of industry *j*: $$
a_{ij} = \frac{x_{ij}}{x_j}
$$
where\
- $a_{ij}$ = input coefficient for domestic goods and services\
- $x_{ij}$ = flow of product *i* to industry *j* (a cell in Quadrant I)\
- $x_j$ = total output of industry *j*
These coefficients are sometimes called **direct requirements** or **technical coefficients**.
hey are computed in `iotables` by:
```{r inputcoeff}
input_coefficient_matrix_create(
data_table = iotable_get(source="germany_1995"),
digits = 4)
```
### Output coefficients
The output coefficient matrix (Ghosh-type) expresses how the output of industry i is distributed across purchasing sectors j:
$$o_{ij} = \frac{x_{ij}}{x_i}$$
where
- $o_{ij}$ = output coefficient (distribution ratio)
- $x_{ij}$ = flow of product *i* to industry *j*
- $x_{i}$ = total output of product *i*
These ratios describe the supply-side distribution structure and are computed by `output_coefficient_matrix_create()`.
## Linkages between industries (inter-industry analysis)
Two types of linkages are typically analysed:
- **Backward linkage** – measures the strength of a sector’s demand on its suppliers.\
It is given by the **column sum** of input coefficients or, when based on the Leontief inverse, includes all indirect effects through the supply chain.
- **Forward linkage** – measures the influence of a sector as a supplier to others. It is given by the **row sum** of output coefficients, describing how the sector’s output feeds into other industries.
## Indicators and multipliers
### Direct indicators
An **input indicator** represents a specific row of the coefficient matrix A,\
for example value added (GVA), labour, or emissions per unit of output.
```{r inputindicatr}
input_indicator_create(
data_table = iotable_get(), input_row = "gva")
```
### Output coefficients
The output coefficients are ratios derived from quadrant I (intermediates) and quadrant II (final demand) of a sector.
The `output_coefficient_matrix_create()` function creates these coefficients based on equation (5) in the Eurostat Manual.
(5) $o_{ij}$ = $x_{ij}$ / $x_i$
$o_{ij}$ = output coefficient for domestic goods and services (i = 1, ..., 6; j = 1, ..., 6) $x_{ij}$ = flow of commodity i to sector j $x_j$ = output of sector i
## Summary of key equations
| No. | Formula | Description |
|:-----------|:----------------------------|:---------------------------------|
| (5) | $o_{ij}$ = $x_{ij}$ / $x_i$ | Output coefficient (Ghosh model) |
| (9) | $a_{ij}$ = $x_{ij}$ / $x_j$ | Input (technical) coefficient |
| (19), (43) | – | Identical to (9) for SIOTs |
| (47) | $x$ = $(I - A)^{-1}$ | Leontief model for total output |
| (L) | $L$ = $(I - A)^{-1}$ | Leontief inverse |
| (m) | $m$ = $a \times L$ | Multiplier equation |
## Validation summary (Eurostat Manual, Beutel 2008)
All analytical functions of `iotables` reproduce the benchmark examples from Beutel (2008), *Eurostat Manual of Supply, Use and Input–Output Tables.*
| Function | Concept | Beutel Table | Page |
|:---|:---|:---|:--:|
| `input_coefficient_matrix_create()` | Direct requirements (A) | 15.6 | 485 |
| `leontief_matrix_create()` | Leontief matrix $(I − A)$ | 15.9 | 487 |
| `leontief_inverse_create()` | Total requirements ($L$ = $(I − A)^{1}$) | 15.10 | 488 |
| `supplementary_add()` | Environmental extension (CO₂, CH₄) | 15.13 | 494 |
| `input_indicator_create()` | Input indicators (GVA, Compensation) | 15.14 | 498 |
| `multiplier_create()` | Total multipliers (GVA, Employment) | 15.16 | 503–504 |
## References
- **Beutel, J.** (2008). *Eurostat Manual of Supply, Use and Input–Output Tables.*\
Luxembourg: Office for Official Publications of the European Communities.
- **United Nations** (2018). *Handbook on Supply and Use Tables and Input–Output Tables with Extensions and Applications*, Rev. 1.\
New York: United Nations.
- **OECD** (2021). *Inter-Country Input–Output (ICIO) Manual.* Paris: OECD Publishing.
- **United Nations** (2012). *System of Environmental-Economic Accounting 2012: Central Framework.*\
New York: United Nations.
---
title: "United Kingdom Input-Output Analytical Tables"
author: "Daniel Antal, based on the work edited by Richard Wild"
date: "`r Sys.Date()`"
output: rmarkdown::html_vignette
vignette: >
%\VignetteIndexEntry{United Kingdom Input-Output Analytical Tables}
%\VignetteEngine{knitr::rmarkdown}
%\VignetteEncoding{UTF-8}
---