Skip to content
Prev 10154 / 20628 Next

Design Matrix for Random effects

Steve Walker <steve.walker at ...> writes:
It can be done even one step more directly:

mkReTrms(list(quote(Days|Subject)),sleepstudy)$Zt

the slightly convoluted form of the first argument is because
mkReTrms (see ?mkReTrms) wants a list of the random-effects
bits extracted from the formula, so it needs to be a list
of 'language' objects.  Alternatively:

mkReTrms(findbars(~(Days|Subject)),sleepstudy)$Zt

 I have a minor preference for these because they depend
a little less on the detailed form in which things are
stored in the package.

  Ben Bolker