tomzylkin / ppml_fe_bias

bias corrections for PPML estimation of two-way and three-way fixed effects models
9 stars 0 forks source link

ppml_fe_bias: bias corrections for two-way and three-way fixed effects models estimated via PPML

ppml_fe_bias is a Stata package that implements analytical bias corrections described in Weidner and Zylkin (2021) for PPML “gravity” regressions with two-way and three-way fixed effects, as are commonly used with international trade data and other types of spatial flows. As shown in Weidner and Zylkin (2021), when the time dimension is fixed, the point estimates produced by three-way PPML gravity have an asymptotic incidental parameter bias of order 1/N, where N is the number of countries, and the cluster-robust sandwich estimator that is typically used for inference itself has a downward bias that is also of order 1/N. For the two-way PPML gravity model, only the standard errors are biased.

Recent updates

Example output

Three-way fixed effects example

example output

Two-way fixed effects example

example output (2 way)

These examples follow the included .do file and data set. Note that only the standard errors are biased in the case of the two-way model. In the three-way model, the point estimates also suffer from some bias.

Citation

Weidner, Martin, and Thomas Zylkin. "Bias and consistency in three-way gravity models." Journal of International Economics 132 (2021): 103513.

Installation

ppml_fe_bias requires the latest versions of hdfe, gtools, rowmat_utils, and frmttable

To install from within Stata, there are two options. To install the latest version from the official SSC repository, type

ssc install ppml_fe_bias, replace

Or, to install from github, type:

net install ppml_fe_bias, from("https://raw.githubusercontent.com/tomzylkin/ppml_fe_bias/master/src") replace

You will also need to make sure the following packages are installed:

ssc install outreg, replace
ssc install hdfe, replace
ssc install gtools, replace
ssc install rowmat_utils, replace

After installing, you can then access a help file with more information in the standard way by typing

help ppml_fe_bias 

An online version of this help file with additional details is also available here.