[R-sig-ME] crossed random effects example

Gabor Grothendieck ggrothendieck at gmail.com
Sun Mar 1 16:27:56 CET 2009


I suspect that the slide you are referencing mislabeled the
standard deviations as variances since there is reasonable
correspondence between your output and the slides if that
were the case.

Also check out:
http://www.stat.columbia.edu/~gelman/arm/examples/pilots/

On Sat, Feb 28, 2009 at 6:00 PM, Jeroen Ooms <j.c.l.ooms at uu.nl> wrote:
> I am trying to learn about crossed random effects modeling in lme4. I
> found this presentation that provides a small crossed dataset.
> http://www.biostat.jhsph.edu/~fdominic/teaching/bio656/lectures/5addsin.crosslevels.ppt
> I would like to reproduce the variance components as reported on slide
> 9 of the powerpoint. Here is my code:
>
> y <- c(0.38,0,0.38,0,.33,1,.12,1,.25,0,.5,.12,.5,1,.12,.86,.5,.67,.33,0,.14,1,0,1,.14,0,.71,0,.29,1,.14,1,.43,0,.29,.86,.86,.86,.14,.75)
> x2 <- rep(paste("airport",1:8,sep=""),5)
> x1 <- rep(paste("treatment",1:5,sep=""),rep(8,5))
> mydata <- data.frame(y=y,airport=x2,treatment=x1)
> lmer(y~1+(1|airport)+(1|treatment),data=mydata)
>
> However, the variance components as reported by lmer are different
> from the ones in the slides. What formula should I use? thank you!
>
> _______________________________________________
> 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