1

As a non-statistician I reached my limit here:

I try to fit a Poisson model for panel data (using pglm) and I want to calculate robust standard errors (using lmtest).

My code currently looks like this:

#poisson model (panel with year fixed effects):
poisson_model <- pglm(y ~ a + b + c + factor(year), data = regression_data,
model = "pooling", family = poisson, index = c("ID", "year"))

#robust standard errors:
robust_SE_model <- coeftest(poisson_model, vcov. = vcovHC(poisson_model, type = "HC1"))

This code works fine for one of my other model specifications when I fit a regular panel model with plm, but when I try the poisson model with pglm I receive the following error message:

Error in terms.default(object) : no terms component nor attribute

Is this due to a limitation of the lmtest package or am I making a mistake here? I really hope I can solve the problem using packages (not necessarily pglm and lmtest) and don't have to dive into manual calculation of robust errors.

Any help is highly appreciated!

sspade
  • 63
  • 6
  • 2
    As far as I can decipher from `?pglm`, the library does not support sandwich error matrices. https://cran.r-project.org/web/packages/poisFErobust/index.html or https://cran.r-project.org/web/packages/glmmML/ might be useful. – Otto Kässi Nov 09 '18 at 12:15
  • @OttoKässi Thanks, that was indeed the problem. The packages you mention will help me for sure. The whole robust errors for models which are non-linear in the parameters topic is a highly controversial one, which I was not completely aware of so far. So applying robust errors if there is heteroscedasticity does not cure any problems obviously: https://davegiles.blogspot.com/2013/05/robust-standard-errors-for-nonlinear.html – sspade Nov 22 '18 at 09:29

0 Answers0