Error computing Robust Standard errors in Panel regression model (plm,R)

烂漫一生 提交于 2019-12-03 20:58:33

If I remember correctly, plm is not very verbose. I think it is possible to have a singular matrix but plm does not complain. lm is usually more verbose. So try

 lm_mod1 <- lm(y ~ x + I(x^2)+factor(date), data=reg_data)
 summary(lm_mod1)

lmwill tell you in it's summary output if there is a problem calculating one coefficient (coefficient is NA in the table and there should be a note at the top of the output as well). Edit: The note at top of lm's summary output should be "Coefficients: (1 not defined because of singularities)" in this case.

Edit There is another possibility why the coeftest is not working: If your model.matrix contrains very large values as well as very small values, solve might not be able to solve the system of linear equations by computation in the vcovHC function. Thus, have a look at model.matrix(y ~ x + I(x^2)+factor(date), data=reg_data) if this is the case. If so, try rescaling some variables (e.g. multiply oder divide by 100 oder 1000 [also log() makes sense sometimes). Take care, the interpretation of the coefficients changes due to the change of scales!

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