[R-sig-ME] Help understanding residual variance

Greg Snow 538280 at gmail.com
Tue Mar 27 17:32:10 CEST 2012


Yes, each person has their own slope and intercept estimated, however
the slope and intercept are not determined solely by the 2 data points
for that person, but also are affected by the slope and intercept
estimates across all subjects (this is why lmer gives value beyond
lmList).

You can see this if you refit using the nlme package (only because it
has the augPred function which has not been implemented in lme4 yet):

library(nlme)
m2 <- lme( Reaction ~ Days, data=tmp, random=~Days|Subject)
plot(augPred(m2, ~Days, level=c(0,1)))

comparing the m2 model to your m1 gives the same fixed effects, but
slightly different random effects (I probably did not do something
that was needed to make the models exactly the same) but is probably
close enough.

Look at the plot and you will see the fixed effects line, the line for
each subject that includes the random effects, and the data.  The line
for the individual subjects are pulled slightly towards the fixed
effects line and so does not hit the 2 points exactly.  This shows how
the estimate of each individuals values are influenced by the overall
fit.


On Mon, Mar 26, 2012 at 8:18 PM, Ista Zahn <istazahn at gmail.com> wrote:
> Hi all,
>
> I'm trying to understand what the residual variance in this model:
>
> tmp <- subset(sleepstudy, Days == 1 | Days == 9)
> m1 <- lmer(Reaction ~ 1 + Days + (1 + Days | Subject), data = tmp)
> tmp$fitted1 <- fitted(m1)
>
> represents. The way I read this specification, an intercept and a
> slope is estimated for each subject. Since each subject only has two
> measurements, I would expect the Reaction scores to be completely
> accounted for by the slopes and intercepts. Yet they are not: the
> Residual variance estimate is 440.278.
>
> This is probably a stupid question, but I hope you will be kind enough
> to humor me.
>
> Best,
> Ista
>
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



-- 
Gregory (Greg) L. Snow Ph.D.
538280 at gmail.com




More information about the R-sig-mixed-models mailing list