Why the Grouping Structure Matters
Regression data are often described as though each row were an isolated observation. In applied settings, however, rows can share people, settings, or other features. Students may share a classroom and school; repeated records may come from the same patient; and patients may be seen by the same clinician. These relationships matter because observations with shared sources of variation may not provide as much independent information as the row count suggests.
A single grouping label is enough only when it adequately represents the relevant pattern of shared membership. Some data have a clear hierarchy, while other data have overlapping groupings. The central task here is to describe those relationships accurately before deciding how they should enter a regression analysis.
These terms describe how units are organized, not a numerical result. Nesting or crossing does not by itself prove that observations are correlated. It identifies plausible shared sources of dependence that an analysis should not overlook. The strength and form of any actual dependence depend on the setting and the outcome.
Recognizing a Nested Hierarchy
Consider a data set with one record per student. If each student is in one classroom, and each classroom is in one school, the membership runs upward through a hierarchy: student, classroom, school. Students in the same classroom share a classroom; students in different classrooms at the same school share a school but not a classroom. Students at different schools share neither of those groupings.
The structure can be represented by identifiers. A student identifier locates the individual student, a classroom identifier locates the classroom, and a school identifier locates the school. The membership rule is essential: a classroom must be associated with one school. If classroom labels such as “Room 12” are reused in different schools, the classroom’s full identifier must include the school as well. Otherwise, the label does not uniquely identify a classroom.
Worked Example: Students Within Classrooms Within Schools
Suppose a hypothetical data set records a reading score for each student. The table below shows six records. The labels are illustrative and are not real study data.
| Student | Classroom | School | Reading score |
|---|---|---|---|
| S1 | C1 | North | 72 |
| S2 | C1 | North | 78 |
| S3 | C2 | North | 75 |
| S4 | C3 | South | 81 |
| S5 | C3 | South | 77 |
| S6 | C4 | South | 84 |
Step 1: Check classroom membership. Students S1 and S2 belong to C1; S3 belongs to C2. Each classroom appears under one school only: C1 and C2 are in North, while C3 and C4 are in South.
Step 2: Check the hierarchy. Each student belongs to one classroom, and each classroom belongs to one school. Thus classrooms are nested within schools, and students are nested within classrooms (and, through their classrooms, within schools).
Step 3: Identify possible shared sources. S1 and S2 share a classroom and a school. S1 and S3 share a school but not a classroom. S1 and S4 share neither. Those relationships suggest different possible degrees or sources of dependence, but the table alone does not establish that any pair’s scores are correlated.
The observation count is six students, but it is not six schools or six classrooms. The relevant count depends on which grouping is important to a particular question. A student-level identifier cannot substitute for the classroom or school identifiers when the concern is shared membership at those levels.
Recognizing Crossed Classifications
In a crossed structure, two classifications overlap. For instance, a patient may have encounters with several clinicians, and each clinician may see several patients. Patient membership does not determine clinician membership, and clinician membership does not determine patient membership. Neither grouping is simply a parent group containing the other.
This structure is easy to misread if the rows are treated as though they belonged to one set of non-overlapping clusters. A patient identifier groups all records from one patient, but records from different patients may still share a clinician. A clinician identifier groups all records from one clinician, but records for one patient may occur under different clinicians. These are distinct ways for records to share a possible source of dependence.
Worked Example: Patients Seen by Multiple Clinicians
Imagine a hypothetical encounter data set with the following six visits.
| Visit | Patient | Clinician | Outcome score |
|---|---|---|---|
| V1 | P1 | A | 6 |
| V2 | P1 | B | 5 |
| V3 | P2 | A | 7 |
| V4 | P2 | C | 6 |
| V5 | P3 | B | 8 |
| V6 | P3 | C | 7 |
Step 1: Trace patient membership. P1 appears with clinicians A and B; P2 with A and C; and P3 with B and C. No patient is confined to one clinician.
Step 2: Trace clinician membership. Clinician A sees P1 and P2; B sees P1 and P3; C sees P2 and P3. No clinician sees only one patient.
Step 3: Classify the structure. Patient and clinician are crossed classifications. For example, V1 and V2 share patient P1 but have different clinicians; V1 and V3 share clinician A but have different patients. Each shared identifier marks a different relationship.
A patient-only cluster label can represent the shared-patient relationship between V1 and V2, but it does not group V1 and V3 together even though they share clinician A. A clinician-only label has the reverse limitation: it groups V1 with V3 but not with V2. Therefore, neither single label fully describes both overlap patterns. This conclusion concerns the structure; it does not tell us how large either dependence is.
Why One Identifier Can Be Insufficient
A cluster identifier ordinarily assigns each observation to one group, so observations in the same group are treated as sharing that cluster. This naturally describes a partition: every row belongs to one cluster under that identifier. Crossed memberships do not generally form one such partition. One pair of rows can share a patient, another pair can share a clinician, and those pairings can overlap in different ways.
The limitation can be shown directly with two encounter records \(i\) and \(j\). Let \(I_P(i,j)\) equal 1 if the records have the same patient and 0 otherwise; define \(I_C(i,j)\) similarly for clinician. A patient identifier alone records \(I_P\), not \(I_C\), and a clinician identifier alone records \(I_C\), not \(I_P\). In crossed data, either indicator can equal 1 while the other equals 0.
Thus, a single patient grouping cannot encode every pair that shares a clinician, and a single clinician grouping cannot encode every pair that shares a patient. This is not a matter of choosing a more convenient name for the same cluster. The two identifiers describe different relationships, so one must not be silently substituted for the other.
The same reasoning applies beyond health care. If students take several courses and instructors teach students across courses, student and course or instructor memberships may overlap. If workers move among teams and teams include multiple workers, worker and team identifiers can both matter. The key question is not whether there is a group label, but whether the set of labels captures the ways observations share relevant units.
A Short Structural Check
A useful check is to take two observations and ask separately whether they share each relevant identifier. For a nested structure, membership in a lower-level unit determines membership in its parent. For a crossed structure, the answer for one classification does not determine the answer for the other.
Specify what one record represents, such as one student’s score or one patient encounter. Different row definitions can change which units are repeated.
Record every plausible grouping identifier, such as student, classroom, school, patient, and clinician. Check whether labels uniquely identify units.
Ask whether each lower-level unit has exactly one parent. If so, the relationship is nested at that level. If units are linked across both classifications, the structure may be crossed.
Find pairs that share one identifier but not another. If such pairs exist, one clustering identifier cannot represent both relationships by itself.
Worked Example: Repeated Scores in a Classroom Hierarchy
Suppose a hypothetical school records a mathematics score for each student at the end of two terms. Each student belongs to one classroom, and each classroom belongs to one school. Determine the structure for the term-level score records.
Step 1: Define a row. One row is one student’s score in one term. A student with two recorded terms contributes two rows.
Step 2: Identify repeated membership. The two rows from the same student share the student identifier. They also share the same classroom and school if the student stayed in place. Different students in that classroom share the classroom and school but not the student.
Step 3: Classify the relationships. Term records are repeated within students, students are nested within classrooms, and classrooms are nested within schools. The time ordering of the two scores may also matter, but it does not turn the classroom-school hierarchy into a crossed structure.
Step 4: Consider a change in assignment. If a student changes classroom between terms, the two records still share the student but have different classroom identifiers. The student identifier is then not nested within a single classroom across the full observation period. The records still have a school relationship if the student remains at that school. This illustrates why membership should be checked for the actual rows and period under analysis rather than assumed from a general description.
Common Mistake: Treating Every Data Set as One-Level Clustered
Wrong reasoning: “Each row has a patient ID, so clustering by patient accounts for dependence in these data.”
Correction: That statement accounts only for the grouping represented by patient ID. If different patients share clinicians, a patient-only label does not encode that clinician overlap. Conversely, clinician-only grouping does not encode repeated records from the same patient when they see different clinicians. First describe all relevant memberships; then the analysis can be chosen to match the data structure.
A related mistake is to infer actual correlation from labels alone. Two observations may share a classroom, clinician, or patient but still show little outcome similarity in a particular data set. The identifiers describe potential common sources and the organization of records; evidence and subject-matter reasoning determine whether and how strongly those sources affect outcomes.
Check Your Understanding
For each question, focus on the unit memberships and explain your reasoning.
- Each classroom belongs to one school, and each student belongs to one classroom. Which units are nested, and what additional condition should be checked about classroom labels?
- Patients can see several clinicians, while each clinician sees several patients. Why is patient-only grouping unable to represent every pair of visits that shares a clinician?
- A student has two term records, changes classrooms between terms, and remains at the same school. Which identifiers are shared by the two records, and which are not?
- Does two observations sharing a school identifier prove that their outcomes are correlated? Explain the distinction between structure and observed dependence.
- Give an example of two crossed identifiers and describe one pair of observations that shares the first identifier but not the second.