[R-sig-ME] Understanding variance components
Chen, Gang (NIH/NIMH) [C]
gangchen at mail.nih.gov
Thu Jan 5 17:28:15 CET 2017
Suppose that I have the following dataset in R:
library(lme4)
data(Machines,package="nlme")
mydata <- Machines[Machines$Machine!='C’,]
With the following model:
print(lmer(score ~ 1 + (1|Worker/Machine), data=mydata), ranef.comp="Var")
I have the variance components 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 in the dataset or alphabetically the first level (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:
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
Thanks,
Gang
More information about the R-sig-mixed-models
mailing list