Saturday, July 2, 2016

Stata Tip: Multiway Fixed Effects

I just discovered a funky little ado file that may be useful when running models with multiple sets of fixed effects on large data sets: rehgdfe.ado. I haven't tried it yet, but here is a description from the help file:

reghdfe is a generalization of areg (and xtreg,fe, xtivreg,fe) for multiple levels of fixed effects (including heterogeneous slopes), alternative estimators (2sls, gmm2s, liml), and additional robust standard errors (multi-way clustering, hac standard errors, etc).

Additional features include:

A novel and robust algorithm to efficiently absorb the fixed effects (extending the work of Guimaraes and Portugal, 2010).
Coded in Mata, which in most scenarios makes it even faster than areg and xtreg for a single fixed effect (see benchmarks on the Github page).
Can save the point estimates of the fixed effects (caveat emptor: the fixed effects may not be identified, see the references).
Calculates the degrees-of-freedom lost due to the fixed effects (note: beyond two levels of fixed effects, this is still an open problem, but we provide a conservative approximation).
Iteratively removes singleton groups by default, to avoid biasing the standard errors (see ancillary document).


No comments:

Post a Comment