[R-sig-ME] Understanding variance components

Chen, Gang (NIH/NIMH) [C] gangchen at mail.nih.gov
Wed Jan 18 23:18:45 CET 2017


Happy New Year, Henrik! Thanks for explaining the details. A couple of days after I posted the question, I realized that my question was silly! Once I laid out the LME model equation, my original confusion was resolved.

Actually I meant to ask a slightly different question. Let me use the dataset embedded in your ‘afex’ package as an example:

data(obk.long, package = "afex”)

Suppose that my base model is

lmer(value ~ gender*phase+(1|id), data=obk.long)

Is there a way to specify a different variance for each gender in one model?

Thanks,
Gang


> On Jan 13, 2017, at 12:06 PM, Henrik Singmann <singmann at psychologie.uzh.ch> wrote:
> 
> Hi Gang,
> 
> Sorry that I so am late to the party, but in case you are still interested I will reply (and, of course, for the archive).
> 
> The answer is basically given in the old faq:
> http://glmm.wikidot.com/faq#toc27
> 
> (1|site/block) = (1|site)+(1|site:block)
> 
> Which is exactly what is given in your output. A random intercept for Worker and a random intercept for each worker:Machine interaction.
> 
> To answer your questions. The random intercepts do not have base or reference levels. They are increments or decrements to the overall intercept for each level of Worker or the Machine:Worker combination. The reported variance is the estimated variance of these increments, which is most likely unequal to the actual variance you would obtain by calculating it from the estimated increments, which are sometimes called BLUPs (I wonder if a better term for those exist).
> 
> Hope that helps,
> Henrik
> 
> PS: Belated Happy New Year to everyone.
> 
> 
> Am 05.01.2017 um 17:28 schrieb Chen, Gang (NIH/NIMH) [C]:
>> 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
>> _______________________________________________
>> R-sig-mixed-models at r-project.org mailing list
>> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models
>> 
> 
> _______________________________________________
> R-sig-mixed-models at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models



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