Replication code for
Halpern, László, Miklós Koren and Ádám Szeidl. 2015. "Imported Inputs and Productivity." American Economic Review.
Please cite the above paper when using any of these programs.
Our data preparation and estimation code use Stata 13 and Python 2.7 and run under Unix-like systems (Max OS X and Linux distributions).
We have included a
Makefile that runs all the code used in calculating the descriptive statistics, the point estimation of parameter values, the bootstrap, and the figures of simulation results. Unzip all the files, and once you have the necessary datasets in
data/customs/import/hs6imports.dta, just run
cd code make all
You may need to edit the Makefile to call the appropriate Stata executable (
stata-se in our case).
The different specifications and bootstrap repetitions can run in parallel. For parallel execution, use the
-j option with
make, giving the maximum number of jobs you want to run in parallel:
make -j3 all
All the data processing and estimation scripts are under the folder
code/. The other folders are placeholders for the necessary inputs and outputs of these scripts. For example, data is read from
data/ (please see the note on data access below), intermediate simulation results are saved under
doc/simulations, whereas graphs are saved under
text/graphs. We include all the output files in this package.
The estimation workflow consists of the following broad steps. The Makefile contains all the dependencies fully describing the workflow.
- Descriptive statistics.
numbers-in-text.docalculate descriptive statistics reported in Tables 1 and 2 and throughout the text.
- Estimate a given regression specification. Specifications are given in separate do-files. For example,
code/map/table3_baseline.docontains the necessary settings for the baseline specification in Table 3. These cannot be called by themselves, but are started in Stata by
do estimate_specification table3_baseline 0.
estimate_specification.dois the master script, calling several preprocessing (
prepare_for_estimation.do) and estimation scripts (
removevar.do). The estimation results are saved in a .csv file, for example,
- Bootstrap. Bootstrap repetitions are estimated the same way as the point estimates, but each on a different bootstrap sample. The samples are drawn conditional on a random seed running from 1 through 500. For example, to draw a new random sample with random seed 27, run
do estimate_specification table3_baseline 27, which will save the estimated parameter values into
- Collect estimation results into tables.
sterrors.docalculate the standard errors and other statistics based on the bootstrap, and
write_results_to_excel.pycollects the several specifications into one table.
- Estimate fixed costs. Given the estimated parameter values,
fixedcost.doestimates fixed costs and reports various statistics about them.
- Calculate the simulated equilibrium in a counterfactual scenario. This is done by
- Draw figures based on several counterfactual scenarios. This is done by
- Create production-ready figures. This is done by
Our estimates are based on a panel dataset of import transactions, balance sheets and earnings statements of Hungarian firms for the period 1992 to 2003. The “IEHAS-CeFiG Hungary” dataset is described in detail in
Békés, Gábor, Balázs Muraközy, and Péter Harasztosi. 2011. “Firms and Products in International Trade: Evidence from Hungary.” Economic Systems Research 35 (1): 4–24.
Because the data is confidential, we cannot make it available in this replication package.
Researchers interested in replicating our results with this same data, or conducting other academic research on this data, can access the dataset and the necessary data processing scripts at the premises of the Institute of Economics of the Hungarian Academy of Sciences. Please refer to http://www.mtakti.hu/english/ or contact the corresponding author, Miklos Koren at korenm at ceu dot edu.