Why Unequal Cluster Sizes Matter
Cluster-robust inference treats the cluster, rather than each individual observation, as the independent unit for estimating uncertainty. When cluster sizes differ, the observations are not simply interchangeable pieces of independent information: observations within a cluster can share errors, and a large cluster can contribute substantially to the fitted regression and its estimated variance. The key is to examine each cluster’s contribution to the coefficient’s uncertainty, not to assume that every cluster contributes equally.
For example, a data set might contain many observations from one school and few from several others. The total sample size alone does not say how much independent information is available. Nor does the size of the largest school, by itself, determine the standard error. The regression’s predictor values and residuals within each school also matter.
Model and Cluster-Robust Variance
Suppose there are \(G\) independent clusters. Cluster \(g\) contains \(m_g\) observations, indexed by \(j=1,\ldots,m_g\). For each observation, let \(Y_{gj}\) be the outcome and let \(\mathbf{x}_{gj}\) be the vector of regression predictors, including the intercept. Write the linear mean model as
The model requires a correctly specified conditional mean, \(E(Y_{gj}\mid\mathbf{x}_{gj})=\mathbf{x}_{gj}'\boldsymbol{\beta}\), and independent clusters. Errors may be correlated and have unequal variances within a cluster; the method does not require observations within the same cluster to be independent. The usual large-sample justification relies on having many independent clusters, not merely a large total number of observations. Cluster-robust standard errors do not repair a wrong mean model or make a small number of clusters adequate for reliable inference.
The formula makes an important feature visible: each cluster’s individual score contributions are added first, and the resulting cluster total is then multiplied by its transpose. Thus the variance depends on the size and direction of each cluster’s total score, not just on how many observations that cluster contains. Small-sample corrections may multiply or otherwise adjust this estimator, but they do not remove the underlying role of cluster-level contributions.
Why Cluster Contributions Add Up Before They Are Squared
A short variance argument explains why the observations are grouped this way. A regression score contribution from observation \(j\) in cluster \(g\) is \(\mathbf{x}_{gj}\varepsilon_{gj}\). The total score is the sum of those contributions across all observations. Its variance contains covariances between observations in the same cluster as well as their individual variances.
because different clusters are independent. Within a cluster, however, the variance on the right includes cross-products between different observations. For example, for two observations in a cluster, the variance of their summed scores contains both cross-covariance terms, not just the two individual variances. The empirical outer product \(\hat{\mathbf{U}}_g\hat{\mathbf{U}}_g'\) retains this combined cluster contribution. If the observations were incorrectly treated as independent, those within-cluster cross-covariances would be omitted.
Unequal sizes affect this calculation because a cluster with more observations has more terms that can contribute to its total score. But those terms can reinforce or partly cancel one another. A larger \(m_g\) therefore does not imply a proportionally larger variance contribution in every data set.
Worked Example: Unequal Sizes in an Intercept-Only Model
Suppose a hypothetical data set has three independent clusters with outcome values constant within each cluster: two observations equal to 8, two equal to 10, and four equal to 12. The values are in points. Fit an intercept-only model and calculate its CR0 standard error.
The fitted intercept is the overall sample mean:
For an intercept-only model, the cluster score is the sum of residuals in that cluster. The three cluster totals are \(2(8-10.5)=-5\), \(2(10-10.5)=-1\), and \(4(12-10.5)=6\) points. They sum to zero, as they must for the fitted intercept. The CR0 variance estimate is
Thus the CR0 standard error is \(\sqrt{0.96875}=0.9843\) points. The cluster with four observations contributes \(36\) of the \(62\) squared-score units; it is the largest single contribution, but it is not the only one. This is a calculation of the variance estimator, not a reliable basis for a confidence interval: there are only three independent clusters.
Large Clusters and Coefficient Precision
For a regression coefficient, a cluster’s score depends on both the residuals and the predictors. In a simple regression, for instance, observations with predictor values far from the overall predictor mean can have especially relevant score contributions for the slope. A cluster may be large but contribute little to the slope variance if its residual-pattern and predictor-weighted scores largely cancel. Conversely, a cluster of moderate size can matter greatly if its score is large.
The cluster-robust standard error describes uncertainty in the coefficient estimate, conditional on the model and clustering assumptions. A larger standard error means lower estimated precision. It does not mean the coefficient estimate itself has changed, and it does not say that a large cluster is biased. Unequal sizes are a feature of the data; their consequences for precision must be assessed through the fitted regression and cluster-level contributions.
Worked Example: A Large Cluster’s Share of Slope Uncertainty
Consider a hypothetical regression of systolic blood pressure on hours of weekly exercise, with errors clustered by clinic. Suppose the fitted model has \(\sum_{i,j}(x_{ij}-\bar{x})^2=20\) hours\(^2\). Its three clinic sizes are 3, 3, and 12 patients. The fitted cluster score contributions for the exercise slope are \(6\), \(-2\), and \(-4\) mmHg·hours. Their sum is zero, consistent with the OLS residual orthogonality condition for the slope.
In this simple-regression calculation, the CR0 variance estimate for the slope is the sum of squared cluster scores divided by the squared predictor sum of squares:
The standard error is \(\sqrt{0.14}=0.3742\) mmHg per hour of exercise. The largest clinic contributes \(16/56=0.2857\), or about 28.6%, of the total squared-score numerator. Although it has four times as many patients as either smaller clinic, its share is determined by its score of \(-4\), not by its size alone. This example reports a standard error only; three clinics are too few for routine large-cluster inference.
Worked Example: Similar Sizes, Different Score Concentration
Keep the same hypothetical predictor sum of squares, 20 hours\(^2\), and the same clinic sizes of 3, 3, and 12 patients. Suppose another fitted data set produces slope scores of \(4\), \(4\), and \(-8\) mmHg·hours. The scores again sum to zero. Calculate the CR0 standard error and examine the largest clinic’s contribution.
so \(SE(\hat\beta_1)=\sqrt{0.24}=0.4899\) mmHg per hour. The largest clinic contributes \(64/96=0.6667\), or about 66.7%, of the squared-score total. The cluster sizes and predictor sum of squares are unchanged from the previous example, yet the estimated variance is larger because the score contributions are more concentrated and larger in magnitude.
This comparison isolates the role of the score pattern; it does not claim that changing cluster sizes alone caused the difference. In actual analysis, both the distribution of cluster sizes and the fitted cluster scores should be examined. A variance contribution is not a measure of bias, and a high contribution does not by itself show that an observation or cluster should be removed.
What to Examine in Practice
When cluster sizes are unequal, report the number of independent clusters as well as the total number of observations. Summaries of the cluster-size distribution help show whether a few clusters contain much of the data. For understanding coefficient precision, also inspect cluster-level score contributions or other appropriate influence summaries. These answer related but different questions: cluster sizes describe how observations are distributed, while score contributions show how the fitted regression’s variance estimate is distributed across clusters.
Unequal sizes also make it risky to reason from an “average cluster” alone. The average size may conceal a very large cluster, and the same average size can occur with different distributions. Even so, size summaries are diagnostic rather than a substitute for the variance calculation. Cluster-robust inference aggregates the scores for the clusters actually observed.
Common Mistakes
- Using the total number of observations as if they were all independent. When observations share a cluster, their within-cluster dependence affects uncertainty. The number of independent clusters is essential to judging whether the large-cluster approximation is credible.
- Assuming the largest cluster must dominate every coefficient’s standard error. The variance depends on its aggregated predictor-weighted residual score, not size alone. A large cluster’s score can be small through cancellation.
- Assuming unequal sizes automatically invalidate cluster-robust standard errors. Unequal sizes affect contributions and may raise practical concerns, but they do not, by themselves, violate the method’s assumptions. Independent clusters, an appropriate mean model, and enough clusters for the intended inference remain important.
- Interpreting a large variance contribution as evidence of bias. A cluster can contribute substantially to estimated uncertainty without making the coefficient biased. The contribution indicates sensitivity of the variance estimate, not a causal or data-quality conclusion.
Check Your Understanding
Use the definitions and calculations in this tutorial to answer the following questions.
- Why does the cluster-robust variance calculation add observation-level scores within each cluster before forming an outer product?
- In an intercept-only model, what are the cluster scores for two clusters of sizes 3 and 5 whose outcomes are 7 and 9, respectively? First calculate the fitted overall mean.
- Can a large cluster have a small contribution to a slope’s cluster-robust variance? Explain using the role of its score.
- Two fitted regressions have the same cluster sizes and predictor sum of squares but different cluster score patterns. Why might their slope standard errors differ?
- Why is a total sample size of several hundred not, by itself, enough to establish that cluster-robust inference is reliable?