简体   繁体   English

R中使用LFE(FELM)的固定效果回归常数/拦截

[英]Fixed Effects Regression Constant / Intercept Using LFE (FELM) in R

When calculating a panel data regression with multiple fixed effects using the felm() (of the lfe package), no constant / intercept is generated in the summary results. 当使用felm() (属于lfe软件包)计算具有多个固定效果的面板数据回归时,摘要结果中不会生成常数/截距。

How can I generate a constant / intercept? 如何生成常数/截距?

When using Stata ( xtreg , fe ), for example, an intercept is generated by default. 例如,当使用Stata( xtregfe )时,默认情况下会生成拦截。

(I apologize in advance for not providing a reproducible example...) (对于未提供可复制的示例,我深表歉意...)

Here is an excerpt from Simen Gaure's article in The R Journal (Vol. 5/2, December 2013) https://journal.r-project.org/archive/2013/RJ-2013-031/RJ-2013-031.pdf 这是Simen Gaure在The R Journal(Vol.5 / 2,2013年12月) https://journal.r-project.org/archive/2013/RJ-2013-031/RJ-2013-031上的文章摘录。 pdf格式

"The careful reader has noticed that the behaviour of summary() on a 'felm' object with respect to degrees of freedom and R2 is the same as that of on an 'lm' object when including an intercept. There is no explicit intercept in the result of felm(), but the factor structure includes one implicitly. " “细心的读者已经注意到,摘要()一个‘felm’对象上的相对于自由度和R2的行为是相同的,包括一个截距当‘为1m’对象。 有一个在没有显式的截距felm()的结果,但因子结构隐式包括一个。

What if I want the intercept?? 如果我想要拦截怎么办? How would I generate it in the results? 如何在结果中生成它?

Thank you! 谢谢!

If you are using felm with only one or two fixed effects, I believe you can retrieve an intercept term using the getfe function with ef option set to 'zm2' . 如果您使用的felm仅具有一个或两个固定效果,我相信您可以使用ef选项设置为'zm2' getfe 'zm2'getfe函数来检索拦截项。 Eg using an estimated felm object called "result", we can recover the fixed the values of the fixed effects 例如,使用一个称为“结果”的估计felm对象,我们可以恢复固定效果的固定值

df = getfe(result, ef='zm2')

Then the intercept is contained in the row of df labeled "icpt" or "icpt.1". 然后,截距包含在标记为“ icpt”或“ icpt.1”的df行中。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM