Giter Club home page Giter Club logo

gvc's Introduction

gvc

License CRAN Version R build status Coverage status Total RStudio Cloud Downloads Montly RStudio Cloud Downloads

Several tools for Global Value Chain ('GVC') analysis are implemented

  • 'Importing to Export' (i2e())
  • 'Exporting to Re-export' (e2r())
  • 'New Revealed Comparative Advantage' (nrca())
  • 'Upsteamness' (upstream())
  • 'Downstreamness' (downstream())
  • 'Domestic Final Demand Foreign Value Added' (dfdfva())
  • 'Foreign Final Demand Domestic Value Added' (ffddva())
  • 'Domestic Final Demand Domestic Value Added' (dfddva())

Demonstration

gvc demonstration

Installation

The gvc package is available on CRAN, please note that this is a beta version, the API will change.

install.packages('gvc')

Additionally the development version, to be used at your own peril, is available from GitHub. Installation from GitHub is done using:

if (!require('remotes')) install.packages('remotes')
remotes::install_github('bquast/gvc')

Usage

Following installation, the package can be loaded using:

library(gvc)

For information on using the package, please refer to the help files.

help('gvc')
help(package = 'gvc')

For examples of usage, see the function specific help pages.

help('i2e')
help('e2r')
help('nrca')
help('upsteam')
help('downstream')
help('dfdfva')
help('ffddva')
help('dfddva')

In addition to the help files we provide long form examples in the vignette.

vignette('gvc')

# or
browseVignettes('gvc')

Additional Information

An overview of the changes is available in the NEWS file.

news(package='gvc')

There is also a blog post with information on my personal website.

https://qua.st/gvc/

This package relies on the diagonals package (CRAN).

Development

Development takes place on the GitHub page.

https://github.com/bquast/gvc

Bugs can be filed on the GitHub issues page.

https://github.com/bquast/gvc/issues

gvc's People

Contributors

bquast avatar

Stargazers

EconMaett avatar  avatar  avatar sanguovbobo avatar wkp avatar Josh Hopkins avatar  avatar Asei Ito avatar  avatar LiuBianShi avatar Rebecca Li avatar Sebastian Krantz avatar winter_smilie avatar Matthew Smith avatar  avatar P Jakobsen avatar Brancen Gregory avatar Carlo Bottai avatar  avatar

Watchers

James Cloos avatar  avatar edwardttril avatar  avatar  avatar EconMaett avatar

gvc's Issues

Output of i2e function

It seems like some of the output of the i2e command produces a false output. In the case of Sweden, one receives values of up to 12825, which, given the underlying concept of a VAX ratio or vertical specialisation ratios in general, seems unrealistic.
Attached, the output generated by i2e for the year 2011.
screen shot 2018-05-07 at 12 26 32

matrix A in calculating downstreamness & upstreamness

Hello, I use your package in R. Why when calculating the downstreamness and upstreamness, the matrix of coefficients is transposed? Why are domestic entries diagonally set to 0?

In the literature (https://unstats.un.org/unsd/trade/events/2016/newyork-egm/documents/background/OECD%20-%202013%20-%20GVC%20Mappings.pdf), the formula for downstreamness is

N = U* (I-A)^-1, where I is an identity matrix and A is the matrix of technical coefficients

for upstreamness is

D = U* (I-G)^-1 , where I is the identity matrix and G a matrix of output coefficients

NaN in upstream result

Hello!
In the results of the upstream calculation, all the values of NaN, while there were no errors. Downstream is calculated and does not have a similar error. What could be the reason?

Report a bug to make the result of the 'dfddva' function incorrect

A part of 'dfddva' function in gvc package needs correct:

dfddva <- function (x, aggregate = FALSE) {


    x <- data.frame(Importing_Country = rep(k, each = N), 
        Source_Industry = rep(i, times = G), **dfdfva** = x)
    return(x)
}

}

The result of the 'dfddva' function has incorrect name.
It means that 'dfdfva' =x needs to be replaced with 'dfddva'=x in the parentheses of the data.frame.

matrix A in downstream() & upstream()

Hi,

both the downstream and upstream functions make use of the matrix A, e.g.

downstream = function (x) { solve(diag(x$GN) - t(x$A)) %*% matrix(1, nrow = x$GN) }

where x refers to an object of class "decompr" as created using the load_tables_vectors() function from the decompr package.
However, the load_tables_vectors() does not save an object of name A in its output. It only saves the object Am, which is the "Imported / Exported goods IO shares matrix (x column-normalized by output o, with domestic entries set to 0)". When indexing the decompr object x with x$A, it is thus actually x$Am that is extracted (due to partial indexing).

Was this done deliberately or does the downstream function perhaps intend to use the A matrix instead?

Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.