R code for processing US Bureau of Economic Analysis Input Output Tables

I’ve just posted to github some R code that reads in the make and use tables generated by the US Bureau of Economic Analysis.  As a warning, I’m not an economist by training, so people who find this useful are highly encouraged to look through the source code and comment below on any problems. This represents my best attempts to understand and apply the Concepts and Methods of the U.S. Input-Output Accounts manual (starting at page 12-21). 

There are a few known issues, and things I’m not entirely clear on.  For example, the U and V matrices in the code do not contain scrap and noncomparable imports, since including these would result in rectangular matrices and (it seems to me) that the calculations performed on these later require square matrices.  Additionally, the BEA documentation, in working through the formulas of input-output analysis, derives several identities, which I used to check the calculations. These numbers match up except for one element in the vector (see part on qError and gError), and I haven’t had time to track this down.  It may be related to the scrap and noncomparable imports data.

Despite these small warts, the code is interesting since it downloads the Excel spreadsheets straight from the BEA site, extracts and cleans the relevant bits of data, and populates the variables needed to do basic input-output analysis.  With the BEA spreadsheets, each year is represented as a separate sheet, and by specifying the year you are interested in (1998 through 2009), the code will access the data on that sheet.  This also means that if you want to construct time series data from the make and use tables, you just have to call the function I defined within a loop, and then merge the data together in whatever form you need.

For people interested in network analysis, this code is useful since it gives you data on interdependencies between industries and commodities in the US economy for more than a decade.  The code essentially creates adjacency matrices which can then be used directly with libraries such as igraph.

Be Sociable, Share!

Leave a Reply