【问题标题】:country-clustered standard errors with weighted plm带加权 plm 的国家集群标准误差
【发布时间】:2022-12-04 01:57:14
【问题描述】:

类似的问题 - 但不是这个确切的问题 - 已在此处发布,但没有适合我的解决方案。

我正在估算一个以 ID 固定效应和调查权重作为权重的 Diff-inDiff 模型。

我想要的是 R 给我国家集群标准错误。

fe <- plm(y ~ time*treatment + controls, data = data, index = c("ID","year"), weights = Surveyweights)

Treatment dummy 和 country dummy 是共线的,因为在我的数据中,治疗只分配给了两个国家之一。

我试过了:

coeftest(fe, vcov = vcovCL, cluster = ~country)
coeftest(fe, vcov. = vcovHC, type = "HC1")
coeftest(fe, vcov.=vcovHC(fe))
coeftest(fe, vcovHC(fe, type = 'HC0', cluster = 'country'))

但这些都不起作用。我总是收到 vcov 不适用于加权 plm 模型的错误

Error in vcovG.plm(x, type = type, cluster = cluster, l = 0, inner = inner,  : 
vcovXX functions not implemented for weighted panel regressions

也试过 felm,但这里时间和治疗的系数丢失了,这对治疗虚拟人(=国家虚拟人)有意义,但对时间虚拟人没有意义。

reg <- felm(y ~  time*treated + controls| ID + year | 0 | country, 
weights = crossweight, data = data)

有没有coeftest的解决方案?

【问题讨论】:

    标签: r plm standard-error


    【解决方案1】:

    @rstarter,你有没有找到解决这个问题的方法?我面临着类似的问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-05-24
      • 2017-10-17
      • 2021-06-27
      • 1970-01-01
      • 1970-01-01
      • 2013-05-21
      • 2021-10-01
      • 2011-01-25
      相关资源
      最近更新 更多