Statistics Glossary → Nested and crossed random effects
Nested and crossed random effectsconcept
Two structures describing how two grouping factors relate in mixed models: in a nested structure each level of one factor occurs within only one level of the other, while in a crossed structure their levels can combine in any way.
In a nested structure, each lower-level unit belongs to just one higher-level unit: pupils within classes, classes within schools. 'Pupil 1' in class A and 'pupil 1' in class B are different people, so the model is written (1 | school) + (1 | school:class) and lower-level identifiers are defined within the higher level. In a crossed structure the levels of the two factors are independent of each other: every participant responds to many items and every item is answered by many participants. Two separate random effects are then used, such as (1 | participant) + (1 | item).
Specifying the structure wrongly distorts the variance components and standard errors. For example, if lower-level units reuse the same codes in every higher-level unit and the model is set up as crossed, 'pupil 1' in different classes is treated as one person. Modelling a fully crossed structure as nested, on the other hand, overlooks the dependence created by a shared source (such as the same item). Partially crossed structures are also common (e.g. pupils taught by different teachers in different years), and mixed models can handle these as well.
An everyday example
In a field trial each village has several fields and each field several plots. Plots are within fields and fields within villages: a nested structure. If, however, the same five experts score every plot in every village, the expert factor is crossed with the plots: each expert sees each plot, and one expert's harsh or lenient scoring affects all villages.
In MerQur
It is set with the '2nd grouping variable and 2nd grouping relation (nested (within group 1), crossed)' parameter in Linear Mixed Models, 'Random factors: second factor and nested in upper factor' in Variance Components Analysis and 'Nested subgroup' in Hierarchical Bayesian Regression. The Crossed Mixed Model is built with crossed random factors.
Analyses where this concept appears
Linear Mixed Models (LMM)Crossed Mixed Model (Crossed LMM, Crossed Random Effects Mixed Model)Variance Components Analysis (VARCOMP)Hierarchical Bayesian Regression