1)如何定义要基于哪些值进行聚类?我可以在“组”或“时间”之间进行选择,但是在哪里指定要使用哪个“组”或“时间变量”? 2)我在哪里写集群变量?我至少需要对3个变量进行聚类。
我尝试将群集写入coeftest公式。但这是正确的吗?它总是返回相同的SE,而与我在其中输入的内容无关。
$
fit5plm=plm(PEinvolved~logVol+Leveraged+logVol*Leveraged, data=
PanelData, model = "pooling", index=c("id", Year"))
G <- length(unique(PanelData$Year))
N <- length(PanelData$Year)
dfa <- (G/(G - 1)) * (N - 1)/fit5plm$df.residual
time_c_vcov <- dfa * vcovHC(fit5plm, type = "HC0",cluster = "time")
coeftest(fit5plm, vcov = time_c_vcov,cluster=c("Year", "Country"))
waldtest(fit5plm, vcov = time_c_vcov, test = "F")
$