问题
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!
来源:https://stackoverflow.com/questions/53224319/robust-standard-errors-poisson-panel-regression-pglm-lmtest