Skip to content
Prev 5100 / 20628 Next

design matrix for mixed effects model

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)

Best,
Andi