What is reghdfe?
masterreghdfe is a Stata package designed to estimate linear regressions with multiple levels of fixed effects. It serves as a high-performance generalization of Stata's built-in areg, xtreg,fe, and xtivreg,fe commands.
Key capabilities include:
- Efficient Fixed Effect Absorption: Uses a robust algorithm to handle multiple fixed effects, performing well even in 'hard cases' where other algorithms fail to converge.
- High Speed: Significantly faster than alternatives like
reg2hdfe,a2reg,felsdvreg, andres2fe, especially when dealing with multiple fixed effects. - Advanced Clustering: Supports two-way and multi-way clustering of standard errors.
- Robust Estimators: Integrates with the
avarpackage for an extensive list of robust variance estimators. - IV and GMM Support: Works with instrumental-variable and GMM estimators (e.g., two-step-GMM, LIML) via the
ivreg2routine. - Flexible Modeling: Supports multiple heterogeneous slopes, frequency/probability/analytic weights, and time-series/factor variables.
- Convenience Features: Allows expressing fixed effects and clusters as factor interactions (e.g.,
state#year) and supports postestimation commands likepredictandtest. - Optimization: Includes a
cache()option to precompute results for faster subsequent regressions.