Skip to content
Prev 4754 / 20628 Next

parameterization for partly nested design with repeated measurements

On Fri, Nov 12, 2010 at 5:09 AM, Kay Cecil Cichini
<Kay.Cichini at uibk.ac.at> wrote:
This model is generating an interaction between the fixed-effects
factor "region" and the random-effects factor "school", which doesn't
make sense because each school occurs within only one region.

The simplest way to establish the desired structure is to create the
region, school and class factors so they follow the "each distinct
structure corresponds to a distinct level of the factor" rule.  For
example, if you call the regions "A", "B", "C" and "D" and you call
the schools "A01", ... "A10", "B01", ..., "B06", "C01", ..., "C12" and
you call the classes "A01a", "A01b", "A01c", ..., "C12d" then you can
specify the model very easily as

glmer(cbind(X, n - X) ~ region * interv + (1|school) + (1|class),
family = binomial)

Most of the confusion about model specification comes from the
unfortunate practice of labeling the schools as "01", ..., "12"
without taking into account that school 1 in region A is not
associated in any way with school 1 in region C.  In other words, all
you need to do is to disambiguate the names of the schools and the
classrooms.