How to deal with NA in a panel data regression?

[亡魂溺海] 提交于 2019-12-03 00:21:44

I think this is something that predict.plm ought to handle for you -- seems like an oversight on the package authors' part -- but you can use ?napredict to implement it for yourself:

 pp <- predict(model, test.data)
 na.stuff <- attr(model$model,"na.action")
 (yhat <- napredict(na.stuff,pp))
 ## [1] 1.371429       NA 5.485714 7.542857 9.600000
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!