# upstream: Upstreamness - Average Distance from Final Use In ioanalysis: Input Output Analysis

## Description

Measures upstreamness as in Antras et al. (2012), equation (9) page 5. The value is weakly bounded below by one, where a value close to one indicates it is near its final use on average and a higher value indicates it is further away from final use on average.

## Usage

 1 upstream(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 upstreamness is calculated as follows, where, A is the matrix of technical input coefficients, X is total production, E is exports, and M is imports.

d_{ij} = a_{ij} \frac{x_i}{x_i + e_{ij} - m_{ij}}

U = (I - D)^{-1}

u_i = ∑_{j=1}^n U_{ij}

## Value

Produces a list over regions of each region's sectors upstreamness measure.

## Note

If the import (M) and/or export (E) is a matrix (i.e. not a nx1 vector) they are summed across region-sector combinations.

## Author(s)

John J. P. Wade, Ignacio Sarmiento-Barbieri

## References

Pol Antras & Davin Chor & Thibault Fally & Russell Hillberry, 2012. Measuring the Upstreamness of Production and Trade Flows. NBER Working Papers 17819, National Bureau of Economic Research, Inc.

## See Also

as.inputoutput

## Examples

 1 2 3 4 data(toy.IO) class(toy.IO) u1 <- upstream(toy.IO) u1\$Hogwarts 

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