I wanto to run a two way fixed effects model and then correct standard errors.
mod3 = plm(Dir ~ Dist +Trade + GDP_sim +GDP +
GDP_capita_constant +Openess + GDP_g + Endowments +
US_PTA + Japan_PTA + FDI + Population+ Democracy+Rule_of_Law+Values+sim+
WTO, data= dfPTA, index = c("Country", "Year"),
model = "within",
effect = "twoway")
this works very well.
However, when running this line
m.2wfe.scc <- coeftest(mod3, vcov = vcovSCC(mod3, type = "HC3", cluster = "group"))
I get the following error message
Error in 1 - diaghat : non-numeric argument to binary operator
All my variables are either numeric or integers (except Country).
Interestingly, I can run
mod4 = plm(Dir ~ Dist + Trade + GDP_sim +GDP +
GDP_capita_constant+Population+FDI, data= dfPTA, index = c("Country", "Year"),
model = "within",
effect = "twoway")
m.2wfe.scc <- coeftest(mod4, vcov = vcovSCC(mod4, type = "HC3", cluster = "group"))
and it works. Alltough I dont see a difference between the subset variables and the full model.
Any ideas?