fereg: Fast High-Dimensional Fixed-Effects Regressions in Stata
Johannes F. Schmieder
No 36017, NBER Working Papers from National Bureau of Economic Research, Inc
Abstract:
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.
JEL-codes: C23 C55 C63 C87 (search for similar items in EconPapers)
Date: 2026-11
Note: LS TWP
References: Add references at CitEc
Citations:
Downloads: (external link)
http://www.nber.org/papers/w36017.pdf (application/pdf)
Access to the full text is generally limited to series subscribers, however if the top level domain of the client browser is in a developing country or transition economy free access is provided. More information about subscriptions and free access is available at http://www.nber.org/wwphelp.html. Free access is also available to older working papers.
Related works:
This item may be available elsewhere in EconPapers: Search for items with the same title.
Export reference: BibTeX
RIS (EndNote, ProCite, RefMan)
HTML/Text
Persistent link: https://EconPapers.repec.org/RePEc:nbr:nberwo:36017
Ordering information: This working paper can be ordered from
http://www.nber.org/papers/w36017
The price is Paper copy available by mail.
Access Statistics for this paper
More papers in NBER Working Papers from National Bureau of Economic Research, Inc National Bureau of Economic Research, 1050 Massachusetts Avenue Cambridge, MA 02138, U.S.A.. Contact information at EDIRC.
Bibliographic data for series maintained by ().