Consider a linear random intercept model:
\begin{align} y_{ij} &= A_{i} + \varepsilon_{ij} \\ A_{i} &\sim N(0,\tau^2) \\ \varepsilon_{ij} &\sim N(0,\sigma^2) \end{align}
where, $A_i$ and $\varepsilon_{ij}$ are iid and independent of each other. I would fit this in R with something like lmer(y ~ (1|id))
, where id
is the group index ($i$ in the previous sentence). What are the fitted values I get by calling fitted()
on the object returned by lmer
?
I have heard it said (perhaps the speaker was speaking loosely) that making an effect random instead of fixed doesn't affect the point estimate, just its variance. Well if I used a fixed intercept above I would expect OLS to give the group means as the fitted values, which is not what I get when I run fitted
on the random effects model. Also the remark I quoted doesn't seem quite right, because in the fixed effects case you would be fitting a term for each group whereas in the random effects case you would just have 1 df, right, the variance of the group effect? Is that right? Does the random effect likelihood equation integrate out the intercept values so just the group effect variance needs to be estimated? If my understanding is correct, and intercept terms are never estimated, how does one interpret fitted values in a random effects model?