Package decompr. August 17, 2016



Similar documents
Package retrosheet. April 13, 2015

Package OECD. R topics documented: January 17, Type Package Title Search and Extract Data from the OECD Version 0.2.

Package uptimerobot. October 22, 2015

Package searchconsoler

Package LexisPlotR. R topics documented: April 4, Type Package

Package urltools. October 11, 2015

Package whoapi. R topics documented: June 26, Type Package Title A 'Whoapi' API Client Version Date Author Oliver Keyes

Package MBA. February 19, Index 7. Canopy LIDAR data

Package bigrf. February 19, 2015

Package ggrepel. February 8, 2016

Package missforest. February 20, 2015

Package syuzhet. February 22, 2015

Package DCG. R topics documented: June 8, Type Package

Package changepoint. R topics documented: November 9, Type Package Title Methods for Changepoint Detection Version 2.

Package sendmailr. February 20, 2015

Package hazus. February 20, 2015

Package EstCRM. July 13, 2015

Package TSfame. February 15, 2013

Package neuralnet. February 20, 2015

Package dunn.test. January 6, 2016

Package jrvfinance. R topics documented: October 6, 2015

Package empiricalfdr.deseq2

Package hoarder. June 30, 2015

Package fimport. February 19, 2015

Package WikipediR. January 13, 2016

Package optirum. December 31, 2015

Package trimtrees. February 20, 2015

Package AzureML. August 15, 2015

Package tvm. R topics documented: August 21, Type Package Title Time Value of Money Functions Version Author Juan Manuel Truppia

Package PACVB. R topics documented: July 10, Type Package

Package erp.easy. September 26, 2015

Package tagcloud. R topics documented: July 3, 2015

Package bigdata. R topics documented: February 19, 2015

Package ChannelAttribution

Package sjdbc. R topics documented: February 20, 2015

Package pxr. February 20, 2015

Package dsstatsclient

Package cpm. July 28, 2015

Package mcmcse. March 25, 2016

Package treemap. February 15, 2013

Package GEOquery. August 18, 2015

Package hive. January 10, 2011

Package hive. July 3, 2015

Package SHELF. February 5, 2016

Package httprequest. R topics documented: February 20, 2015

Package saccades. March 18, 2015

Package wordnet. January 6, 2016

Package png. February 20, 2015

Package sudoku. February 20, 2015

Package benford.analysis

Package ATE. R topics documented: February 19, Type Package Title Inference for Average Treatment Effects using Covariate. balancing.

Package GSA. R topics documented: February 19, 2015

Package bizdays. March 13, 2015

Package HHG. July 14, 2015

Package franc. R topics documented: November 12, Title Detect the Language of Text Version 1.1.1

Package cgdsr. August 27, 2015

Measuring Smile Curves in Global Value Chains *

Package metafuse. November 7, 2015

Package pdfetch. R topics documented: July 19, 2015

Package packrat. R topics documented: March 28, Type Package

Package nortest. R topics documented: July 30, Title Tests for Normality Version Date

Package CRM. R topics documented: February 19, 2015

Package TRADER. February 10, 2016

Package RCassandra. R topics documented: February 19, Version Title R/Cassandra interface

Package multivator. R topics documented: February 20, Type Package Title A multivariate emulator Version Depends R(>= 2.10.

Package PRISMA. February 15, 2013

Package survpresmooth

Package lmertest. July 16, 2015

Package dggridr. August 29, 2016

Package CoImp. February 19, 2015

Package MDM. February 19, 2015

Package date. R topics documented: February 19, Version Title Functions for handling dates. Description Functions for handling dates.

Methods for Finding Bases

A Multiplier and Linkage Analysis :

Package instar. November 10, 2015

α = u v. In other words, Orthogonal Projection

Package MFDA. R topics documented: July 2, Version Date Title Model Based Functional Data Analysis

Package EasyHTMLReport

MAT 200, Midterm Exam Solution. a. (5 points) Compute the determinant of the matrix A =

Package snp.plotter. February 20, 2015

11th National Convention on Statistics (NCS) EDSA Shangri-La Hotel October 4-5, 2010

Package DDIwR. R topics documented: February 19, Version Date Title DDI with R Depends R (>= 3.1.0) Imports XML, foreign

Package RIGHT. March 30, 2015

Package polynom. R topics documented: June 24, Version 1.3-8

Package MixGHD. June 26, 2015

Package CIFsmry. July 10, Index 6

Package tikzdevice. February 20, 2015

Transcription:

Version 4.5.0 Title Global-Value-Chain Decomposition Package decompr August 17, 2016 Two global-value-chain decompositions are implemented. Firstly, the Wang-Wei-Zhu (Wang, Wei, and Zhu, 2013) algorithm splits bilateral gross exports into 16 value-added components. Secondly, the Leontief decomposition (default) derives the value added origin of exports by country and industry, which is also based on Wang, Wei, and Zhu (Wang, Z., S.-J. Wei, and K. Zhu. 2013. ``Quantifying International Production Sharing at the Bilateral and Sector Levels.''). Maintainer Bastiaan Quast <bquast@gmail.com> Depends R (>= 2.10) License GPL-3 URL http://qua.st/decompr, https://github.com/bquast/decompr BugReports https://github.com/bquast/decompr/issues Suggests gvc, testthat, knitr VignetteBuilder knitr RoxygenNote 5.0.1 NeedsCompilation no Author Bastiaan Quast [aut, cre], Fei Wang [aut], Victor Kummritz [aut], Oliver Reiter [ctb] Repository CRAN Date/Publication 2016-08-17 11:47:36 R topics documented: countries........................................... 2 decomp........................................... 2 decompr........................................... 4 final............................................. 4 1

2 decomp industries.......................................... 5 inter............................................. 5 leontief........................................... 5 load_tables......................................... 6 load_tables_vectors..................................... 7 out.............................................. 8 wwz............................................. 8 Index 10 countries Leather Example the names of the countries data decomp Interface function for decompositions Usage This function runs the decomposition. NOTE: the default method is now "leontief", please specify method="wwz" explicitly for Wang-Wei-Zhu. See http://qua.st/decompr/decompr-v2/ for more information. decomp(x, y, k, i, o, v, method = c("leontief", "wwz"), verbose = FALSE,...) Arguments x y k i intermediate demand table, it has dimensions GN x GN (G = no. of country, N = no. of industries), excluding the first row and the first column which contains the country names, and the second row and second column which contain the industry names for each country. In addition, an extra row at the end should contain final demand. final demand table it has dimensions GN x MN, excluding the first row and the first column which contains the country names, the second column which contains the industry names for each country, and second row which contains the five decomposed final demands (M). # @param k is a vector of country of region names vector or country or region names vector of sector or industry names

decomp 3 o v Details Value method verbose vector of final outputs vector of value added, optional. If this vector is not specified, value added will be calculated as gross output - intermediate consumption user specified the decomposition method logical, should timings of the calculation be displayed? Default is FALSE... arguments to pass on the respective decomposition method Version 2 introduces several important changes, the default method is now leontief, which means that wwz has to be specified explicitly. Furthermore, the input object have a different structure, see the information below for details. The output when using the WWZ algorithm is a matrix with dimensions GNG*19. Whereby 19 is the 16 objects the WWZ algorithm decomposes exports into, plus three checksums. GNG represents source country, using industry and using country. Bastiaan Quast 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. Quantifying international production sharing at the bilateral and sector levels. No. w19677. National Bureau of Economic Research, 2013. Examples # load leather example data data(leather) # explore the data set ls() # explore each of the objects inter final countries industries out # use the direct approach # run the Leontief decomposition decomp(inter, final,

4 final countries, industries, out, method = "leontief") # run the WWZ decomposition decomp(inter, final, countries, industries, out, method = "wwz") decompr Export Decomposition using the Wang-Wei-Zhu and Leontief decompositions algorithms. Two global-value-chain decompositions are implemented. Firstly, the Wang-Wei-Zhu (Wang, Wei, and Zhu, 2013) algorithm splits bilateral gross exports into 16 value-added components. Secondly, the Leontief decomposition (default) derives the value added origin of exports by country and industry, which is also based on Wang, Wei, and Zhu (Wang, Z., S.-J. Wei, and K. Zhu. 2013. "Quantifying International Production Sharing at the Bilateral and Sector Levels."). Bastiaan Quast <bquast@gmail.com> Fei Wang Victor Kummritz References Wang, Zhi, Shang-Jin Wei, and Kunfu Zhu. Quantifying international production sharing at the bilateral and sector levels. No. w19677. National Bureau of Economic Research, 2013. See Also http://qua.st/decompr final Leather Example the final demand data

industries 5 industries Leather Example the names of the industries data inter Leather Example the intermediate demand data leontief Leontief Decomposition Usage Leontief Decomposition leontief(x, post = c("exports", "output", "final_demand", "none"), long = TRUE) Arguments x post long an object of class decompr post-multiply the Leontief inverse with something, the default is exports transform the output data into a long (tidy) data set or not, default it TRUE. Value a data frame containing the square matrix and labelled column and rows Bastiaan Quast References Wang, Zhi, Shang-Jin Wei, and Kunfu Zhu. Quantifying international production sharing at the bilateral and sector levels. No. w19677. National Bureau of Economic Research, 2013.

6 load_tables Examples ## load example data data(leather) ## create intermediate object (class decompr) decompr_object <- load_tables_vectors(inter, final, countries, industries, out ) ## run the Leontief decomposition on the decompr object leontief(decompr_object ) load_tables Load the Input-Output and Final demand tables This function loads the demand tables and defines all variables for the decomposition Usage load_tables(x, y) Arguments x y the intermediate demand table, it has dimensions GN x GN (G = no. of country, N = no. of industries), excluding the first row and the first column which contains the country names, and the second row and second column which contain the industry names for each country. In addition, an extra row at the end should contain final demand. the final demand table it has dimensions GN x MN, excluding the first row and the first column which contains the country names, the second column which contains the industry names for each country, and second row which contains the five decomposed final demands (M). Details Adapted from code by Fei Wang. Value a decompr class object Bastiaan Quast

load_tables_vectors 7 load_tables_vectors Load the Input-Output and Final demand tables This function loads the demand tables and defines all variables for the decomposition Usage load_tables_vectors(x, y, k, i, o, v = NULL, null_inventory = FALSE) Arguments x y k i o v intermediate demand table, it has dimensions GN x GN (G = no. of country, N = no. of industries), excluding the first row and the first column which contains the country names, and the second row and second column which contain the industry names for each country. In addition, an extra row at the end should contain final demand. final demand table it has dimensions GN x MN, excluding the first row and the first column which contains the country names, the second column which contains the industry names for each country, and second row which contains the five decomposed final demands (M). # @param k is a vector of country of region names vector or country or region names vector of sector or industry names vector of final outputs vector of value added null_inventory when the inventory (last FDC) should be set to zero Details Adapted from code by Fei Wang. Value a decompr class object Bastiaan Quast

8 wwz Examples # load example data data(leather) # create intermediate object (class decompr) decompr_object <- load_tables_vectors(inter, final, countries, industries, out) # examine output object str(decompr_object) out Leather Example final output wwz Runs the Wang-Wei-Zhu decomposition This function runs the Wang-Wei-Zhu decomposition. Usage wwz(x, verbose = FALSE) Arguments x verbose an object of the class decompr logical, should timings of the calculation be displayed? Default is FALSE Details Adapted from code by Fei Wang. Value the decomposed table

wwz 9 Bastiaan Quast References Wang, Zhi, Shang-Jin Wei, and Kunfu Zhu. Quantifying international production sharing at the bilateral and sector levels. No. w19677. National Bureau of Economic Research, 2013. Examples # load example data data(leather) # create intermediate object (class decompr) decompr_object <- load_tables_vectors(inter, final, countries, industries, out ) # run the WWZ decomposition on the decompr object wwz(decompr_object)

Index countries, 2 decomp, 2 decompr, 4 decompr-package (decompr), 4 final, 4 industries, 5 inter, 5 leontief, 5 load_tables, 6 load_tables_vectors, 7 out, 8 wwz, 8 10