Robust Standard Errors: Poisson Panel Regression (pglm, lmtest)

我的未来我决定 提交于 2021-01-29 10:33:28

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!