Java Mailing List Archive

http://www.r-help.com/

Home » Home (12/2007) » R Help for Statistical Computing »

[R] model matrix for random effects (lme)

Doran, Harold

2005-02-24


Greetings. Is it possible to extract the model matrix (Z) for the random effects from an lme object? For example, assume the model has two levels of random effects as in:

Y = XB + Zu + e

model.matrix() gives the matrix X only. For example:

> tt<-model.matrix(distance~age, Orthodont, random=~age|Subject)
> tt[1:10,]
 (Intercept) age
1        1  8
2        1 10
3        1 12
4        1 14
5        1  8
6        1 10
7        1 12
8        1 14
9        1  8
10       1 10

Thanks.
Harold

 [[alternative HTML version deleted]]

______________________________________________
R-help@(protected)
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
©2008 r-help.com - Jax Systems, LLC, U.S.A.