Suppose that I have the following dataset in R:
library(lme4)
data(Machines,package='nlme')
mydata <- Machines[Machines$Machine!='C',]
There are 3 levels with the factor Machine
, so the last line above is meant to limit to only two levels (A
and B
) of the factor Machine
. With the following model:
print(lmer(score ~ 1 + (1|Worker/Machine), data=mydata), ranef.comp="Var")
I have the variance components in the output as shown below:
Random effects:
Groups Name Variance
Machine:Worker (Intercept) 46.00
Worker (Intercept) 13.84
Residual 1.16
I have trouble understanding exactly what the first two components are: Machine:Worker
and Worker
. Specifically,
1) What is the variance for Worker
corresponding to the base (or reference) level of the factor Machine
? If so, what is the base level: the first level A
in the dataset or alphabetically the first level A
(it happens to be the same in this particular dataset)?
2) What is the variance for Machine:Worker
? Is it the variance for the second level of the factor Machine
, or the extra variance relative to the variance for Worker
?
Furthermore, for the model with the original dataset in which the factor Machine
has 3 levels,
print(lmer(score ~ 1 + (1|Worker/Machine), data=Machines), ranef.comp="Var")
what is the variance for Machine:Worker
in the following result since there are 3 levels involved in the factor Machine
?
Random effects:
Groups Name Variance
Machine:Worker (Intercept) 60.2972
Worker (Intercept) 7.3959
Residual 0.9246