【问题标题】:Unable to get results for bank's fixed effect无法得到银行固定效应的结果
【发布时间】:2021-10-02 08:08:24
【问题描述】:

我将以下代码与面板数据一起使用。我可以得到年份固定效应,但我无法得到银行固定效应。我通过使用 lm 而不是通过 plm 来获得银行效应。

我正在分享示例数据:

p_data <- pdata.frame(data_1, index = c("id", "time"),drop.index = TRUE)

fixed1 <- plm(y ~ x, data=p_data, model="within")
summary(fixed1)

fixed2 <- plm(y ~ x + factor(year) - 1, data=p_data, model="within")
summary(fixed2)

fixed3 <- plm(y ~ x + factor(bank) - 1, data=p_data, model="within")
summary(fixed3)

fixed4 <- plm(y ~ x + factor(year) + factor(bank) - 1, data = p_data, model="within")
summary(fixed4)

【问题讨论】:

标签: r plm


【解决方案1】:

fixed3 已经是银行固定效应模型,因为默认的固定效应是单个效应(在您的情况下,id eq. to bank;只是编码不同)。看看银行固定效应的这两个模型:

fixed3.1 <- plm(y ~ x + factor(bank) - 1, data=p_data, model="pooling")
summary(fixed3.1)

fixed3.2 <- plm(y ~ x, data=p_data, model="within")
summary(fixed3.2)
fixef(fixed3.2)

对于双向模型,请查看:

fixed4.tw <- plm(y ~ x, data = p_data, model="within", effect = "twoways")
summary(fixed4.tw)
fixef(fixed4.tw)
fixef(fixed4.tw, effect = "time")
fixef(fixed4.tw, effect = "twoways")

【讨论】:

  • 我没有像在 fixed3.1 中显示的那样在 fixed4.tw 中获得个别银行的效果。像这样:估计标准。误差T值Pr(> | T |)X -2.6330 1.2434 -2.1175 0.0346349 *因子(银行)ALD 125.6838 62.3488 2.0158 0.0442727 *因子(银行)ANDH 128.2210 62.3488 2.0565 0.0401734 *因子(银行)轴210.9056 62.7811 3.3594 0.0008317 ** * 因子(银行)BNDH 142.8851 73.7119 1.9384 0.0530487 .
  • fixed4.tw 是一种双向模型,不像 fixed3.1 是一种单向模型。对于双向模型,与各自的单向效果相比,两个维度的效果会有所不同(尽管不是编码说明,您可能需要阅读单向和双向模型的理论)。但是,如果您只需要一些示例计算,查看 ?plm::fixef 中的示例可能就足够了。
猜你喜欢
  • 1970-01-01
  • 2015-11-15
  • 1970-01-01
  • 1970-01-01
  • 2018-05-12
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多