skip to content

Faculty of Economics

Journal Cover

Jochmans, K. and Verardi, V.

twexp and twgravity: Fitting Exponential Regression Models with Two-way Fixed Effects

Stata Journal

Vol. 20(2) pp. 468-480 (2020)

Abstract: In this article, we introduce the commands twexp and twgravity, which implement the estimators developed in Jochmans (2017, Review of Economics and Statistics 99: 478–485) for exponential regression models with two-way fixed effects. twexp is applicable to generic n × m panel data. twgravity is written for the special case where the dataset is a cross-section on dyadic interactions between n agents. A prime example is cross-sectional bilateral trade data, where the model of interest is a gravity equation with importer and exporter effects. Both twexp and twgravity can deal with data where n and m are large, that is, where there are many fixed effects. These commands use Mata and are fast to execute.

Keywords: st0604, twexp, twgravity, exponential regression, gravity model, panel data, two-way fixed effects

Author links: Koen Jochmans  

Publisher's Link: https://doi.org/10.1177%2F1536867X20931006



Cambridge Working Paper in Economics Version of Paper: twexp and twgravity: Estimating exponential regression models with two-way fixed effects, Jochmans, K. and Verardi, V., (2019)

Papers and Publications



Recent Publications


Faraglia, E., Marcet, A., Oikonomou, R. and Scott, A. Government Debt management: the Short and the Long of it Review of Economic Studies [2019]

Ambrus, A. and Elliott, M. Investments in Social Ties, Risk Sharing, and Inequality Review of Economic Studies [2020]

Li, Z. M., Laeven, R. J. A. and Vellekoop, M. H. Dependent Microstructure Noise and Integrated Volatility: Estimation from High-Frequency Data Journal of Econometrics [2020]

Biroli, P., Boneva, T., Raja, A. and Rauh, C. Parental Beliefs About Returns to Child Health Investments Journal of Econometrics [2020]