2017-04-23 489 views
0

我想用国家假人来估计国家固定效应。国家固定效应

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 

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

+0

您可能要检查出'lfe'包和'felm()'。 –

+0

感谢您的回复,但我完全无法弄清楚如何在文档中使用felm()和给定示例。我怎样才能使用这个模型,你能帮忙吗? – user5372470

回答

2

推测panel_eme_filtered是一个pdata.frame索引country_code?如果是这样的话,那么在回归方程中包括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) 
+0

非常感谢。由于我的面板数据是时间序列而不是聚类,因此我认为使用稳健的SE更好,因为每个国家有60个观测值。纠正我,如果我错了。 – user5372470