Data and code for: Measuring the Export Potential of Yemeni Coffee: A Stochastic Frontier Gravity Analysis, 2014–2024

Published: 12 November 2026| Version 4 | DOI: 10.17632/5z3fbbj7zs.4
Contributors:
,
,

Description

Replication data and code for the article "Measuring the Export Potential of Yemeni Coffee: A Stochastic Frontier Gravity Analysis, 2014–2024" (Alathwari, Shan and Alshammari). Data: importer-reported (mirror) HS 0901 coffee trade from Yemen to 16 destinations, 2014–2024. The estimation panel has 176 destination-year cells (161 positive flows, 15 zeros). The destinations are the 16 largest of the 59 mirror partners by cumulative imports from Yemen over 2014–2024, after dropping aggregate reporters such as the European Union; each has positive imports in at least 7 of the 11 years. The raw workbook is included with the full mirror and direct trade series, comparator countries, importer GDP, distance, port and infrastructure indices, conflict, and other source sheets. Code (Python): rebuilds the panel from the workbook; estimates Log-OLS and PPML gravity models with destination-clustered standard errors and wild-cluster bootstrap p-values; fits the half-normal stochastic frontier with Battese–Coelli efficiency scores and potential-export gaps by destination and year; and produces the inefficiency-effects (Battese–Coelli 1995) model and the supplementary tables. Start with README.md, which lists which script reproduces which table. Sources: WITS/UNSD Comtrade, World Bank WDI and Logistics Performance Index, CEPII GeoDist, UCDP/PRIO.

Files

Steps to reproduce

1. Install Python 3.9 or later. Download all files of this dataset into one folder. 2. Open a terminal in that folder and install the packages: pip install -r requirements.txt 3. Rebuild the panel from the raw workbook and compare it with the deposited panel: python build_panel_from_workbook.py research_dataset.xlsx yemen_panel_16dest_final.csv. The last line should read "identical to the deposited panel". 4. Reproduce the baseline tables: python reproduce_baseline_tables.py --data yemen_panel_16dest_final.csv --out results. The script checks itself against the reported values (log-likelihood -291.175, likelihood-ratio statistic 36.065, 2024 gap of USD 45.810 million) and stops with an error if any differs. A singular-matrix warning for the observed-LPI-year regression is expected. 5. Reproduce the numbers in the paper: python replicate_revised_paper.py yemen_panel_16dest_final.csv research_dataset.xlsx. It prints the gravity, frontier, destination and annual results and writes new_numbers.json. Add --bootstrap to print the wild-cluster bootstrap p-values (slow). 6. Reproduce the supplementary tables and the inefficiency-effects scores: python supplement_tables.py yemen_panel_16dest_final.csv research_dataset.xlsx. It writes supplement_tables_output.txt and bc95_efficiency_scores.csv. On Windows, type py instead of python. README.md lists which script produces which table. The frontier with year effects sits at a corner solution, so its last digits can differ between computers.

Institutions

Categories

Econometrics, Agricultural Economics, International Trade, Applied Economics

Licence