I can estimate robust standard errors for a FE model using plm()
, but not for a Hausman-Taylor (HT). I need the HT estimator to include in my model some time invariant variables, which reflect initial conditions. See below an example using the Cigar
data.
data(Cigar, packege = "plm")
First, I create time invariant variables for initial conditions in year 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")
Then I estimate the FE model:
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"))
and the HT model:
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)
While the robust standard errors can be estimated without any problems with the below for the FE:
coeftest(FE.Cigar, vcov.=function(x) vcovHC(x, type="sss", cluster="group"))
when I try to do the same for the HT
coeftest(HT.Cigar, vcov.=function(x) vcovHC(x, type="sss", cluster="group"))
I receive the following error message:
A similar problem was indicated here, but given that that post is 5 years old, I was wondering if there are any solutions.