国家固定效应

时间:2017-04-23 09:58:32

标签: r time-series regression panel-data

我正在尝试用国家假人来估计国家固定效应。

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

这给出了与低于1相同的系数:

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

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

1 个答案:

答案 0 :(得分:2)

大概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)