【问题标题】:Country fixed effects国家固定效应
【发布时间】:2017-09-20 01:09:46
【问题描述】:

我正在尝试使用国家虚拟变量来估计国家固定效应。

fe1b <- plm( 
  bond_GDP_local ~ real_r + equity_volatility, model = 'within', data = panel_eme_filtered
)

这给了我与以下相同的系数:

fe1bc <- plm( 
  bond_GDP_local ~ real_r + equity_volatility +country_code, model = 'within', data = panel_eme_filtered
)

即使我在方程式中输入了国家/地区虚拟变量,我也无法在结果中看到它。 这是否意味着第一个模型已经包含它?

谢谢

他们俩都给我这个:

Oneway (individual) effect Within Model

Call:
plm(formula = bond_GDP_local ~ real_r + equity_volatility, data = panel_eme_filtered, 
    model = "within")

Balanced Panel: n=8, T=60, N=480

Residuals :
   Min. 1st Qu.  Median 3rd Qu.    Max. 
-2.7200 -0.3450 -0.0927  0.2200  5.6200 

Coefficients :
                       Estimate    Std. Error t-value Pr(>|t|)  
real_r            -0.0331088985  0.0171886368  -1.926   0.0547 .
equity_volatility -0.0000003838  0.0000006396  -0.600   0.5488  
---
Signif. codes:  0 ‘***’ 0.001 ‘**’ 0.01 ‘*’ 0.05 ‘.’ 0.1 ‘ ’ 1

Total Sum of Squares:    345.7
Residual Sum of Squares: 342.7
R-Squared:      0.008731
Adj. R-Squared: -0.01025
F-statistic: 2.06979 on 2 and 470 DF, p-value: 0.1274

另一个问题:如何估计此模型中的稳健面板时间序列数据标准误?

【问题讨论】:

  • 您可能想查看lfe 包和felm()
  • 感谢您的回复,但我完全不知道如何在文档中给出的示例中使用 felm()。我如何使用该模型,您能帮忙吗?

标签: r time-series regression panel-data


【解决方案1】:

大概panel_eme_filtered 是一个以country_code 为索引的pdata.frame?如果是这种情况,那么在回归方程中包含country_code 并不重要。另一种方法是使用lfe

library(lfe)

fe2 <- felm(
  bond_GDP_local ~ real_r + equity_volatility | country_code,
  data = panel_eme_filtered
  )
summary(fe2, robust = T) # heteroskedastic robust SE's

您还可以使用

获得聚类标准错误
fe3 <- felm(
  bond_GDP_local ~ real_r + equity_volatility | country_code | 0 | country_code,
  data = panel_eme_filtered
  )
summary(fe3)

【讨论】:

  • 非常感谢。我认为最好使用稳健的 SE,因为我的面板数据是时间序列而不是集群数据,因为每个国家有 60 次观察。如果我错了,请纠正我。
猜你喜欢
  • 1970-01-01
  • 2021-12-24
  • 2019-02-10
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2013-11-08
相关资源
最近更新 更多