[R] cross-classified random factors in lme without blocking
Gordon Smyth
smyth at wehi.edu.au
Sat Nov 15 05:25:39 CET 2003
Many thanks for help from Peter Dalgaard, Douglas Bates and Bill Venables.
As a result of their help, here is a working example of using lme to fit an
additive random effects model. The model here is effectively y~a+b with a
and b random:
y <- rnorm(12)
a <- gl(4,1,12)
b <- gl(3,4,12)
u <- gl(1,1,12)
library(nlme)
fm <- lme(y~1,random=list(u=pdBlocked(list(pdIdent(~a-1),pdIdent(~b-1)))))
summary(fm)
I still can't see though how to extract the three variance components (for
a and b and for the residual) from the fitted object 'fm'.
Thanks
Gordon
More information about the R-help
mailing list