1

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

> 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 月。

4

2 回答 2

0

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

于 2018-03-10T20:46:28.890 回答
0

你必须使用:cluster = "group"

于 2019-04-30T09:45:03.860 回答