Why the Level of a Predictor Matters
In clustered data, the outcome may be measured on individuals while a predictor is measured or assigned for whole groups. For example, students may each have a test score, while their school has one funding level. Repeating that funding value on every student's row is convenient for fitting a regression, but it does not create a new, independent funding comparison for each student.
This distinction matters for both interpretation and uncertainty. A coefficient for school funding describes how outcomes differ across schools with different funding levels, conditional on other predictors in the model. Its information about the funding association comes chiefly from the number of schools and how funding varies among them—not simply from the total number of students.
A basic regression model for this setting can be written as
where \(\mathbf{w}_{ij}\) denotes any other predictors in the model. The coefficient \(\beta_1\) is the expected difference in outcome associated with a one-unit difference in \(z_j\), holding the included predictors fixed. If outcomes are test scores and \(z_j\) is funding measured in thousands of dollars per student, \(\beta_1\) is measured in test-score points per additional thousand dollars per student. This is a conditional association; by itself, it does not establish a causal effect.
The model describes the conditional mean, but it does not say that individuals in the same cluster have independent errors. The relevant analysis must allow for within-cluster dependence, as in the earlier material on cluster-robust standard errors. Allowing for that dependence is necessary for appropriate uncertainty estimates, but it cannot create additional independent variation in \(z_j\).
Where the Predictor's Variation Comes From
Because every individual in cluster \(j\) has the same \(z_j\), there is no within-cluster variation in this predictor. Comparisons between two students in the same school cannot tell us how outcomes vary with school funding: both students have the same funding value. The association is learned by comparing outcomes across schools with different funding values.
A simple algebraic check makes this explicit. Let \(\bar{z}_j\) be the mean predictor value within cluster \(j\). For a cluster-level predictor, \(\bar{z}_j=z_j\), so
All variation in this predictor is between clusters. In contrast, each additional individual in a cluster adds another outcome observation at the same predictor value. Those outcomes can help describe the cluster's outcome pattern, but they are not new independent values of the cluster-level predictor.
This also explains why a model containing a separate indicator for every cluster cannot estimate a coefficient for a predictor that is constant within each cluster. The predictor can be written as a weighted sum of the cluster indicators:
where \(I(j=k)\) equals 1 for cluster \(k\) and 0 otherwise. Thus the predictor is exactly redundant with the cluster indicators, and its separate coefficient is not identifiable in that model. A regression without those indicators may estimate a between-cluster association, but it relies on comparisons between clusters rather than comparisons within them.
Worked Example: A Funding Slope Across Schools
Suppose a hypothetical data set has four schools. Funding \(z_j\) is measured in thousands of dollars per student, and the outcome is each school's mean test score. The school-level values are:
| School | Funding \(z_j\) (thousand dollars per student) | Mean score |
|---|---|---|
| A | 10 | 70 |
| B | 10 | 74 |
| C | 20 | 78 |
| D | 30 | 82 |
There are four school-level predictor observations, but only three distinct funding values because Schools A and B have the same value. To describe the linear association between school mean score and funding, use the ordinary least-squares slope across these four school summaries:
Here \(\bar{z}=(10+10+20+30)/4=17.5\) thousand dollars per student, and \(\bar{y}=(70+74+78+82)/4=76\) points. Substitution gives
The fitted slope is about 0.5091 test-score points per additional thousand dollars per student. It summarizes the association across these four schools; it is not an estimate based on four independent students. There are only four independent school-level comparisons in this illustration, and one funding value is repeated. This small number of schools provides little basis for precise inference or for judging whether a linear trend is stable.
More Individuals Do Not Equal More Predictor Variation
Suppose a study has many individuals in each cluster. Adding individuals can improve the measurement of outcomes within a cluster, but if the predictor remains constant in that cluster, those added individuals do not increase the number of independent predictor values. This is one reason that a large total sample size can give a misleading impression of how much information is available about a cluster-level coefficient.
The following calculation isolates the point. Assume a hypothetical study has eight clinics, four assigned to each of two clinic-level policies. Each clinic contributes 40 patients. For illustration, suppose the outcome follows
where \(z_j\) is 0 or 1, independent clinic effects \(u_j\) have mean 0 and variance 9 score-points squared, and individual errors \(\epsilon_{ij}\) have mean 0 and variance 16 score-points squared. Assume the clinic effects and individual errors are mutually independent, and that the individual errors are independent within and across clinics. These assumptions are specific to this illustration.
For one clinic, its mean outcome has variance \(9+16/40=9.4\) score-points squared: the clinic effect remains in the clinic mean, while averaging 40 independent individual errors reduces their variance to \(16/40\). The policy coefficient is the difference between the mean outcome for four policy-1 clinics and the mean for four policy-0 clinics. Because the eight clinics are independent, the variance of that difference is
For comparison, an analysis that incorrectly treated all 320 patients as independent would use the marginal variance \(9+16=25\) for each patient's outcome and calculate
The smaller calculation is inappropriate under the stated model: patients in the same clinic share \(u_j\), so their outcomes are not independent. Even with 320 patients, the policy comparison is between eight clinics, four per policy. More patients per clinic would reduce the individual-error contribution to each clinic mean, but it would not remove variation in clinic effects or add clinics to the policy comparison.
Cluster Size and the Comparison Being Estimated
When cluster sizes differ, an individual-level regression and a regression that gives each cluster equal weight need not summarize the same comparison. With a binary cluster-level predictor and an intercept, the individual-level difference in means weights each cluster in proportion to its number of individuals. Giving every cluster equal weight instead targets a difference between average cluster outcomes. Neither weighting is automatically correct in every application: the appropriate summary depends on the scientific question and analysis plan.
Worked Example: Individual-Weighted and Cluster-Weighted Comparisons
Consider four hypothetical clinics, with an outcome measured in points and a binary clinic-level predictor indicating whether the clinic uses a new service. The clinic means and sizes are:
| Service status | Clinic | Number of individuals | Mean outcome (points) |
|---|---|---|---|
| 0 | A | 10 | 60 |
| 0 | B | 100 | 80 |
| 1 | C | 10 | 70 |
| 1 | D | 100 | 82 |
An individual-weighted regression compares the mean outcome among all individuals in the two service groups. The service-0 mean is
The service-1 mean is
The individual-weighted difference is \(80.91-78.18=2.727\) points. An equally weighted comparison first averages the two clinic means in each group: \((60+80)/2=70\) points for service 0 and \((70+82)/2=76\) points for service 1. That difference is \(76-70=6\) points. The larger clinics receive more weight in the individual-level comparison, which is why the two answers differ. Both calculations use only four clinics, and neither calculation makes the number of independent clinics larger than four.
Implications for Uncertainty
A cluster-robust standard error accounts for dependence within clusters when estimating uncertainty under its assumptions. Its use is important when a cluster-level predictor is repeated across individual records. However, it does not make a small number of clusters behave like a large number. With few clusters, uncertainty estimates and tests can be unreliable, and a result may be sensitive to one or two clusters. The earlier material on few-cluster inference and small-sample corrections addresses those concerns.
Limited variation adds another constraint. If nearly all clusters have similar predictor values, the fitted slope depends on a narrow set of between-cluster comparisons. If the predictor has only two distinct values, a linear slope is mathematically a scaled contrast between those groups, but the data offer little direct information about how the association behaves at intermediate values. If it is constant across all clusters, its slope cannot be estimated at all alongside an intercept.
The number of clusters is not a complete formula for information. Cluster sizes, the spread of predictor values across clusters, variation in outcomes, other predictors, and the dependence pattern can also matter. For example, very unequal cluster sizes can change the weighting in an individual-level fit. Still, counting individuals alone is especially misleading for a predictor that does not vary among individuals within clusters: its independent variation is supplied by the clusters.
Common Mistakes
- Counting each repeated predictor value as a new independent value. Recording a school’s funding on 500 student rows does not provide 500 independent funding observations. The funding value is shared by those students.
- Claiming every cluster has a unique predictor value. With \(K\) clusters there are \(K\) predictor observations, but at most \(K\) distinct values. Two or more clusters may share a value.
- Interpreting the coefficient as a within-cluster relationship. A cluster-level coefficient describes a between-cluster association, conditional on included predictors. There is no within-cluster change in that predictor to compare.
- Assuming a cluster-robust standard error solves a lack of clusters. It adjusts uncertainty for within-cluster dependence under suitable conditions; it cannot supply independent clusters or predictor variation that the data do not contain.
- Ignoring the weighting target. Unequal cluster sizes can make an individual-weighted comparison differ from an equally weighted comparison of clusters. State which comparison the analysis is intended to represent.
Check Your Understanding
Answer each question by identifying the level of variation and the comparison being made.
- A study records a district-level tax rate for every student in each district. With 18 districts, what is the maximum number of distinct tax-rate values, and what comparisons identify its regression coefficient?
- Explain why doubling the number of students within each school does not double the number of independent school-level predictor observations.
- A predictor is constant across all clusters. Why can its coefficient not be estimated in a model that also includes an intercept?
- In the clinic example, why do the individual-weighted and equally weighted differences disagree?
- What does a cluster-robust standard error address, and what limitation remains when there are very few clusters?