ftools
package (use it if you have large datasets!)reghdfe
is now written entirely as a Mata object. For an example of how to use it to write other programs, see here
inv(xx)
)reghdfe
now depends on the ftools
package (and boottest
for Stata 12 and older)reghdfe
but through ivreg2
. See this port, which adds an absorb()
option to ivreg2
.regife
, poi2hdfe
, ppml_panel_sg
, etc.), check that they have been updated before using the new version of reghdfe.cache
and groupvar
.old
optionavar
package)reghdfe
implements the estimator described in Correia (2017).
If you use it, please cite either the paper and/or the command's RePEc citation:
@TechReport {Correia2017:HDFE,
Author = {Correia, Sergio},
Title = {Linear Models with High-Dimensional Fixed Effects: An Efficient and Feasible Estimator},
Note = {Working Paper},
Year = {2016},
}
Correia, Sergio. 2017. "Linear Models with High-Dimensional Fixed Effects: An Efficient and Feasible Estimator" Working Paper. http://scorreia.com/research/hdfe.pdf
Sergio Correia, 2017. reghdfe: Stata module for linear and instrumental-variable/GMM regression absorbing multiple levels of fixed effects. https://ideas.repec.org/c/boc/bocode/s457874.html
To find out which version you have installed, type reghdfe, version
.
reghdfe
4.x is not yet in SSC. To quickly install it and all its dependencies, copy/paste these lines and run them:
cap ado uninstall moresyntax
cap ado uninstall ftools
net install ftools, from("https://github.com/sergiocorreia/ftools/raw/master/src/")
cap ado uninstall reghdfe
net install reghdfe, from("https://github.com/sergiocorreia/reghdfe/raw/master/src/")
if (c(version)<13) cap ado uninstall boottest
if (c(version)<13) ssc install boottest
cap ssc install moremata
To run IV/GMM regressions, run these lines:
cap ado uninstall ivreg2hdfe
cap ssc install ivreg2
net install ivreg2hdfe, from("https://github.com/sergiocorreia/ivreg2_demo/raw/master/")
To install the stable version from SSC (3.x):
cap ado uninstall reghdfe
ssc install reghdfe
reghdfe
is a Stata package that estimates linear regressions with multiple levels of fixed effects. It works as a generalization of the built-in areg
, xtreg,fe
and xtivreg,fe
regression commands. It's objectives are similar to the R package lfe by Simen Gaure and to the Julia package FixedEffectModels by Matthieu Gomez (beta). It's features include:
areg
and xtreg,fe
(see benchmarks). Note: speed improvements in Stata 14 have reduced this gap.reg2hdfe
, a2reg
, felsdvreg
, res2fe
, etc.). Note: a recent paper by Somaini and Wolak, 2015 reported that res2fe
was faster than reghdfe
on some scenarios (namely, with only two fixed effects, where the second fixed effect was low-dimensional). This is no longer correct for the current version of reghdfe
, which outperforms res2fe
even on the authors' benchmark (with a low-dimensional second fixed effect; see the benchmark results and the Stata code).state#year
instead of previously using egen group
to generate the state-year combination).predict
and test
.cache()
option, so subsequent regressions are faster.Sergio Correia
Board of Governors of the Federal Reserve
Email: sergio.correia@gmail.com
This package wouldn't have existed without the invaluable feedback and contributions of Paulo Guimaraes, Amine Ouazad, Mark E. Schaffer, Kit Baum and Matthieu Gomez. Also invaluable are the great bug-spotting abilities of many users.
Contributors and pull requests are more than welcome. There are a number of extension possibilities, such as estimating standard errors for the fixed effects using bootstrapping, exact computation of degrees-of-freedom for more than two HDFEs, and further improvements in the underlying algorithm.
此处可能存在不合适展示的内容,页面不予展示。您可通过相关编辑功能自查并修改。
如您确认内容无涉及 不当用语 / 纯广告导流 / 暴力 / 低俗色情 / 侵权 / 盗版 / 虚假 / 无价值内容或违法国家有关法律法规的内容,可点击提交进行申诉,我们将尽快为您处理。