fereg: Fast High-Dimensional Fixed-Effects Regressions in Stata
Regressions with many fixed effects are central to applied research, but fitting them to large datasets can be slow. In this article, I present the commands fereg and feppml, which fit linear and Poisson pseudo-maximum-likelihood regressions with high-dimensional fixed effects. Both commands use familiar Stata syntax and pass the computation to a compiled plugin. The plugin chooses among projection, Krylov, and multigrid solvers according to the structure of the fixed effects, checks every result before posting it, and runs on several processor cores. The commands support multiple and interacted fixed effects, group-specific slopes, regression weights, robust and multiway clustered standard errors, saved fixed effects, and prediction. Two simulated examples illustrate their use. In simulated designs with up to ten million observations and default stopping settings, fereg was 6–204 times faster than reghdfe and feppml 11–103 times faster than ppmlhdfe. The commands were also faster than fixest (R) and PyFixest (Python) in all 53 simulated configurations and than the Julia packages FixedEffectModels.jl and GLFixedEffectModels.jl in 52 of 53, with geometric-mean time ratios between 3.0 and 7.7. On administrative data with 1.2 million workers and 117,000 firms, fereg and feppml were at least 3.4 times faster than every other command at every number of cores.
-
-
Copy CitationJohannes F. Schmieder, "fereg: Fast High-Dimensional Fixed-Effects Regressions in Stata," NBER Working Paper 36017 (2026), https://doi.org/10.3386/w36017.Download Citation
-