I am running a mixed-effects linear model, with one random effect that is a factor with multiple levels and is an intercept-only model. Like this:
lmer(y ~ x1 + x2 + x3 + (1|factor(x4)), data=data)
The output of my model in R
includes an intercept (fixed)
, my fixed factors, and an intercept (x4)
. I've typically never used regressions to predict out-of-sample values, only for descriptives. But, let's say I had a new observation with a level that is either
- Not in
x4
, or - If I knew nothing about what level this new observation is in, but I had a gun to my head and had to make a prediction anyway.
To come up with a prediction:
intercept (fixed) + b1*new1 + b2*new2 + b3*new3
, but what do I do with the random intercept? In my case, is it reasonable to simply add the intercept (x4)
term that is outputted from my model to come up with my y
estimate?