Tutorials › Generalized Linear Models › Cluster-Weighted GEE

GEE Inference and Limitations · Tutorial 894 of 981

Cluster-Weighted GEE

Learn to construct cluster-weighted GEE and understand how equalizing clusters’ score weights can change the population represented by the fitted coefficients.

Advanced 11 min read

What You'll Learn

  • Define ordinary and inverse-cluster-size weighted GEE estimating equations
  • Interpret the population estimating equation targeted by each method
  • Derive when cluster weighting preserves a correctly specified mean parameter
  • Calculate coefficient differences in explicit clustered-data examples
  • Explain why inverse-size weighting does not guarantee identical influence from every cluster
  • Use the weighted cluster contributions in sandwich variance estimation

Why Weight Clusters?

In GEE, the estimating equation is built from cluster-level contributions. If clusters have different sizes, a cluster with more observations can contribute more to the equation than a smaller cluster. When cluster size is informative, this may be consequential: an ordinary GEE can represent a population in which observations, rather than clusters, receive equal weight. A researcher whose scientific question concerns a typical cluster may instead want each cluster’s contribution scaled inversely by its size.

Cluster weighting changes the estimating equation, and therefore can change the coefficient being estimated. It does not simply make standard errors more robust or correct a misspecified mean model. The interpretation depends on the specified mean, the working covariance, the cluster-size distribution, and the chosen weights.

Ordinary and Cluster-Weighted Equations

Index independent clusters by \(i=1,\ldots,m\), and let cluster \(i\) contain \(n_i\) responses. Write \(Y_i\) for its response vector, \(\mu_i(\beta)\) for its modeled mean vector, \(D_i=\partial\mu_i(\beta)/\partial\beta^T\), and \(V_i\) for its working covariance matrix. The usual cluster contribution and ordinary GEE are

$$ U_i(\beta)=D_i^T V_i^{-1}\{Y_i-\mu_i(\beta)\}, \qquad \sum_{i=1}^m U_i(\beta)=0. $$

A cluster-weighted GEE multiplies each whole cluster contribution by a weight. The standard inverse-size choice is \(w_i=1/n_i\):

$$ \sum_{i=1}^m \frac{1}{n_i}U_i(\beta)=0. $$
Definition: An inverse-cluster-size weighted GEE is an estimating equation that gives cluster \(i\)'s GEE contribution the multiplier \(1/n_i\). Its population equation, under cluster sampling, is \(E[U_i(\beta)/n_i]=0\). Ordinary GEE instead targets \(E[U_i(\beta)]=0\), when these expectations exist.

The factor \(1/n_i\) is applied to the entire cluster contribution, not separately to selected components of the covariance calculation. Under independence working covariance, an ordinary contribution is a sum of observation-level scores, so dividing by \(n_i\) makes it an average of those scores within that cluster. With a general working covariance, the contribution is a correlated-vector score; inverse-size scaling still weights each cluster contribution, but need not make every cluster’s numerical contribution identical.

Worked Example: An Intercept-Only Binary Mean

Worked Example: An Intercept-Only Binary Mean

Suppose there are two equally represented types of clusters. A cluster of type A has size 1 and response 0.2, while a cluster of type B has size 3 and response mean 0.8. Use an independence working model and an identity mean to compare the ordinary and inverse-size estimating equations for an intercept \(\beta\). These values can be read as expected response values, so the calculation concerns population targets rather than a particular random sample.

With independence working covariance and a common variance factor, the ordinary intercept equation is proportional to the sum of the residuals. Its population version per cluster is

$$ (0.2-\beta)+3(0.8-\beta)=0. $$

Expanding gives \(0.2-\beta+2.4-3\beta=0\), so \(2.6=4\beta\) and the ordinary target is \(\beta=0.65\). This is the observation-weighted mean: type B supplies three times as many observations per cluster as type A.

For inverse-size weighting, the size-1 cluster contribution is unchanged, while the size-3 cluster contribution is divided by 3:

$$ (0.2-\beta)+\frac{1}{3}\,3(0.8-\beta)=0. $$

Thus \(0.2-\beta+0.8-\beta=0\), giving \(\beta=0.50\). The weighted target averages the two cluster-type means equally. It is not a correction that makes the ordinary estimate universally right or wrong; it answers a different weighting question.

What Population Equation Does Weighting Choose?

The distinction can be stated without relying on a particular link function. Under a cluster-sampling formulation, imagine drawing a cluster from the population of clusters and calculating its contribution \(U_i(\beta)\). Ordinary GEE averages these contributions over clusters. Because a larger cluster often contributes more observation-level terms, this average can give greater total representation to clusters with many observations. Inverse-size weighting instead averages the rescaled contributions \(U_i(\beta)/n_i\).

In the special case of independence working covariance, write the cluster contribution as \(U_i(\beta)=\sum_{j=1}^{n_i}u_{ij}(\beta)\), where \(u_{ij}\) is the observation-level score contribution. Then

$$ \frac{U_i(\beta)}{n_i} =\frac{1}{n_i}\sum_{j=1}^{n_i}u_{ij}(\beta). $$

Each cluster therefore contributes its average observation-level score. This is the precise sense in which the method aims to give clusters equal total weight. It does not mean that the observed score vectors will have equal lengths or equal influence in every realized data set.

Theorem: Suppose \(D_i\), \(V_i\), and \(n_i\) are measurable functions of the cluster’s observed covariates and size; \(V_i\) is invertible; and the relevant expectations are finite. If a parameter \(\beta_0\) satisfies \(E[Y_i\mid X_i,n_i]=\mu_i(\beta_0)\), then both \(E[U_i(\beta_0)]=0\) and \(E[U_i(\beta_0)/n_i]=0\).

Proof. Given \(X_i\) and \(n_i\), the matrices \(D_i\) and \(V_i^{-1}\) are fixed. The conditional mean assumption gives

$$ E[U_i(\beta_0)\mid X_i,n_i] =D_i^T V_i^{-1} E[Y_i-\mu_i(\beta_0)\mid X_i,n_i] =0. $$

Taking expectations over \(X_i,n_i\) yields \(E[U_i(\beta_0)]=0\). Since \(1/n_i\) is also fixed given \(n_i\),

$$ E\!\left[\frac{U_i(\beta_0)}{n_i}\,\middle|\,X_i,n_i\right] =\frac{1}{n_i}E[U_i(\beta_0)\mid X_i,n_i]=0. $$

Taking expectations again proves the weighted equation is also unbiased at \(\beta_0\). The integrability assumptions ensure these conditional and unconditional expectations are defined. \(\square\)

This result is important because it limits what weighting can be expected to do. If a common conditional mean model is correct given covariates and cluster size, the two population equations share that parameter, although their finite-sample estimates and variances can differ. If the mean model is only an approximation, or the scientific target is defined by a marginal distribution that changes with cluster size, their roots can differ. Weighting alone does not establish that either root is the desired scientific estimand.

Worked Example: Different Treatment Coefficients

Worked Example: Different Treatment Coefficients

Consider a linear identity-mean model with an intercept and a binary cluster-level treatment \(x\). Use independence working covariance and suppose the listed outcomes are cluster means, repeated for every observation in their cluster.

Treatment \(x\)Cluster size \(n_i\)Outcome in every cluster observation
010
032
113
115

With a binary treatment and an intercept, the fitted treatment coefficient is the treatment-group mean minus the control-group mean. Ordinary GEE weights each listed cluster mean by its size. The control mean is \((1\cdot0+3\cdot2)/(1+3)=6/4=1.5\). The treated mean is \((1\cdot3+1\cdot5)/(1+1)=8/2=4\). Thus the ordinary treatment coefficient is \(4-1.5=2.5\).

Under inverse-size weighting, each cluster mean has weight \(n_i(1/n_i)=1\). The control mean becomes \((0+2)/2=1\), and the treated mean is \((3+5)/2=4\). The weighted treatment coefficient is \(4-1=3\).

The estimates differ because the control cluster with outcome 2 is larger and receives more weight in the ordinary equation. The weighted coefficient compares equally weighted cluster averages within each treatment group. This example also shows that the difference need not be a uniform shift to the intercept: a treatment contrast can change when cluster sizes are associated with outcomes differently across treatment groups.

Worked Example: Scaling a Correlated Cluster Contribution

Worked Example: Scaling a Correlated Cluster Contribution

Consider an intercept-only identity mean with working covariance \(V_i\). For illustration, set the common variance to 1 and use exchangeable correlation \(\rho=0.5\). A size-2 cluster then has

$$ V_i= \begin{pmatrix} 1&0.5\\ 0.5&1 \end{pmatrix}, \qquad V_i^{-1}= \frac{1}{0.75} \begin{pmatrix} 1&-0.5\\ -0.5&1 \end{pmatrix}. $$

For an intercept, \(D_i\) is the vector of ones. If the two residuals are both 1, then \(V_i^{-1}(1,1)^T=(2/3,2/3)^T\), so the cluster score is \(U_i=4/3\). Its inverse-size weighted score is \((1/2)(4/3)=2/3\).

For a size-1 cluster with residual 1, the working variance is 1 and its score is \(U_i=1\). Its weighted score remains \(1\). Thus the size-2 cluster’s score was reduced by its size, but the resulting weighted score \(2/3\) is not equal to the size-1 cluster’s score 1.

This calculation illustrates the careful interpretation required with a non-independence working covariance. Inverse-size weighting rescales each whole correlated-cluster contribution. It does not guarantee equal realized score magnitude, because the covariance structure and residual pattern also affect that magnitude.

Estimation and Inference

In practice, solve the weighted equation using the chosen mean and working covariance models:

$$ \sum_{i=1}^m \psi_i(\beta)=0, \qquad \psi_i(\beta)=\frac{1}{n_i}D_i^T V_i^{-1}\{Y_i-\mu_i(\beta)\}. $$

The sandwich calculation must use these weighted cluster contributions. For example, if \(A\) is the expected derivative of the estimating equation with respect to \(\beta\), and \(B=\operatorname{Var}\{\psi_i(\beta)\}\), the large-sample covariance has the form \(m^{-1}A^{-1}BA^{-T}\), under the regularity conditions for the estimating-equation approximation and independent clusters. Using unweighted cluster scores in \(B\) would correspond to a different estimating procedure. Weighting changes both the estimating equation and the variability of its contributions.

The choice should follow the estimand, not a desire to make cluster sizes look balanced. If the target is an average over observed individuals, ordinary observation-weighted GEE may align with the question. If the target gives clusters equal representation, inverse-size weighting may be more appropriate. With informative cluster size, explicitly state which population is represented and what variation in cluster size means for the scientific question.

Common Mistakes

  • Assuming the weights always correct informative cluster size. Inverse-size weighting defines a different estimating equation; it does not guarantee a scientifically appropriate target under every mean-model specification.
  • Claiming that every cluster has exactly equal influence. The multiplier is \(1/n_i\), but the score’s size also depends on residuals, covariates, and \(V_i^{-1}\). Equal multipliers after rescaling are not equal realized score magnitudes.
  • Dividing the covariance matrix or individual score components by cluster size instead. The standard construction multiplies the complete cluster contribution by \(1/n_i\). Altering parts of the contribution defines a different estimating equation.
  • Interpreting a changed coefficient as a numerical correction to the ordinary coefficient. The two roots can represent different weighted population equations. Their difference should be explained in terms of the populations and cluster contributions each equation emphasizes.
Key takeaway: Inverse-cluster-size weighted GEE targets \(E[U_i(\beta)/n_i]=0\), rather than the ordinary target \(E[U_i(\beta)]=0\). Use it when equal cluster representation matches the intended estimand, and carry the same weights into the cluster-level sandwich calculation.

Check Your Understanding

Use the equations and examples above to check your understanding.

  1. Write the inverse-size weighted GEE contribution for a cluster of size \(n_i\), and identify the population equation it targets.
  2. Under independence working covariance, explain why dividing a cluster score by \(n_i\) gives an average of its observation-level score contributions.
  3. What conditional mean assumption makes the ordinary and inverse-size population equations both have zero expectation at \(\beta_0\)?
  4. In the treatment example, identify which cluster causes the ordinary and weighted treatment coefficients to differ.
  5. Why does inverse-size weighting not guarantee that two realized clusters have equal score magnitudes when the working covariance is correlated?
Clinical Biostats