[R] very basic HLM question

Sebastián Daza sebastian.daza at gmail.com
Sun Feb 6 00:18:01 CET 2011


Hi everyone,

I need to get a between-component variance (e.g. random effects Anova), 
but using lmer I don't get the same results (variance component) than 
using random effects Anova. I am using a database of students, clustered 
on schools (there is not the same number of students by school).

According to the ICC1 command, the interclass correlation is .44

 > ICC1(anova1)
[1] 0.4414491

However, I cannot get the same ICC from the lmer output:

 > anova2 <- lmer(math ~ 1 + (1|schoolid), data=nels88)
 > summary(anova2 <- lmer(math ~ 1 + (1|schoolid), data=nels88))

Linear mixed model fit by REML
Formula: math ~ 1 + (1 | schoolid)
    Data: nels88
   AIC  BIC logLik deviance REMLdev
  1878 1888 -935.8     1875    1872
Random effects:
  Groups   Name        Variance Std.Dev.
  schoolid (Intercept) 34.011   5.8319
  Residual             72.256   8.5003
Number of obs: 260, groups: schoolid, 10

Fixed effects:
             Estimate Std. Error t value
(Intercept)   48.861      1.927   25.36

The intercept random effect is 34.011. If I compute the ICC manually I get:

 > 34.011/(34.011+72.256)
[1] 0.3200523

According to my Anova analysis, the between-component variance is 59.004.
Does anyone know what the problem is? How can I get the 59.004 figure 
using R?


-- 
Sebastián Daza
sebastian.daza at gmail.com



More information about the R-help mailing list