目前使用最多的面板数据模型仍然是固定效应模型 (FE),最一般的设定形式就是 「二维固定效应模型」
若要估计多维固定效应,
reghdfe
是目前运算速度最快的。
如下内容参见: http://scorreia.com/research/reghdfe-slides.pdf
Use it to control for unobservables that stay constant within an economic unit (workers, firms, exporters, importers, etc.)
Applications in many fields: accounting (DeHaan et al 2015), finance (Gormley et al 2015), labor (Guimarães et al 2015), trade (Mayer 2016), etc.
Linear, IV and GMM Regressions With Any Number of Fixed Effects http://scorreia.com/software/reghdfe/
reghdfe
: Index || Install || Quickstart || FAQ || Cite || Help
PDF 说明: Sergio Correia, 2016, Linear Models with High-Dimensional Fixed Effects: An Efficient and Feasible Estimator, Working Paper (also see reghdfe and the slides)
相关命令
-
help reg2hdfe
// -
help a2reg
// -
help gpreg
//
Description
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
andxtreg
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).
reghdfe | Frequently Asked Questions
Contents:
- What does “fixed effect nested within cluster” means?
- Can I use
reghdfe
with multi-way clustering but without fixed effects? - Can I absorb the fixed effects formed by the combination of two variables?
- I ran out of memory. What can I do?
- I want to repeat a regression with different outcome variables. Can I compute the transformations only once?
- Where is the constant?
- Why are there four R2s? Which one should I use?
- How can I combine
reghdfe
withesttab
orestout
? - In my model the number of FEs varies by observation. What can I do?
- I want to report a bug or contribute!
关于我们
- 【Stata 连享会(公众号:StataChina)】由中山大学连玉君老师团队创办,旨在定期与大家分享 Stata 应用的各种经验和技巧。
- 公众号推文同步发布于 CSDN-Stata连享会 、简书-Stata连享会 和 知乎-连玉君Stata专栏。可以在上述网站中搜索关键词
Stata
或Stata连享会
后关注我们。 - 点击推文底部【阅读原文】可以查看推文中的链接并下载相关资料。
- Stata连享会 精彩推文1 || 精彩推文2
联系我们
-
欢迎赐稿: 欢迎将您的文章或笔记投稿至
Stata连享会(公众号: StataChina)
,我们会保留您的署名;录用稿件达五篇
以上,即可免费获得 Stata 现场培训 (初级或高级选其一) 资格。 - 意见和资料: 欢迎您的宝贵意见,您也可以来信索取推文中提及的程序和数据。
- 招募英才: 欢迎加入我们的团队,一起学习 Stata。合作编辑或撰写稿件五篇以上,即可免费获得 Stata 现场培训 (初级或高级选其一) 资格。
- 联系邮件: StataChina@163.com
往期精彩推文
- Stata连享会推文列表1
- Stata连享会推文列表2
- Stata连享会 精彩推文1 || 精彩推文2
欢迎加入Stata连享会(公众号: StataChina)
网友评论