Federico Belotti's niche on the web

Browsing Posts in Blogging

Together with Michele Mancini and Alessandro Borin, we have just released a preliminary version of icio, a new Stata command for Global Value Chains (GVCs) analysis.

icio exploits the Inter-Country Input-Output tables: the WIOD dataset is the default, but also OECD TiVA and user-provided tables can be loaded.

By simplifying the analysis of trade in value-added and countries' participation in GVCs, the command should be useful for researchers that are not actively engaged in the GVCs literature.

You can install the command by typing in the Stata command bar:

ssc install icio

Once the command is installed, by typing

icio_load, iciot(wiod) year(2014)

a Mata version of the WIOD 2014 table is downloaded and stored in memory.

Several options are available (see help icio).

The command can compute:

  1. Value added in domestic and foreign demand, also at the sectoral level;
  2. Koopman, Wang and Wei (2014) decomposition of aggregate exports;
  3. Borin and Mancini (2017) decompositions of bilateral and bilateral-sectoral exports, retrieving for each bilateral flow, aside from the exporting and the importing country, also the country of origin of the value-added as well as the final destination market;
  4. Measure of GVC-related trade, defined as goods and services crossing at least two borders (again following Borin and Mancini, 2017).

Of special note is that it is possible to define country-groups and to use user-provided IO tables. In the next release of the command, a dialog interface will be added.



Borin, A., and M. Mancini (2017). Follow the value-added: tracking bilateral relations in Global Value Chains. MPRA Working Paper, No. 82692

Koopman, R., Z. Wang and S. Wei (2014). Tracing Value-Added and Double Counting in Gross Exports. American Economic Review, 104(2), 459-94

A new Stata command for spatial differencing estimation is now available. sreg fits the following model:

where is the outcome of unit located in area with , is a -vector of exogenous covariates, is the idiosyncratic error and is an unobserved local effect for the unobserved location , , possibly at a finer spatial scale than . Estimating this model by ordinary least squares ignoring gives a consistent estimate of only if . If we set aside this unrealistic assumption and allow for arbitrary correlation between the local unobservables and the explanatory variables, i.e. , a non-experimental approach to estimating the model involves, in some way, transforming the data to rule out . An increasingly common way to deal with this issue is the so-called spatial differencing approach.

sreg implements the spatial differencing estimator described in Belotti et al. (2017), as well as different variance-covariance estimators, among which the dyadic-robust (Cameron and Miller, 2014) and the Duranton et al. (2011)'s analytically-corrected estimators. Of special note is that sreg also allow to apply the spatial differencing transformation to units located in contiguous clusters ("boundary-discontinuity" design).

The command was written together with Edoardo Di Porto and Gianluca Santoni.

You may install it by typing

net install sreg, from(

in your Stata command bar. Stata version 14.2 is required.


Given the high number of requests, my colleagues and I have decided to provide a brief tutorial on how to get started with xsmle. First of all, you have to install the command by typing

net install xsmle, all from(

It is fundamental to use the option all because when you install a user-written package without using this option, the ancillary files (in this case "product.dta" and "usaww.spmat") won't be downloaded, while with the all option all the ancillary files will always (conditionally on the presence of an internet connection) be downloaded to 1) your current working directory OR 2) the directory you specified for ancillary files using the net set other command.

Now, lets assume that you haven't changed your "ancillary files" directory and that your Stata current working directory is the Desktop. Then, you should now find on your Desktop two new files: "product.dta" and "usaww.spmat". These files contain informations on public capital productivity in 48 US states observed over 17 years, as well as the spatial weights matrix for the US states (Munnel, 1990). The examples reported in the xsmle help file make use of these files, also available in R through the Ecdat package.

The first step is to load the "product.dta" into memory by typing

use product.dta, clear

Then, you have to do the same for the spatial weights matrix contained in the "usaww.spmat" file. Being an spmat file, this can be done by typing

spmat use W using "usaww.spmat"

At this stage, after computing the logarithm of the dependent and independent variables, we have all the ingredients to estimate a spatial panel data model. For instance, the syntax to estimate a Spatial AutoRegressive (SAR) model with random effects is

xsmle lngsp lnpcap lnpc lnemp unemp, wmat(W) model(sar)

Notice that the dataset "product.dta" has been already declared to be a panel. In general, you need to declare your dataset to be a panel dataset by using the xtset command.


Munnell AH (1990). “Why Has Productivity Growth Declined? Productivity and Public Investment.” New England Economic Review, 1990, 3–22.

Global Power Shift is the starting point for a new phase in the international climate movement. First, hundreds of climate leaders from around the world will gather in Istanbul to launch a year of new strategy and action for the movement (PHASE1 - 10/17 June 2013, Istanbul). Then, we will fan out across the globe to spark an unprecedented wave of  events and mobilizations for climate action (PHASE2 - 2013/2014, EVERYWHERE!) ... APPLY TO ATTEND PHASE1 IN ISTANBUL

Powered by WordPress © 2005 - 2019 © Web Design by myself using Arjuna-x theme (by SRS Solutions)