I fitted a linear mixed model with R as follows.

lmme3cs = lme(LAZ ~ group_k + x1 + x2 + x4 + x6 + x1_k + x2_k + x4_k + x6_k,
              random = ~1|SECTORID/CHILDUID,
              correlation = corCompSymm(form = ~1|SECTORID/CHILDUID), data=dat2c)

It has 50043 observations, but the object 'lmme3cs$fitted' is a 50043 by 3 matrix which has three columns fixed, SECTORID, and CHILDUID. What are these three columns?


1 Answer 1


They are the fitted values at different levels of grouping. For example, if you fit

> library(nlme)
> fmOxide <- lme(Thickness ~ 1, Oxide, ~1|Lot/Wafer)

you can get the predicted overall outcome by

> fitted(fmOxide, level = 0)

and it is 2000.153. The predicted outcomes for each Lot are:

> fitted(fmOxide, level = 1)

and there are eight outocomes as there are eight Lots. The predicted outcomes for each Wafer, which are nested within Lots, are:

> fitted(fmOxide, level = 2)

If you run

> fitted(fmOxide, level = 0:2)

you get the predicted outcomes for each level of grouping, i.e. fmOxide$fixed.

  • 1
    $\begingroup$ +1. Sometimes when I see answers like this not having a single up-vote I wonder... $\endgroup$
    – usεr11852
    Mar 24, 2015 at 10:14

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.