【问题标题】:Wild cluster bootstrap in panel data regression in RR中面板数据回归中的野生集群引导
【发布时间】:2016-07-12 08:33:24
【问题描述】:

我正在 R 中进行面板数据回归。数据集包括几年来各州(瑞士司法管辖区)的几个变量。 准备数据:

> install.packages("clusterSEs")
> library(clusterSEs) 
> fakefunk <- plm.data(dataset1, c("canton","year"))

我估计了以下固定效应模型:

> ffe2 <- plm(logPCexp_r~dummy_bref+sigperpop20_gini_all, model="within", effect="time", data = fakefunk)

到目前为止一切顺利。我的集群很少,因此我想使用 Cameron, Gelbach & Miller (2008) 之后的 wild cluster bootstrap-t 程序。数据集中在州一级。我使用以下命令,产生后续错误消息:

> cluster.wild.plm(ffe2, fakefunk, cluster="canton", ci.level = 0.95, boot.reps = 1000, report = TRUE, prog.bar = TRUE)
Error in cluster.wild.plm(ffe2, fakefunk, cluster = "canton", ci.level = 0.95,  : 
   invalid clustering variable; see help file

我的问题很简单:我做错了什么?有关该命令的文档很短。显然我不能聚集在“canton”上。如果我选择“组”,它也不起作用。

参考文献:A. Colin Cameron & Jonah B. Gelbach & Douglas L. Miller,2008 年。 “基于引导程序的聚类错误推理改进”,经济学与统计评论,麻省理工学院出版社,第一卷。 90(3),第 414-427 页,8 月。

【问题讨论】:

    标签: r cluster-analysis economics


    【解决方案1】:

    尝试使用:cluster = ~canton 而不是 cluster = "canton"

    【讨论】:

      【解决方案2】:

      你必须使用:cluster = "group"

      【讨论】:

        猜你喜欢
        • 2021-08-05
        • 1970-01-01
        • 1970-01-01
        • 2020-12-15
        • 2021-09-26
        • 1970-01-01
        • 1970-01-01
        • 2012-08-24
        • 2014-09-12
        相关资源
        最近更新 更多