Tutorials › Generalized Linear Models › Leverage-Adjusted GEE Covariance Estimation

GEE Inference and Limitations · Tutorial 885 of 981

Leverage-Adjusted GEE Covariance Estimation

Learn how cluster leverage changes robust GEE covariance estimates, how residual adjustments are constructed, and when the resulting correction may be unstable.

Advanced 11 min read

What You'll Learn

  • Define cluster leverage using the whitened GEE design and distinguish a diagonal block from a full projection.
  • Derive Fay–Graubard and CR2-style residual adjustments.
  • Show how the adjustment restores cluster residual covariance under a linearized working model.
  • Calculate unadjusted and adjusted sandwich variances with all design weights included.
  • Diagnose singular or near-singular leverage adjustments and their limitations.

Why Adjust Cluster Contributions?

The ordinary robust GEE covariance estimator treats each cluster’s fitted score as an empirical contribution to the covariance estimate. But fitted residuals are not raw errors: estimation of the regression coefficients has already pulled them toward the fitted mean. This effect can be substantial when a cluster has high leverage, meaning its covariates contribute strongly to determining the fitted coefficients. With few clusters, a handful of such contributions can make the unadjusted sandwich covariance too small or unstable.

Fay–Graubard and CR2-style adjustments address this effect by inflating cluster residuals according to their leverage. The adjustment is matrix-valued when a cluster has multiple observations, and its construction depends on the covariance scale used to define leverage. It is a finite-sample correction to the covariance estimator, not a replacement for the GEE estimating equation or a guarantee of accurate inference.

Whitened Cluster Leverage

For cluster \(i\), let \(Y_i\) be the response vector, \(\mu_i\) the fitted mean vector, \(D_i=\partial\mu_i/\partial\beta^\mathsf{T}\) the mean-derivative matrix, and \(V_i\) the working covariance matrix. Assume \(V_i\) is positive definite and the total GEE bread matrix is nonsingular. Evaluate these quantities at the fitted coefficient vector when estimating covariance.

Definition: Define the whitened design block \(W_i=V_i^{-1/2}D_i\), the bread \(B=\sum_i W_i^\mathsf{T}W_i\), and the whitened cluster residual \(r_i=V_i^{-1/2}(Y_i-\mu_i)\). Stack the \(W_i\) blocks into \(W\), and define the full whitened hat matrix \(P=WB^{-1}W^\mathsf{T}\). Its \(i\)th diagonal block \(P_{ii}=W_iB^{-1}W_i^\mathsf{T}\) is the cluster leverage block.

The whitened cluster score is \(s_i=W_i^\mathsf{T}r_i=D_i^\mathsf{T}V_i^{-1}(Y_i-\mu_i)\). The ordinary empirical sandwich covariance is

$$ \widehat{\operatorname{Var}}_{\mathrm{rob}}(\hat\beta) = B^{-1}\left(\sum_i s_i s_i^\mathsf{T}\right)B^{-1}. $$

Because \(B\) is symmetric, the two bread factors here are also written \(B^{-\mathsf{T}}\) and \(B^{-1}\) in the general sandwich form. When \(W\) has full column rank, \(P\) is a symmetric idempotent projection: \(P^\mathsf{T}=P\), and \(P^2=WB^{-1}(W^\mathsf{T}W)B^{-1}W^\mathsf{T}=P\). Its diagonal blocks need not themselves be projections.

In particular, \(P_{ii}\) is positive semidefinite and has eigenvalues between zero and one, but it is generally not idempotent. The full identity \(P^2=P\) involves cross-cluster blocks as well as diagonal blocks. Also, \(\sum_i\operatorname{tr}(P_{ii})=\operatorname{tr}(P)=p\), where \(p\) is the number of regression coefficients. A large eigenvalue of \(P_{ii}\) indicates a direction in that cluster’s whitened response space that is strongly constrained by fitting.

Fay–Graubard and CR2-Style Adjustments

The central construction is to inflate the whitened residual block in directions where fitting has reduced its variance. For the usual working-covariance target, define a symmetric adjustment matrix for cluster \(i\) by

$$ A_i=(I_{m_i}-P_{ii})^{-1/2}, $$

where \(m_i\) is the cluster size and the inverse square root is the symmetric matrix function: if \(P_{ii}=U_i\Lambda_iU_i^\mathsf{T}\), then \(A_i=U_i(I-\Lambda_i)^{-1/2}U_i^\mathsf{T}\). This is the standard whitened form of a Fay–Graubard-type leverage adjustment and of the basic CR2-style adjustment under a working-covariance target. The adjusted score and covariance estimator are

$$ \tilde s_i=W_i^\mathsf{T}A_i r_i, \qquad \widehat{\operatorname{Var}}_{\mathrm{adj}}(\hat\beta) = B^{-1}\left(\sum_i \tilde s_i\tilde s_i^\mathsf{T}\right)B^{-1}. $$

The factor \(A_i\) acts on the whitened residual, not directly on the unwhitened response residual unless the corresponding covariance transformations are included. Other CR2 implementations can use a specified target covariance and construct an adjustment to match that target. The formula above is the working-covariance version; the target and parameterization must be stated when comparing implementations.

Result: If every eigenvalue of every \(P_{ii}\) is strictly less than one, \(A_i\) exists and is positive definite. In a linearized model with independent clusters and correctly specified working covariance, this adjustment makes the covariance of the adjusted residual block equal to the identity.

Here is the justification. Consider the whitened linear model \(y=W\beta+\varepsilon\), with \(E[\varepsilon]=0\) and \(\operatorname{Var}(\varepsilon)=I\). The fitted residual vector is \(r=(I-P)y=(I-P)\varepsilon\), because \((I-P)W=0\). Its covariance is

$$ \operatorname{Var}(r) =(I-P)\operatorname{Var}(\varepsilon)(I-P)^\mathsf{T} =(I-P)^2=I-P. $$

Taking the \(i\)th diagonal block gives \(\operatorname{Var}(r_i)=I_{m_i}-P_{ii}\). Since \(A_i\) is symmetric and is a function of \(P_{ii}\),

$$ \operatorname{Var}(A_i r_i) =A_i(I_{m_i}-P_{ii})A_i^\mathsf{T} =(I_{m_i}-P_{ii})^{-1/2}(I_{m_i}-P_{ii})(I_{m_i}-P_{ii})^{-1/2} =I_{m_i}. $$

This proves the stated residual-covariance property under the assumptions of the linearized model. In GEE, the mean model is generally nonlinear in its coefficients, and the covariance estimate is formed from observed cluster scores. Thus the same construction is a leverage correction motivated by local linearization; it does not make the finite-sample sandwich exact under arbitrary dependence or mean-model misspecification. \(\square\)

Worked Calculations

Worked Example: A Scalar Cluster Adjustment

Suppose there is one coefficient and two scalar clusters with whitened design values \(w_1=2\) and \(w_2=1\). Then \(B=2^2+1^2=5\), and the leverage values are \(h_1=w_1^2/B=4/5=0.8\) and \(h_2=w_2^2/B=1/5=0.2\). Take observed whitened residuals \(r_1=0.3\) and \(r_2=-0.6\). They are compatible with the fitted residual space because \(w_1r_1+w_2r_2=2(0.3)-0.6=0\).

The unadjusted cluster scores are \(w_1r_1=0.6\) and \(w_2r_2=-0.6\). Therefore the meat is \(0.6^2+(-0.6)^2=0.72\), and the estimated variance is \(0.72/5^2=0.0288\).

The scalar adjustment factors are \(A_1=1/\sqrt{1-0.8}=1/\sqrt{0.2}\) and \(A_2=1/\sqrt{1-0.2}=1/\sqrt{0.8}\). The adjusted meat, including the squared design values in each score, is \(2^2(0.3)^2/0.2+1^2(-0.6)^2/0.8=0.36/0.2+0.36/0.8=1.8+0.45=2.25\). Thus the adjusted variance is \(2.25/25=0.09\). It is \(0.09/0.0288=3.125\) times the unadjusted estimate. The adjustment acts on residuals, but the sandwich meat is built from adjusted scores, so the design weights cannot be omitted.

Worked Example: A Valid Matrix Leverage Block

Consider two clusters of size two and two coefficients. Define the stacked whitened design \(W\) through its blocks \(W_1=\operatorname{diag}(\sqrt{0.7},\sqrt{0.3})\) and \(W_2=\operatorname{diag}(\sqrt{0.3},\sqrt{0.7})\). Then \(B=W_1^\mathsf{T}W_1+W_2^\mathsf{T}W_2=I_2\), so the full projection is \(P=WW^\mathsf{T}\). Its diagonal blocks are \(P_{11}=\operatorname{diag}(0.7,0.3)\) and \(P_{22}=\operatorname{diag}(0.3,0.7)\); its cross-block is \(P_{12}=\operatorname{diag}(\sqrt{0.21},\sqrt{0.21})\), with \(P_{21}=P_{12}^\mathsf{T}\).

The cross-block is essential: these blocks come from the full matrix \(P=WW^\mathsf{T}\), which is symmetric and idempotent because \(W^\mathsf{T}W=I_2\). The diagonal block \(P_{11}\) is not idempotent: its squared diagonal entries are \(0.49\) and \(0.09\), not \(0.7\) and \(0.3\). Its adjustment is \(A_1=\operatorname{diag}(1/\sqrt{0.3},1/\sqrt{0.7})\); likewise \(A_2=\operatorname{diag}(1/\sqrt{0.7},1/\sqrt{0.3})\).

For a compatible fitted residual, choose \(r_1=(\sqrt{0.3},\sqrt{0.7})^\mathsf{T}\) and \(r_2=(-\sqrt{0.7},-\sqrt{0.3})^\mathsf{T}\). Directly, \(W_1^\mathsf{T}r_1=(\sqrt{0.21},\sqrt{0.21})^\mathsf{T}\) and \(W_2^\mathsf{T}r_2=(-\sqrt{0.21},-\sqrt{0.21})^\mathsf{T}\), so \(W^\mathsf{T}r=0\), equivalently \(Pr=0\). The first adjusted residual is \(A_1r_1=(1,1)^\mathsf{T}\). This calculation illustrates both the matrix square-root construction and why a proposed residual must satisfy the full fitted-residual condition, not a single block equation.

Worked Example: Near-Unit Leverage

For a one-coefficient model, let the whitened design values be \(w_1=3\) and \(w_2=1\). Then \(B=9+1=10\), and the leverages are \(h_1=0.9\) and \(h_2=0.1\). Choose residuals \(r_1=1\) and \(r_2=-3\); they satisfy \(3(1)+1(-3)=0\). The unadjusted meat is \(3^2(1)^2+1^2(-3)^2=9+9=18\), giving variance \(18/10^2=0.18\).

The adjustment factors are \(1/\sqrt{0.1}\) and \(1/\sqrt{0.9}\). The adjusted meat is \(9(1)^2/0.1+1(9)/0.9=90+10=100\), and the adjusted variance is \(100/100=1\). The large increase is not an arithmetic anomaly: the first cluster’s residual lies in a direction whose fitted residual variance is only \(1-h_1=0.1\) under the model used to construct the leverage. It is also a warning that an estimate can become highly sensitive when leverage is extreme.

Conditions, Interpretation, and Common Pitfalls

The inverse square root exists only if \(I_{m_i}-P_{ii}\) is positive definite, or equivalently every eigenvalue of \(P_{ii}\) is strictly below one. If an eigenvalue equals one, the corresponding residual direction has zero fitted-residual variance in the linear projection calculation, and the stated adjustment is undefined. If an eigenvalue is close to one, the adjustment factor in that direction is large, so a small change in the residual can produce a large change in the covariance estimate. Numerical truncation or alternative regularization may be used in some software, but it changes the stated estimator and should be reported rather than silently treated as the same correction.

High leverage is especially concerning when there are few independent clusters, when cluster sizes are very unequal, or when one cluster contains covariate patterns that are poorly represented elsewhere. Under these conditions, the unadjusted robust standard error may be unreliable because the empirical meat is based on fitted residual scores that have been shrunk by estimation. Leverage adjustment can reduce this downward bias in suitable settings, but it cannot create independent information, repair a misspecified mean model, or ensure reliable tests with very few clusters. The correction’s performance also depends on the working covariance and target used to define the whitened geometry.

  • Mistake: treating \(P_{ii}\) as a projection. The full \(P\) is idempotent, but a diagonal block \(P_{ii}\) is generally not. Its eigenvalues can be between zero and one without being only zero or one.
  • Mistake: setting cross-cluster blocks to zero while keeping arbitrary diagonal blocks. The resulting block-diagonal matrix need not be idempotent and need not represent a fitted-value projection. Any full projection must satisfy all block equations implied by \(P^2=P\).
  • Mistake: adjusting residuals but forgetting the design in the meat. The contribution is \(\tilde s_i\tilde s_i^\mathsf{T}\), with \(\tilde s_i=W_i^\mathsf{T}A_ir_i\); in a scalar example it includes \(w_i^2\).
  • Mistake: treating a proposed residual block as freely selectable. A stacked fitted residual must satisfy \(Pr=0\), equivalently \(W^\mathsf{T}r=0\). One block equation alone does not establish compatibility.
Key takeaway: Leverage adjustments inflate whitened cluster residuals using the inverse square root of their fitted-residual covariance block. The construction is justified by a linearized working model, but high leverage can make the adjustment unstable, and the corrected sandwich remains a finite-sample approximation rather than a universal guarantee.

Check Your Understanding

Use the definitions and derivations above to answer these questions.

  1. Why is the full whitened hat matrix a projection when \(W\) has full column rank, and why does that not imply that each \(P_{ii}\) is idempotent?
  2. In the scalar case, how does a leverage value \(h_i\) determine the residual adjustment factor?
  3. For the linearized model with \(\operatorname{Var}(\varepsilon)=I\), derive the covariance of the fitted residual block \(r_i\).
  4. What condition makes the inverse square root \(A_i\) undefined, and what does a nearly violated condition imply in practice?
  5. Why must the design matrix appear when computing the adjusted cluster contribution to the sandwich meat?
Clinical Biostats