1

felm当使用(包的)函数lfe用于具有固定效果的面板数据时,如何获得截距('常量') ?

可重现的例子:

library(lfe)
set.seed(42)
x <- rnorm(100000)
f1 <- sample(10000, length(x), replace=TRUE)
f2 <- sample(10000, length(x), replace=TRUE)
y <- 2.13*x + cos(f1) + log(f2+1) + rnorm(length(x), sd=0.5)
est <- felm(y ~ x + G(f1) + G(f2))
summary(est)

这产生:

Call:
felm(formula = y ~ x + G(f1) + G(f2))

Residuals

Min 1Q Median 3Q Max
-1.9531308 -0.3018539 -0.0003573 0.3007738 2.2052754

Coefficients:
Estimate Std. Error t value Pr(>|t|)
x 2.130889 0.001768 1205 <2e-16 ***
---
Signif. codes: 0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1
Residual standard error: 0.5013 on 80000 degrees of freedom
Multiple R-squared: 0.9683 Adjusted R-squared: 0.9603
F-statistic: 122.1 on 19999 and 80000 DF, p-value: < 2.2e-16

注意没有拦截...

我在“lfe”包文档( https://journal.r-project.org/archive/2013/RJ-2013-031/RJ-2013-031.pdf )中注意到以下内容:

“细心的读者已经注意到,在包含截距时,'felm' 对象上的 summary() 行为关于自由度和 R 2 与 'lm' 对象上的行为相同。没有明确的截距在 felm() 的结果中,但因子结构隐含地包含一个"

谢谢你。

4

0 回答 0