1
$\begingroup$

Let's suppose that I have a dataset where individual responses to a questionnaire are cross-classified within two grouping variables, G1 and G2.

Based on this very informative post, it seems that cross-classified models cannot be tested in lme4 if the G1 labels are all uniquely coded (e.g., if there are 10 different groups and they are coded 1-10). Regardless of lme4 syntax for nested vs. crossed, uniquely coded G1 labels will produce the output of a nested model.

On the other hand, a crossed model output can be obtained if the proper syntax is used [(1 | G1) + (1 | G2)] AND the G1 labels are symmetrical across the different values of G2 (e.g., 1-5 for G2=0; 1-5 for G2=1).

What about the situation when a cross-classified model is desired, but there are 3 or more grouping variables? How is it possible to have the G1 labels be symmetrical/non-unique across all values of G2 and G3 at the same time?

$\endgroup$
4
$\begingroup$

Have a look at the corresponding section for nested versus crossed random effects in the GLMM-FAQ. In the manner lme4 is programmed it is best practice to code the nested levels uniquely. In this manner, the corresponding model-fitting functions in the package will work correctly either you have a nested or crossed design.

| cite | improve this answer | |
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.