Replication code and data for Hornok and Koren, 2014. "Per-Shipment Costs and the Lumpiness of International Trade." Review of Economics and Statistics.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.

Replication data and programs for “Per-Shipment Costs and the Lumpiness of International Trade”

by Cecília Hornok and Miklós Koren

This file describes the program and data files for replicating the descriptive statistics and the estimation results in the paper

Hornok, Cecília and Miklós Koren. “Per-Shipment Costs and the Lumpiness of International Trade,” Review of Economics and Statistics, forthcoming.

Please cite the above paper when using these programs.

Use the repository browser above to preview and download individual files, or download the entire folder as a single ZIP-file (588MB). If you have git, use

git clone
cd per-shipment-costs-replication


All programs are under folder code/. The following Stata do-files need to be run in sequence to replicate our results. The do-files have been tested on Stata 13.0 and should work across a variety of platforms with the exception of, which expects a Unix-like environment, such as Unix, Linux or Mac OS X. We have also included a makefile, so, in a Unix-like environment, you can just run make from the shell.

  • Installs the necessary Stata packages. As with all other .do files, this should be run from the main replication folder as do code/
  • Downloads all data from the available internet resources and saves them to the folder data/. This script uses a Unix shell, so requires Unix, Linux or Mac OS X. If you are running Windows, check how to use zip and gzip from the command line. We have saved the output of this script in data/ for your convenience, so you can skip the downloads.
  • Converts the various datasets into Stata format and merges them. The output is data/derived/merged_importer_data.dta.
  • Reads data from the monthly trade statistics published by the U.S. Census Bureau, merges with importer-country variables and reports shipment-level statistics. The output is data/derived/usa_export_2009_with_gravity.dta.
  • Reads data from the shipment-level trade statistics published by the Agencia Tributaria, merges with importer-country variables and reports shipment-level statistics. The output is data/derived/spain_export_2009_with_gravity.dta.
  • Creates Table 1 in paper and correlation statistics for the Doing Business indicators.
  • Runs the estimations creating Tables 3-7. Output is exhibit/table*.xls.


All data are under folder data. Subfolders indicate the data sources.


The exhibits/ folder contains .txt and .xls files with Tables 3-7. These tables have been formatted for the paper. Please note that minor changes in some of the internet resources and rounding might cause small numerical discrepancies relative to the published tables. None of these discrepancies is substantial.

Internet resources

Trade agreements entering into force between 2005 and 2009. The EIA data is only up to 2005. We adjust to the 2009 situation based on information from the following internet sources: