design matrix for mixed effects model
On Tue, Jan 11, 2011 at 1:59 AM, Andreas B?ck <andreas.boeck at tum.de> wrote:
Hi Wade, For a model y ~ x1 + x2 + (x1 + x2 | id) you get the random effects design matrix via model.matrix(~ 0 + id + (x1 + x2):id)
That will produce a dense model matrix for the random effects. Depending on the number of levels of id and the number of observations that matrix could be huge. The lme4 package uses sparse model matrices for the random effects terms, which is a key to the performance on large problems.