[R-sig-ME] Don't understand this variance components output
Ben Bolker
bbolker at gmail.com
Wed Jan 29 05:23:51 CET 2014
On 14-01-28 08:06 PM, Stuart Luppescu wrote:
> Hello, I'm analyzing ratings of teacher performance on 9 components.
> Each teacher is rated between 1 and 6 times. The average number of
> ratings per teacher is about 3.5. The structure of the data is (teachers
> nested within observations) crossed by components. The lmer call is:
>
> lme6 <- lmer(rating ~ (1|tid.f) + (1|comp.f) + (1|tid.f/obsorder.f),
> data=ratings, REML=FALSE)
>
> The outcome is rating; tid.f is the teacher ID; comp.f is the component
> ID; obsorder.f is the observation. Here is the summary output:
>
> Random effects:
> Groups Name Variance Std.Dev.
> obsorder.f.tid.f (Intercept) 0.06574 0.2564
> tid.f (Intercept) 0.16309 0.4038
> tid.f.1 (Intercept) 0.03498 0.1870
> comp.f (Intercept) 0.01589 0.1261
> Residual 0.19696 0.4438
> Number of obs: 166405, groups: obsorder.f:tid.f, 18496; tid.f, 5486;
> comp.f, 9
>
> Fixed effects:
> Estimate Std. Error t value
> (Intercept) 2.82680 0.04252 66.49
>
> What I don't get is the line in the list of random effects labeled
> tid.f.1. What is this? Am I not specifying the model correctly?
tl;dr just use (1|tid.f/obsorder.f), drop (1|tid.f) -- it's redundant.
I don't know if it's a FAQ or not, but I feel like I've answered this
one before (maybe off-list though) ... the problem is that you've got
both (1|tid.f) (variation in intercepts among 'tid.f' levels) and
(1|tid.f/obsorder.f) (variation among obsorder.f nested within tid.f).
In particular, tid.f/obsorder.f expands to tid.f + tid.f:obsorder.f
(i.e., tid.f and obsorder.f nested within tid.f), so you have two tid.f
terms. Unlike regular (e.g. lm/glm) formulae, these redundant terms
don't automatically get merged ... I've tried to write code that would
reliably detect this sort of overparameterization, but so far I haven't
managed.
Ben Bolker
>
> Here is my sessionInfo:
> R version 3.0.2 (2013-09-25)
> Platform: x86_64-redhat-linux-gnu (64-bit)
>
> locale:
> [1] LC_CTYPE=en_US LC_NUMERIC=C LC_TIME=en_US
> [4] LC_COLLATE=en_US LC_MONETARY=en_US LC_MESSAGES=en_US
> [7] LC_PAPER=en_US LC_NAME=C LC_ADDRESS=C
> [10] LC_TELEPHONE=C LC_MEASUREMENT=en_US LC_IDENTIFICATION=C
>
> attached base packages:
> [1] stats graphics grDevices utils datasets methods
> base
>
> other attached packages:
> [1] plyr_1.8 reshape2_1.2.2 MCMCglmm_2.17 corpcor_1.6.6
> [5] ape_3.0-11 coda_0.16-1 tensorA_0.36 MASS_7.3-29
> [9] foreign_0.8-59 lme4_1.0-5 Matrix_1.1-1.1 lattice_0.20-24
>
> loaded via a namespace (and not attached):
> [1] compiler_3.0.2 grid_3.0.2 minqa_1.2.2 nlme_3.1-113
> splines_3.0.2
> [6] stringr_0.6.2 tools_3.0.2
>
> Thanks very much for the help.
>
More information about the R-sig-mixed-models
mailing list