Skip to content
Prev 369845 / 398503 Next

Prediction with two fixed-effects - large number of IDs

I have no direct experience with such horrific models, but your formula is a mess and Google suggests the biglm package with ffdf. 

Specifically, you should convert your discrete variables to factors before you build the model, particularly since you want to use predict after the fact, for which you will need a new data set with the exact same levels in the factors. 

Also, your use of I() is broken and redundant.  I think formulas

lny ~ id + year + x1 + I(x1^2) + x2 + I(x2^2)

or

lny ~ id + year + x1^2 + x2^2

would obtain the intended prediction results.