vs: Vertical Specialization

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/vs.R

Description

Calculates the vertical specialization share of total exports of each sector as described by Hummels et al. (2001), equation 3. Creates a value between zero and one to indicate relative specialization. For each region, a Leontief inverse is calculated. You need a multi-region input-output dataset for vs to be relevant.

Caution: Inverting large matrices will take a long time. Each individual hypothetical extraction requires the inversion of a matrix. R does a computation roughly every 8e-10 second. The number of computations per matrix inversion is n^3 where n is the dimension of the square matrix. For n = 5000 it should take 100 seconds.

Usage

1
vs(io, ES, regions = "all", sectors = "all")

Arguments

io

An InputOutput class object from as.inputoutput

ES

An EasySelect class object from easy.select to specify which region and sector combinations to use.

regions

Character or Integer. Specific regions to be used. Can either be a character that exactly matches the name of the region in RS_label or the number of the region in the order it appears in RS_label.

sectors

Character or Integer. Specific sectors to be used. Can either be a character that exactly matches the name of the sector in RS_label or the number of the sector in the order it RS_label.

Details

The vertical specialization share of total exports is calculated as follows:

\frac{vs_r}{X_r^{total}} = \frac{1}{X_r^{total}} A^M_r L_r X_r

where X_r^{total} is the total exports for region r, A^M_r is the matrix of technical import coefficients, L_r is the domestic Leontief inverse calculated from the domestic matrix of technical coefficients i.e. A_{rr} not the full A matrix, and X_r is the vector of total exports.

Value

Creates a region list of vs share of total exports.

Author(s)

John J. P. Wade, Ignacio Sarmiento-Barbieri

References

Hummels, David & Ishii, Jun & Yi, Kei-Mu, 2001. The nature and growth of vertical specialization in world trade. Journal of International Economics, Elsevier, vol. 54(1), pages 75-96, June.

See Also

import.coef, export.total, check.RS, leontief.inv

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
data(toy.IO)
class(toy.IO)
(vs1 <- vs(toy.IO, regions = "all"))
vs1$Hogwarts
sum(vs1$Hogwarts)

data(toy.ES)
class(toy.ES)
vs2 <- vs(toy.IO, toy.ES)
vs2

Example output

Loading required package: ggplot2
Loading required package: plot3D
Loading required package: lpSolve
Warning message:
no DISPLAY variable so Tk is not available 
[1] "InputOutput"
$Hogwarts
                    vs
Pizza       0.03593263
Wii         0.02733543
Spaceships  0.05337125
Lightsabers 0.03111943
Minions     0.05071905

$Narnia
                    vs
Pizza       0.03530663
Wii         0.03503673
Spaceships  0.03706177
Lightsabers 0.02298719
Minions     0.03599609

Warning messages:
1: In import.coef(io, region = r) : 
WARNING: io$M exists. This means the import coefficient matrix may be biased

Coefficient matrix is still calculated.
2: In import.coef(io, region = r) : 
WARNING: io$M exists. This means the import coefficient matrix may be biased

Coefficient matrix is still calculated.
                    vs
Pizza       0.03593263
Wii         0.02733543
Spaceships  0.05337125
Lightsabers 0.03111943
Minions     0.05071905
[1] 0.1984778
[1] "EasySelect"
Warning messages:
1: In import.coef(io, region = r) : 
WARNING: io$M exists. This means the import coefficient matrix may be biased

Coefficient matrix is still calculated.
2: In import.coef(io, region = r) : 
WARNING: io$M exists. This means the import coefficient matrix may be biased

Coefficient matrix is still calculated.
$Hogwarts
                    vs
Wii         0.02733543
Spaceships  0.05337125
Lightsabers 0.03111943

$Narnia
                vs
Pizza   0.03530663
Minions 0.03599609

ioanalysis documentation built on Jan. 13, 2021, 5:16 p.m.

Related to vs in ioanalysis...