Skip to content
Prev 5265 / 20628 Next

very basic HLM question

2011/2/7 Sebasti?n Daza <sebastian.daza at gmail.com>:
I think the issue is that the estimates of the variance components are
different, which would then lead to different estimates of the ICC.

You mentioned in your original posting that the data are unbalanced
(i.e. there are different numbers of students in different schools).
The estimates returned from lmer are the REML estimates in this case.
Do you know how the other estimates are being calculated?  I'm not
sure that the naive calculation of within- and between- sums of
squares and equating expected mean squares with observed mean squares
works with unbalanced data.
As Paul indicated, it is more informative to say, "using ICC1 from the
multilevel package for R".  ICC1 is not part of the base R nor the
required packages.
That is using the raw mean squares, not the estimates of the variance
components.  I have, thankfully, forgotten most of what I know about
expected and observed mean squares but I am pretty sure that those
don't correspond to the REML estimates, even in the balanced case.

Consider the results from the Dyestuff data, which is part of the lme4
package and is balanced
Linear mixed model fit by REML ['merMod']
Formula: Yield ~ 1 | Batch
   Data: Dyestuff
REML criterion at convergence: 319.6543

Random effects:
 Groups   Name        Variance Std.Dev.
 Batch    (Intercept) 1764     42.00
 Residual             2451     49.51
Number of obs: 30, groups: Batch, 6

Fixed effects:
            Estimate Std. Error t value
(Intercept)  1527.50      19.38    78.8
$Batch
            (Intercept)
(Intercept)     1764.05
attr(,"stddev")
(Intercept)
    42.0006
attr(,"correlation")
            (Intercept)
(Intercept)           1

attr(,"sc")
[1] 49.5101
[1] 1764.05
[1] 2451.25
[1] 0.4184874
Error in lm.fit(x, y, offset = offset, singular.ok = singular.ok, ...) :
  0 (non-NA) cases
In addition: Warning message:
In Ops.factor(1, Batch) : | not meaningful for factors
Df Sum Sq Mean Sq F value   Pr(>F)
Batch        5  56358 11271.5  4.5983 0.004398
Residuals   24  58830  2451.2

You can see that the estimates of the residual variance are the same
for the two model fits but the mean square for batch is not the
estimate of the between-batch variance.