Tutorials › Generalized Linear Mixed Models (GLMM) › Recognizing Crossed Factors in Repeated Measurements

Crossed and Nested Random Effects · Tutorial 483 of 698

Recognizing Crossed Factors in Repeated Measurements

Recognize when repeated-measurement observations combine levels of multiple crossed factors, and separate that structure from replication within a single factor.

Advanced 9 min read

What You'll Learn

  • Define crossed classifications using the combinations of factor levels represented in the design.
  • Distinguish a shared within-subject condition, such as visit or treatment, from replicate measurements indexed only within a subject.
  • Use observation tables and factor-incidence counts to check whether classifications are crossed or nested.
  • Separate the structure of a design from the choice to treat a factor as fixed or random.
  • Identify common labeling and interpretation mistakes in repeated-measurement data.

Why Repeated Measurements Can Involve More Than One Factor

Repeated measurements are often described as measurements taken several times on the same person, animal, or other unit. That description identifies the repeated unit, but it may not capture the full design. If each person is measured under several shared conditions, such as the same set of visits, treatments, or test items, each observation is also associated with a level of that second factor. The structure is then defined by the combinations of levels that produce observations.

Recognizing those combinations matters because the design tells us which classifications are related to each observation. It does not, by itself, determine the response distribution, the link function, or whether a factor should be fixed or random. Those are separate modeling decisions. Here the task is to read the design accurately before choosing a model.

Definition: Two classifications are crossed when their levels combine in the design rather than one classification being contained within a single level of the other. In a fully crossed design, every level of one classification occurs with every level of the other. A classification is nested within another when each of its levels belongs to just one level of that other classification. In repeated-measurement data, the observational unit is often a combination of levels, such as one participant measured on one item or at one visit.

These terms describe the design and indexing, not the distribution of outcomes. The earlier material on nesting explains how to recognize a containment relationship from a sampling design. The practical question here is whether repeated measurements also involve another shared classification.

A Design-Based Check for Crossing

Start by identifying the observational unit represented by one row of the data. Then name the classifications that assign a level to each row. For two classifications, an incidence table can show which pairs actually occur: rows represent levels of one factor, columns represent levels of the other, and each cell records how many observations have that pair of levels.

In a complete crossing, every cell has at least one observation. More generally, crossing is about the design relationship: levels are shared across the other classification rather than being confined to a single level. An absent cell in an observed data set does not automatically prove nesting; the design plan and reason for the absence matter. Detailed treatment of incomplete crossing is a separate topic.

For a compact check, let \(A\) and \(B\) denote two classifications. In a complete crossing with one observation per pair, the number of observational units is the product of the numbers of levels:

$$ N = |A|\,|B| $$

This count is a design check, not a model assumption. If observations are repeated within a pair, the count of rows can exceed the number of distinct pairs; if only some pairs are represented, it can be smaller. The key is to distinguish the number of rows from the number of factor-level combinations.

Worked Example: Participants Measured on Shared Test Items

Suppose a hypothetical experiment records a response from each of 6 participants on each of 4 common test items, with one response per participant-item pair. Is participant crossed with item?

Each row represents one participant’s response to one item. The classifications are participant, with 6 levels, and item, with 4 levels. Because every participant responds to every item, the design is fully crossed.

The complete design should contain \(6 \times 4 = 24\) participant-item pairs. The stated data have one row per pair, so the row count is also \(24\). Each participant contributes \(4\) observations, and each item contributes \(6\):

$$ 6 \times 4 = 24,\qquad 6 \times 4 = 24 $$

The first product counts all distinct pairs; the second is the number of observations given one response per pair. Participant and item are crossed because items are shared across participants and participants are represented across items. The structure does not imply that either factor must be random: that depends on the scientific target and the model.

Shared Conditions Versus Replicates Within a Unit

A common repeated-measures design records each subject under a set of conditions shared by the subjects. If the conditions are visits labelled baseline, week 2, and week 6, for example, subject and visit form two classifications. Each subject appears at multiple visits, and each visit is observed for multiple subjects. That is a subject-by-visit crossing.

By contrast, a data set may contain several replicate readings for each subject without a meaningful shared condition classification. If the readings are simply repeated technical measurements, each reading is indexed within its subject. Calling the reading “replicate 1” for every subject does not automatically make replicate number a scientifically meaningful crossed factor. The label must correspond to a shared condition or classification, not just a convenient counter.

Worked Example: Subjects Measured at Common Visits

In a hypothetical study, 5 volunteers each provide a measurement at baseline, week 2, and week 6. Assume all 5 provide data at all 3 visits and there is one measurement per volunteer per visit. Determine the design structure.

A row corresponds to a volunteer-visit pair. There are \(5\) volunteer levels and \(3\) visit levels. The complete crossing contains \(5 \times 3 = 15\) pairs, matching the \(15\) recorded measurements:

$$ 5 \times 3 = 15 $$

Each visit is shared by all \(5\) volunteers, and each volunteer is measured at all \(3\) visits. Thus volunteer and visit are crossed. The observations are repeated within volunteer, but “repeated within volunteer” does not erase the visit classification; it describes how the measurements are organized. The conclusion relies on the stated design: the same visit labels refer to the same scheduled conditions across volunteers.

A different data structure would have one subject identifier and, for each subject, three technical readings labelled only as replicates. If the replicate readings have no common condition meaning across subjects, the natural description is multiple measurements within subject, not a subject-by-condition design. If replicate position itself represents a shared, interpretable condition, then it can be treated as a second classification. The data labels alone cannot settle that question; the measurement protocol supplies the meaning.

Within-Subject Treatments Also Create Crossed Classifications

A treatment can be a within-subject factor when each subject receives multiple treatments. In that case, subject and treatment are crossed if the treatment levels are shared across subjects. This remains true if subjects receive treatments in different orders: order may affect the design, but the subject-treatment combinations are still the relevant pairings. Do not confuse the order in which conditions occur with the factor levels themselves.

Worked Example: Each Subject Receives Each Treatment

In a hypothetical crossover experiment, 4 subjects each receive treatments A, B, and C, with one recorded response for each subject-treatment pair. Is treatment nested within subject?

There are \(4\) subject levels and \(3\) treatment levels. If all combinations are observed once, the expected number of rows is:

$$ 4 \times 3 = 12 $$

The data contain \(12\) responses by construction: each of the \(4\) subjects has \(3\) responses, and each treatment has \(4\) subject responses. Treatment is not nested within subject because treatment A, for example, occurs for all \(4\) subjects. Rather, the subject and treatment classifications are crossed. A model may need to account for the repeated responses from the same subject, but identifying that dependence is not the same as deciding a particular model specification.

Justifying the Crossing Check

The distinction can be made by asking whether a level is confined to one level of the other classification. If every item belongs to just one participant, then item is nested within participant: an item level cannot be shared across participants. If the same item levels occur for multiple participants and each participant has multiple items, neither classification is contained in the other.

For a fully crossed design, the check follows directly from the pair structure. With \(a\) levels of \(A\) and \(b\) levels of \(B\), each of the \(a\) levels must pair with all \(b\) levels. There are \(b\) pairs for each level of \(A\), so the total number of pairs is \(ab\). Conversely, if a design contains all \(ab\) possible pairs, then each level of either classification occurs with every level of the other. Thus the product count and the incidence table provide two equivalent checks for a complete crossing.

$$ \text{number of pairs} = \sum_{i=1}^{a} b = ab $$

For non-complete data, the count alone is not enough. Inspect which pairs were intended and which are observed, and use the study protocol to decide whether an empty cell reflects missing data, an unplanned omission, or a genuinely different design. The broad definition of crossing remains about how classifications relate, not about whether every recorded cell happens to be filled.

Diagnostics, Alternatives, and Limitations

Several checks help prevent a design description from being driven by variable names alone:

  • Check the row definition. Confirm whether one row is a subject-condition observation, a subject-item observation, or a replicate measurement.
  • Check shared labels. Verify that a level such as “week 2” or “item 4” means the same condition for different subjects.
  • Tabulate pairs. Count observations for each pair of factor levels and compare the observed combinations with those specified by the design.
  • Check the protocol. Determine whether absent combinations were never planned or are missing from an intended crossing.

A common mistake is to say, “There are several measurements per subject, so the only structure is subjects with repeated observations.” That reasoning overlooks a shared visit, treatment, or item factor when one is present. The correction is to identify every classification attached to each row, then check whether its levels are shared across the other classification. The reverse mistake is to call any numbered replicate a crossed factor. A common counter is not enough: the replicate levels must represent meaningful shared conditions for that interpretation to be useful.

The main alternatives are a nested design, in which one classification is contained within another, and repeated observations indexed only within a subject, with no additional shared condition factor. These are structural descriptions, not competing statistical methods. Crossing alone does not establish independence, identify variance components, or dictate which effects belong in a generalized linear mixed model. It also does not diagnose missingness or resolve whether a factor is scientifically fixed or random. Those questions require further design and modeling information.

Key takeaway: For repeated-measurement data, name the observational unit and all classifications attached to each observation. Shared levels that combine across subjects indicate crossing; measurements that have no meaningful shared second classification are simply repeated within the subject.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Eight participants each respond to all 5 common prompts. How many participant-prompt pairs are there, and are participant and prompt crossed?
  2. Each of 12 patients has three technical readings. The readings are numbered 1, 2, and 3 but do not represent different conditions. What is the safest design description, and why?
  3. Four subjects each receive treatments A and B. Explain whether subject and treatment are crossed, assuming both treatments are given to every subject.
  4. Why is the row count alone insufficient to decide that two classifications are crossed when some planned combinations are absent?

Solutions. (1) There are \(8 \times 5 = 40\) pairs. Participant and prompt are crossed because each participant responds to each shared prompt. (2) There are repeated technical readings within each patient; the replicate numbers are not automatically a second meaningful condition factor. (3) The classifications are crossed: both treatment levels occur for all 4 subjects, giving \(4 \times 2 = 8\) subject-treatment pairs. (4) The same row count can arise from different patterns of pairings; inspect the incidence table and design plan to distinguish a planned nested structure from missing or unobserved combinations in an intended crossing.

Clinical Biostats