Tutorials › Generalized Linear Mixed Models (GLMM) › Unequal Cluster Sizes And GEE Weighting

GLMM Versus GEE · Tutorial 139 of 698

Unequal Cluster Sizes And GEE Weighting

Learn how cluster size and working correlation shape ordinary GEE weighting, and distinguish an observation-weighted estimate from an equal-cluster summary.

Intermediate 12 min read

What You'll Learn

  • Write the ordinary GEE estimating equation as a sum of cluster contributions.
  • Explain why independence-working GEE gives more total weight to larger clusters.
  • Derive how exchangeable correlation modifies the contribution of cluster size.
  • Compare observation-weighted and equal-cluster summaries with hypothetical data.
  • Identify assumptions, diagnostics, and limitations of these weighting interpretations.

Why Unequal Cluster Sizes Matter

In clustered data, one cluster might contribute two observations while another contributes twenty. Ordinary generalized estimating equations (GEE) do not generally give each cluster the same influence: they add a score contribution from each cluster, and that contribution depends on the number of observations and their working covariance. Consequently, “the average outcome” can mean different things depending on whether the target gives equal importance to clusters or to observations.

The key point is not simply that larger clusters count more. Under an independence working correlation, their contribution commonly grows with their number of observations. Under positive within-cluster working correlation, the added observations are partly redundant, so their contribution grows more slowly. Neither the robust sandwich variance nor calling a fit “population-averaged” automatically makes clusters equally weighted.

Definition: Suppose there are \(K\) independent clusters, with \(m_i\) observed records in cluster \(i\). Let \(Y_i\) be the \(m_i\)-vector of outcomes, \(X_i\) the corresponding covariate information, and \(\mu_i(\beta)\) the vector of marginal means under mean-model parameter \(\beta\). Define \(D_i=\partial\mu_i(\beta)/\partial\beta^\mathsf{T}\), and let \(V_i\) be the working covariance matrix for \(Y_i\). The ordinary GEE estimator solves $$ \sum_{i=1}^{K} U_i(\beta)=0, \qquad U_i(\beta)=D_i^\mathsf{T}V_i^{-1}\{Y_i-\mu_i(\beta)\}. $$ Each \(U_i\) is a cluster’s contribution to the estimating equation. The working covariance affects how that cluster’s residuals are weighted and combined.

The usual large-sample justification treats clusters as independent sampling units, with enough independent clusters for the estimating equation and sandwich variance to be reliable. The specified marginal mean must be appropriate for the target and covariates, and the working covariance matrices must be usable (in particular, invertible). A correct working correlation can improve efficiency; the sandwich variance can protect standard errors against some working-correlation misspecification. Neither changes the fact that the point estimate is obtained by summing the chosen cluster contributions.

Independence Working Correlation: Records Add Up

With an independence working correlation, \(V_i\) is diagonal. For an intercept-only model with a common mean \(\mu\) and common working variance, the GEE equation is proportional to the sum of all observed residuals. Solving it gives the mean across records, not the unweighted mean of cluster means.

Worked Example: Pooled Records Versus Equal Cluster Means

Consider hypothetical binary outcomes from two clusters. Cluster A has two records, both equal to 1. Cluster B has eight records, of which two equal 1 and six equal 0. Assume independent clusters, a common marginal mean, and an independence working correlation with the same working variance for every record.

There are \(2+2=4\) successes among \(2+8=10\) records. The intercept-only independence GEE estimate is therefore

$$ \hat{\mu}_{\text{ind}} = \frac{2+2}{2+8} = \frac{4}{10} = 0.4000. $$

The cluster proportions are \(1\) for A and \(2/8=0.25\) for B. Their equal-cluster average is

$$ \frac{1+0.25}{2}=0.625. $$

These are different summaries: the GEE estimate averages the ten observed records, whereas the second calculation gives each of the two clusters equal weight. With an independence working correlation, the eight-record cluster contributes four times as many residual terms as the two-record cluster, all else equal. The calculation alone does not establish that either summary is the right target; that depends on how the target population and sampling process are defined.

For regression, the same principle applies through the full cluster score \(U_i\). A cluster with more records often supplies more score terms, and thus more information or leverage. Its influence is not necessarily exactly proportional to \(m_i\): covariates, fitted means, residual patterns, and the working covariance all matter. In particular, a cluster with many records does not necessarily pull the coefficient in one direction; the sign and magnitude of its score depend on its residuals and covariates.

Exchangeable Correlation: More Records, Diminishing Addition

An exchangeable working correlation assigns the same working correlation \(\rho\) to every pair of distinct observations within a cluster. For an intercept-only model with a common mean and common marginal variance, the resulting cluster contribution can be expressed using the cluster mean. The multiplier on that cluster mean’s residual is \(m_i/\{1+(m_i-1)\rho\}\). This multiplier is \(m_i\) when \(\rho=0\), but for positive \(\rho\) it increases more slowly as the cluster grows.

Derivation: For a cluster of size \(m_i\), write the exchangeable correlation matrix as \(R_i=(1-\rho)I_{m_i}+\rho J_{m_i}\), where \(I_{m_i}\) is the identity matrix and \(J_{m_i}\) is the matrix of ones. Every row of \(R_i\) sums to \(1+(m_i-1)\rho\), so \(R_i\mathbf{1}=\{1+(m_i-1)\rho\}\mathbf{1}\). Hence \(R_i^{-1}\mathbf{1}=\mathbf{1}/\{1+(m_i-1)\rho\}\). With a common mean and variance, the intercept score is proportional to \(\mathbf{1}^\mathsf{T}R_i^{-1}(Y_i-\mu\mathbf{1})\). Substituting the inverse action gives $$ \mathbf{1}^\mathsf{T}R_i^{-1}(Y_i-\mu\mathbf{1}) = \frac{\sum_{j=1}^{m_i}(Y_{ij}-\mu)}{1+(m_i-1)\rho} = \frac{m_i}{1+(m_i-1)\rho}(\bar{Y}_i-\mu). $$

The derivation requires the exchangeable matrix to be a valid working correlation matrix. In particular, its parameter must lie in a range that makes the matrix positive definite; for \(m_i\geq 2\), this requires \(-1/(m_i-1)<\rho<1\). With varying cluster sizes, the chosen \(\rho\) must satisfy the constraint for the largest cluster as well. The displayed score simplification also assumes a common marginal variance across records. For other mean and variance patterns, use the general GEE equation rather than treating this scalar weight as universal.

Worked Example: Positive Correlation Changes Cluster Weights

Use the same hypothetical cluster sizes, \(m_A=2\) and \(m_B=8\), and cluster proportions \(1\) and \(0.25\). Suppose an intercept-only GEE uses a valid exchangeable working correlation of \(\rho=0.50\), with a common marginal variance. The cluster multipliers are

$$ w_A=\frac{2}{1+(2-1)(0.50)}=\frac{2}{1.5}=\frac{4}{3}, \qquad w_B=\frac{8}{1+(8-1)(0.50)}=\frac{8}{4.5}=\frac{16}{9}. $$

The intercept equation sets the weighted sum of cluster-mean residuals to zero, so the estimate is the weighted average of the cluster proportions:

$$ \hat{\mu} = \frac{w_A(1)+w_B(0.25)}{w_A+w_B} = \frac{(4/3)+(16/9)(1/4)}{(4/3)+(16/9)} = \frac{16/9}{28/9} = \frac{4}{7} \approx 0.5714. $$

The larger cluster still has more weight (\(16/9\) versus \(4/3\)), but not four times as much. If \(\rho=0\), the weights would be 2 and 8, recovering the record-weighted estimate \(0.4000\). Positive working correlation reduces the incremental contribution of additional records because records within a cluster are treated as partly redundant. This is a statement about the working covariance in this model, not a claim that the observed outcomes are independent.

Which Population Does the Estimate Represent?

An observation-weighted mean gives the same role to each record. An equal-cluster mean gives the same role to each cluster, regardless of how many records it contributes. In a study sampling clusters and then observing their members, these can describe different populations: a randomly selected observed record and a randomly selected cluster followed by a summary of its members need not have the same average.

Ordinary GEE does not automatically target an equal-cluster average. Its estimating equation sums cluster contributions, and its weights arise from the mean and working covariance models. Independence working correlation makes the distinction especially visible because, in the simple intercept-only case, the estimate is the record-level average. With exchangeable correlation, the simple intercept-only estimate instead uses the correlation-adjusted multipliers derived above. In a regression model, the population interpretation also depends on the covariates and the stated mean model.

If an analysis explicitly needs equal contribution from clusters, it can use a different estimating equation—for example, one that normalizes cluster contributions or models cluster-level summaries. That is a deliberate change in the analysis, not a correction automatically supplied by the sandwich standard error. It may also change the target and the estimator’s efficiency. The appropriate choice depends on the scientific question and sampling design.

Worked Example: A Larger Cluster Has More Leverage, Not Necessarily a Fixed Share

Suppose a hypothetical independence-working GEE compares a binary exposure coded 0 or 1 using an intercept and an exposure coefficient. Cluster P contains four records, all with exposure 1 and outcome 1. Cluster Q contains four records, all with exposure 0 and outcome 0. A third cluster R contains twelve records, all with exposure 1 and outcome 0. These are deliberately simple data to show the direction of score contributions; the example does not claim that this saturated pattern is a suitable basis for general inference.

At any fitted probabilities strictly between 0 and 1, each exposure-1 record has design vector \((1,1)^\mathsf{T}\). The score contribution from those records under independence is proportional to their number times their average residual. Cluster P contributes four positive residual terms because its outcomes are 1; cluster R contributes twelve negative residual terms because its outcomes are 0. Thus, for the exposure-1 records together, the direction of the score depends on the combined residual total, not on giving P and R equal cluster weights. Cluster Q contributes to the intercept score and helps determine the comparison baseline.

This illustrates why one cannot infer a cluster’s influence from size alone: its covariate pattern and residuals matter too. It also shows why a coefficient from a row-level mean model should not be casually described as the result of an equal-cluster comparison. A real analysis would check whether the mean model is identifiable and appropriate and would base inference on an adequate number of independent clusters.

Diagnostics, Alternatives, and Limitations

Before interpreting an unequal-size GEE fit, inspect the distribution of \(m_i\), the cluster-level outcome and covariate patterns, and the fitted working correlation. Compare estimates under plausible working correlations when this is useful, while recognizing that different weighting can produce different finite-sample estimates. Check whether a small number of very large clusters dominates the estimating equation by examining cluster score contributions or by refitting after omitting particularly influential clusters as a sensitivity analysis. Such checks diagnose sensitivity; they do not establish which target population is correct.

The robust sandwich variance is built from cluster-level score contributions and is intended to account for within-cluster dependence under its large-cluster-count justification. It does not equalize cluster weights, repair a chosen target that does not match the question, or guarantee reliable inference when the number of independent clusters is small. The earlier material on the sandwich variance and few-cluster GEE inference is relevant when assessing uncertainty.

A useful comparison is with an equal-cluster analysis. For a simple mean, that analysis averages the cluster means rather than pooling all records. It can answer a cluster-average question, but it is not generally the same estimator as ordinary GEE. Conversely, using a more elaborate working correlation may change the relative contributions without making each cluster count equally. The later topic of informative cluster size addresses additional complications when cluster size itself carries information about outcomes; unequal sizes alone do not prove that this is occurring.

  • Assuming equal cluster weight. Summing \(U_i\) does not give each \(i\) the same influence. The general cluster score depends on \(m_i\), covariance, covariates, and residuals.
  • Assuming weight is always proportional to size. That describes the simple independence-working intercept example, not every GEE. Correlation and design can change the contribution.
  • Calling sandwich inference an equal-cluster correction. The sandwich changes the estimated variance, not the estimating equation that determines the point estimate.
  • Equating unequal size with informative size. Unequal sizes can occur without the size mechanism being related to outcomes. The sampling design and target need to be considered before drawing that conclusion.
Key takeaway: Ordinary GEE combines cluster-level scores, not equally weighted cluster summaries. Under independence, larger clusters often contribute more record-level information; positive exchangeable correlation reduces the marginal weight added by each additional record. The target interpretation must be matched to the sampling design and scientific question.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. Two clusters have sizes 3 and 9, with 1 and 6 successes, respectively. Under an intercept-only independence-working GEE with common working variance, calculate the estimate. What is the equal-cluster average of the two cluster proportions?
  2. For an intercept-only exchangeable GEE with common variance and \(\rho=0.25\), calculate the cluster multiplier for a cluster of size 5.
  3. Does using the sandwich variance make an ordinary GEE estimate give equal influence to every cluster? Explain.
  4. Why can a larger cluster have less than \(m_i\) times the contribution of a one-record cluster under positive exchangeable correlation?

Solutions. (1) The record-level estimate is \((1+6)/(3+9)=7/12\approx0.5833\). The cluster proportions are \(1/3\) and \(6/9=2/3\), so their equal-cluster average is \(\{(1/3)+(2/3)\}/2=0.5000\). (2) The multiplier is \(5/\{1+(5-1)(0.25)\}=5/2=2.5\). (3) No. The sandwich estimates uncertainty from cluster score contributions; it does not change the estimating equation or its point estimate. (4) Positive correlation makes within-cluster residuals partly redundant in the working covariance. The multiplier is \(m_i/\{1+(m_i-1)\rho\}\), which grows less quickly than \(m_i\) when \(\rho>0\).

Clinical Biostats