[R] Prediction with two fixed-effects - large number of IDs
milujisb at gmail.com
Sat Jun 17 20:24:05 CEST 2017
I am running a panel regression with time and location fixed effects:
reg1 <- lm(lny ~ factor(id) + factor(year) + x1+ I(x1)^2 + x2+ I(x2)^2 ,
My goal is to use the estimation for prediction. However, I have 8,500 IDs,
which is resulting in very slow computation. Ideally, I would like to do
reg2 <- felm(lny ~ x1+ I(x1)^2 + x2+ I(x2)^2 | id + year , data=mydata,
However, predict does not work with felm. Is there a way to either make lm
faster or use predict with felm? Is parallelizing an option?
Any help will be appreciated. Thank you!
[[alternative HTML version deleted]]
More information about the R-help