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:
dear listers, i'd very much appreciate help with setting up the right parameterization for the following design: 4 regions, in each region 3 to 12 schools, at each school 2-4 classes and each class tested before and after intervention, yielding a bimomial outcome (pupils that passed / not passed a test). i'm interested in differences between before and after (factor = "interv") intervention outcomes (X = passed, n = passed + not passed) and in the interaction region * interv. i tried with: glmer (cbind(X, n - X) ~ region * interv + (region | school / class), family = binomial)
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.
and with: glmer (cbind(X, n - X) ~ region * interv + (1 | school / class), family = binomial) i'd be happy about comments on the parameterization or any ideas. yours, kay
_______________________________________________ R-sig-mixed-models at r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-sig-mixed-models