[R] Fwd: How to sample from a linear mixed model

From: Douglas Bates <dmbates_at_gmail.com>
Date: Mon 20 Jun 2005 - 10:56:17 EST

I forgot to cc: R-help on this reply.

On 6/19/05, Søren Højsgaard <Soren.Hojsgaard@agrsci.dk> wrote:
> I would like to draw a sample from a linear mixed model y=Xb+Zu+e which has been fitted with lme(), i.e. a model y ~ N(Xb, C), where C=Z cov(u) Z' + cov(e).
> I've tried to figure out how to extract C from an lme object, because that would solve my problem when also using the predict() function, but without any luck.
> Can anyone help on that?

C is not stored in an lme object. In fact it is never created. (Consider the dimensions of this matrix. It could be huge.)

The easiest way to simulate data from a linear mixed model is to simulate u and e then form Xb+Zu+e

R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Mon Jun 20 11:00:29 2005

This archive was generated by hypermail 2.1.8 : Fri 03 Mar 2006 - 03:32:51 EST