Why the Clustering Level Is a Design Decision
A data set may contain many rows without containing an equally large number of independent pieces of information. Students in one school, patients treated at one clinic, or repeated records from one person may share conditions that are not fully represented by the regression predictors. If those shared influences affect the regression errors, observations within the group may be dependent.
Choosing a clustering level means deciding which observations should be treated as belonging together for accounting for that possible dependence. The decision comes from how the data were sampled and generated, and from which unmodeled influences are plausible. It is not made by choosing whichever grouping produces a preferred result.
The cluster is not necessarily the observational unit, the unit sampled, or the unit assigned to a treatment. Those units can coincide, but they answer different questions. The observational unit tells us what each row describes; the sampling unit tells us what was selected; and the assignment unit tells us what received a treatment or condition. Each can point to relevant dependence, but none should be used mechanically as the sole rule.
A Design-Based Way to Choose
Start with the actual pathway by which an observation entered the data. Then ask what other observations share with it: a person, household, classroom, school, clinic, or another common setting. Consider whether that shared feature could affect the outcome or the regression error after accounting for the model’s predictors. A shared label alone is not enough; the label matters when there is a plausible common influence.
A useful practical principle is to choose a grouping that does not split apart observations that may share relevant unmodeled influences. If students in different classrooms at one school may share school policies or facilities, classroom-only groups separate observations that still share a possible influence. Grouping by school keeps those observations together. This does not prove that every pair within a school is equally correlated; it identifies a design-based boundary within which dependence is allowed.
When a design has nested units, such as students within classrooms within schools, a broader group contains the narrower groups. Choosing the broader level can accommodate shared influences at both levels, but it also creates fewer clusters. That trade-off matters: the level must be broad enough for the plausible dependence, while the number and distribution of resulting clusters must still support the intended analysis. Counting rows alone does not resolve this choice.
Name the observational unit, sampling unit, assignment unit, and any shared settings present in the study design.
Ask which observations may share unmeasured conditions that could affect their outcomes or regression errors.
If two observations may share an influence but receive different cluster labels, the proposed grouping may be too narrow.
Explain why observations in different chosen clusters are plausibly independent, and note any important shared setting that would challenge that claim.
This check is about the design and the plausible structure of the errors, not about finding a grouping from the observed outcomes. In particular, a treatment assigned to whole schools is a strong reason not to split students from the same school into separate clusters. But a study can also have shared influences beyond the assignment unit. Conversely, a common administrative label need not determine the clustering level if the design gives no reason to expect shared unmodeled influences.
Worked Example: Students in Classrooms Within Schools
Suppose a hypothetical study measures reading scores for 25 students in each of 36 classrooms, with three classrooms in each of 12 schools. A new teaching program is assigned by classroom. Investigators also consider it plausible that school policies and facilities affect reading scores across classrooms. Assume the 12 schools were recruited independently and there is no broader shared influence across them that is relevant to the analysis. Which level should define clusters?
There are \(12 \times 3 = 36\) classrooms and \(36 \times 25 = 900\) student observations. Classroom assignment makes the classroom an important design unit: students in the same classroom receive the same program condition, so clustering only by individual student would split apart observations with a shared assignment.
But classroom-level clustering would give different labels to students in different classrooms at the same school. The stated design also makes a school-wide influence plausible. Since that influence can be shared across the three classrooms, use the school as the cluster identifier. Each student inherits the school identifier of their classroom.
The resulting count is 12 school clusters, not 36 classroom clusters or 900 student observations. The choice is justified by the school-wide shared conditions and by the classroom-level assignment being nested within schools. It depends on the stated assumption that no relevant dependence extends across schools. If, for example, all schools belonged to a small number of districts with common policies that could affect scores, the district setting would also need consideration; a school label would then split apart observations that may share that influence.
Why a Narrow Grouping Can Miss Dependence
The central problem with clustering too narrowly is that it can treat observations as belonging to different independent groups even though they share an omitted source of variation. A simple error decomposition makes the point. Suppose observations in classroom \(j\) of school \(g\) have an error \(e_{gj}=a_g+b_{gj}+\varepsilon_{gj}\), where \(a_g\) is a school-wide influence, \(b_{gj}\) is a classroom-specific influence, and \(\varepsilon_{gj}\) is individual variation. Assume these terms have mean zero, are mutually independent across their stated sources, and have variances \(\tau^2_a\), \(\tau^2_b\), and \(\sigma^2\), respectively.
For two different classrooms \(j\) and \(k\) in the same school, the classroom-specific and individual terms do not contribute to the covariance under these assumptions, but the shared school term does. If \(\tau^2_a\) is positive, their errors are associated even though they are in different classrooms. A classroom-only identifier puts them in separate clusters, so that grouping is too narrow to allow for the school-level dependence. A school identifier keeps the shared source together. This is a justification for the grouping choice, not a claim that the decomposition is the only possible model of school data.
The same reasoning helps distinguish an obvious common label from a meaningful cluster. If a shared factor has already been represented adequately in the regression model, it may not produce the same unmodeled dependence. But a label should not be discarded simply because a measured predictor is present: the design may still leave other shared influences within that group. The relevant question is whether plausible common variation remains in the regression errors.
Worked Example: Sampling Members of Households
Imagine a hypothetical survey that samples 40 households and interviews three adults in each household. The study records individual health outcomes and personal characteristics. The investigators expect household routines and the shared home environment to affect outcomes, and the sampling plan provides no reason to expect a further common influence across the sampled households. Choose a clustering level and count the clusters.
There are \(40 \times 3 = 120\) adult observations. Each adult is an observational unit, but the sampled household is the relevant shared setting. A person-level cluster identifier would create 120 groups and place the three adults in each household into different groups, despite their shared home environment.
Assign all three interviewed adults from a household the same household identifier. This gives 40 clusters, each containing three observations. The choice follows from the sampling design and the specified plausible household influence. It does not mean that all adults within a household have identical outcomes or that every household has the same influence.
The justification depends on the assumption in the scenario that there is no additional relevant common influence across households. If the sampled households were concentrated in a few communities where shared local conditions could affect the outcomes, the community grouping would need to be considered too. The household identifier alone would then separate observations that might share another source of dependence.
Nested Settings and the Cost of Going Broader
When smaller units fit inside larger units, choosing the larger unit as the cluster can keep multiple sources of within-setting dependence together. For instance, patients may have repeated visits within a clinic, and both persistent patient differences and clinic-wide practices may matter. A clinic identifier places visits from the same patient together as well as visits from different patients in that clinic, provided each patient attends only that clinic in the data.
That broader choice has a cost: it produces fewer clusters than patient-level grouping. A broader level is not automatically better if it joins observations with no plausible common influence, or if it leaves too few independent groups for the planned analysis. The goal is not to maximize cluster size. It is to make the boundary match the design-based dependence claim, then check how many independent groups remain.
Worked Example: Visits Within Patients and Clinics
Consider hypothetical records from eight clinics. Each clinic contributes 15 patients, and each patient has two recorded visits. Suppose patient-specific characteristics may persist across visits, clinic practices may affect all patients seen there, each patient attends only one study clinic, and the eight clinics have no relevant shared system-level influence. What is a defensible single clustering level?
There are \(8 \times 15 = 120\) patients and \(120 \times 2 = 240\) visit records. Clustering by visit would treat two visits from one patient as separate, despite possible persistent patient-level influences. Clustering by patient would keep repeat visits together, but would separate patients who attend the same clinic, despite the stated clinic-wide influence.
Use the clinic as the cluster level. Each of the eight clinics contains \(15 \times 2 = 30\) visit records, and the clinic grouping keeps both repeated visits and different patients from the same clinic together. This choice relies on the assumptions that patients are nested within their clinic and that there is no relevant shared influence across clinics. It leaves eight clusters, so the small cluster count must be considered in subsequent inference; 240 rows do not make 240 independent clusters.
Common Mistakes and Limits of One Cluster Label
- Clustering at the row level. The wrong reasoning is, “There are 900 students, so there are 900 independent clusters.” The correction is to inspect assignment, sampling, and shared settings; students in the same school may share influences regardless of the number of rows.
- Using only the assignment unit. The wrong reasoning is, “Treatment was assigned by classroom, so classroom must be the only relevant level.” Assignment is important, but school-wide or other shared conditions may require a broader grouping.
- Assuming the largest available group is always right. A broad identifier can combine observations without a plausible shared influence and reduce the number of clusters. Justify the boundary from the design rather than treating size as a virtue.
- Assuming one identifier handles every source. One cluster label partitions observations into non-overlapping groups. If relevant sources of dependence overlap rather than nest, a single grouping may not capture them all. Recognize this limitation rather than claiming the chosen label resolves every possible dependence.
Check Your Understanding
For each question, explain how the design bears on the proposed cluster level.
- A study assigns a program by school but records outcomes for individual students. Which design feature rules out treating each student as a separate cluster?
- In a study with classrooms nested within schools, what shared influence could make classroom-only clustering too narrow?
- A survey interviews five people per sampled household. Identify the observational unit and explain why they need not be the same as the clustering unit.
- Why does choosing a broader cluster level usually reduce the number of clusters?
- If patients have repeated visits within clinics and both patient- and clinic-level influences are plausible, why might clinic grouping be preferable to patient grouping when patients attend only one clinic?