我可以使用plm()
来估计FE模型的鲁棒标准误差,但不能估计Hausman-Taylor(HT)。我需要HT估算器在模型中包含一些反映初始条件的时不变变量。参见下面使用Cigar
数据的示例。
data(Cigar, packege = "plm")
首先,我为63年的初始条件创建时不变变量
help.sales <- subset(Cigar, year == 63, select=c(state, sales))
names(help.sales)[2]<-"sales.63"
help.price <- subset(Cigar, year == 63, select=c(state, price))
names(help.price)[2]<-"price.63" #rename
Cigar <-merge(Cigar, help.sales, by = "state")
Cigar <-merge(Cigar, help.price, by = "state")
然后我估算有限元模型:
FE.Cigar <- plm(price ~ sales.63:year + ndi + factor(year) |
sales.63:year + sales.63 + ndi + factor(year), data = Cigar,
model="within", effect = "individual", index = c("state","year"))
和HT模型:
HT.Cigar <- plm(price ~ sales.63:year + sales.63 + price.63 + ndi + factor(year) |
sales.63:year + sales.63 + ndi + factor(year), data = Cigar,
model="random", random.method ="ht", inst.method = "baltagi",
effect = "individual", index = c("state", "year"), na.action = na.exclude)
虽然FE的以下各项可以毫无问题地估计出健壮的标准误差:
coeftest(FE.Cigar, vcov.=function(x) vcovHC(x, type="sss", cluster="group"))
当我尝试对HT进行相同操作
coeftest(HT.Cigar, vcov.=function(x) vcovHC(x, type="sss", cluster="group"))
有人指出了类似的问题here,但是鉴于该职位已经有5年历史了,我想知道是否有解决方案。