Tutorials › Generalized Linear Mixed Models (GLMM) › Robust And Model-Based GEE Standard Errors

GLMM Versus GEE · Tutorial 137 of 698

Robust And Model-Based GEE Standard Errors

Learn when GEE model-based and robust standard errors agree, why they can differ, and how to interpret that difference in practice.

Intermediate 12 min read

What You'll Learn

  • Distinguish the model-based covariance estimate from the robust sandwich estimate in GEE.
  • Derive why the two estimates agree in expectation when the working covariance is correct.
  • Explain why a wrong working correlation can change standard errors while leaving the fitted mean coefficients consistent.
  • Calculate both standard errors from a hypothetical clustered data set.
  • Compare candidate working correlations and diagnose when standard-error differences deserve attention.
  • Recognize the assumptions and limitations behind robust standard errors.

Why GEE Has Two Standard Errors

In generalized estimating equations (GEE), the working correlation helps weight observations within a cluster while estimating the marginal mean. The same choice also enters the model-based covariance estimate for the fitted coefficients. A second estimate, the robust sandwich covariance, uses the observed cluster-level estimating-equation contributions to estimate uncertainty. These estimates may be similar, but they answer different questions about the assumptions used for inference.

The distinction matters because a working correlation is a device for representing within-cluster dependence, not a guarantee that the dependence has been specified correctly. If the marginal mean model is correct and there are sufficiently many independent clusters, the sandwich estimate can remain consistent even when the working correlation is wrong. The model-based estimate generally needs the working covariance to be correct as well.

Definition: Let \(Y_i\) be the outcome vector for cluster \(i\), and let \(\mu_i\) be its marginal mean vector under the fitted mean model. Define \(D_i=\partial\mu_i/\partial\beta^\top\), where \(\beta\) is the vector of mean-model coefficients. Let \(V_i\) be the working covariance matrix, constructed from the working variance and working correlation. The cluster contribution to the GEE is \(U_i=D_i^\top V_i^{-1}(Y_i-\mu_i)\), and the estimating equation is \(\sum_{i=1}^K U_i=0\), where \(K\) is the number of clusters.

At the fitted coefficient estimate \(\hat{\beta}\), define the “bread” matrix \(B=\sum_{i=1}^K D_i^\top V_i^{-1}D_i\), and the empirical “meat” matrix \(M=\sum_{i=1}^K U_iU_i^\top\). The two covariance estimates are

$$ \widehat{\operatorname{Var}}_{\mathrm{MB}}(\hat{\beta})=B^{-1}, \qquad \widehat{\operatorname{Var}}_{\mathrm{R}}(\hat{\beta})=B^{-1}MB^{-1}. $$

The subscripts MB and R denote model-based and robust, respectively. Standard errors are the square roots of the corresponding diagonal entries. Both estimates use the same fitted mean coefficients when the same GEE fit is used; changing the covariance estimate alone does not change \(\hat{\beta}\).

When Should the Estimates Agree?

The key condition is whether the working covariance represents the true covariance of \(Y_i\) given the covariates. Suppose clusters are independent, the marginal mean model is correct, and the working covariance \(V_i\) equals the true covariance \(\Sigma_i=\operatorname{Var}(Y_i)\). With the design and working covariance treated as fixed and \(D_i\) evaluated at the true parameter \(\beta_0\), the expected cluster contribution at that parameter is

$$ E\{U_i(\beta_0)U_i(\beta_0)^\top\} =D_i^\top V_i^{-1}\Sigma_i V_i^{-1}D_i =D_i^\top V_i^{-1}D_i. $$

Summing over clusters gives \(E\{M(\beta_0)\}=B(\beta_0)\), with both quantities evaluated at the true parameter. This is not generally an exact finite-sample identity for \(M(\hat{\beta})\), because fitting the mean makes the residual contributions dependent. Under these conditions, the sandwich covariance and the model-based covariance have the same large-sample target. In a finite sample they need not be numerically equal: the robust estimate uses the particular residual patterns observed across clusters, whereas the model-based estimate uses the assumed covariance structure.

If \(V_i\) differs from \(\Sigma_i\), the middle matrix in the expected meat is instead \(D_i^\top V_i^{-1}\Sigma_i V_i^{-1}D_i\), which need not equal \(D_i^\top V_i^{-1}D_i\). This explains the central distinction: the model-based estimate treats the working covariance as correct; the robust estimate allows it to be wrong, provided the mean model and other large-sample conditions are adequate.

Worked Example: A Correct Versus Incorrect Working Correlation

Consider clusters of two continuous outcomes, with an intercept-only marginal mean. For this illustration, take \(D_i=(1,1)^\top\). Suppose the working marginal variances are both 1 and the working exchangeable correlation is 0.5, so

$$ V_i= \begin{pmatrix} 1&0.5\\ 0.5&1 \end{pmatrix}, \qquad V_i^{-1}= \begin{pmatrix} 4/3&-2/3\\ -2/3&4/3 \end{pmatrix}. $$

The bread contribution for each cluster is \(D_i^\top V_i^{-1}D_i=4/3\). If this working covariance is also the true covariance, then \(E(U_i^2)=4/3\), so the expected meat contribution equals the bread contribution. The two covariance estimates therefore have the same large-sample target.

Now suppose instead that the true within-cluster correlation is 0, so the true covariance is \(\Sigma_i=I\), while the GEE still uses the working correlation 0.5. The expected meat contribution becomes

$$ E(U_i^2) =D_i^\top V_i^{-1}I V_i^{-1}D_i =\left(\frac{2}{3}\right)^2+\left(\frac{2}{3}\right)^2 =\frac{8}{9}. $$

This is not \(4/3\), the bread contribution. The model-based and robust covariance targets can therefore differ. This calculation compares covariance contributions; it does not assert that the two estimated standard errors must differ in a particular direction in every data set.

A Numerical Comparison From Clustered Data

The next example makes the finite-sample calculations explicit. It uses an intercept-only GEE, so the coefficient is a marginal mean. For clarity, suppose the working variance and correlation are treated as specified; in typical applications they may themselves be estimated.

Worked Example: Computing Both Standard Errors

Suppose five independent hypothetical clusters each contain two measurements. The paired measurements are \((8,8)\), \((9,9)\), \((10,10)\), \((11,11)\), and \((12,12)\), in outcome units. Fit an intercept-only GEE using marginal variance 2 and working exchangeable correlation \(\rho=0.3\). The fitted marginal mean is the grand mean:

$$ \hat{\beta}=\bar{Y}=\frac{8+8+9+9+10+10+11+11+12+12}{10}=10. $$

For each pair, \(V_i=2\begin{pmatrix}1&0.3\\0.3&1\end{pmatrix}\). Since \(D_i=(1,1)^\top\), the bread contribution is \(D_i^\top V_i^{-1}D_i=2/[2(1+0.3)]=1/1.3\). Across five clusters,

$$ B=\frac{5}{1.3}=3.8462, \qquad \widehat{\operatorname{Var}}_{\mathrm{MB}}(\hat{\beta})=B^{-1}=0.2600. $$

Thus the model-based standard error is \(\sqrt{0.2600}\approx0.5099\) outcome units.

For the robust estimate, the five cluster means are 8, 9, 10, 11, and 12, so their deviations from the fitted mean are \(-2,-1,0,1,2\). Each cluster score is its residual sum divided by \(2(1.3)\), or equivalently its cluster-mean deviation divided by \(1.3\). Therefore,

$$ M=\frac{(-2)^2+(-1)^2+0^2+1^2+2^2}{1.3^2} =\frac{10}{1.69}=5.9172, \qquad \widehat{\operatorname{Var}}_{\mathrm{R}}(\hat{\beta}) =\frac{5.9172}{3.8462^2}=0.4000. $$

The robust standard error is \(\sqrt{0.4000}\approx0.6325\) outcome units. In this particular data set it is larger than the model-based standard error. This difference reflects the observed spread of cluster-level residual contributions relative to the covariance structure used by the model-based calculation. It is not a general rule that the robust estimate must be larger.

How the Choice of Working Correlation Affects the Comparison

The working correlation can affect both the weights in the GEE and the model-based covariance. How strongly it affects the coefficient estimate depends on the design and mean model. In the balanced intercept-only setting below, the fitted mean and the raw sandwich variance are unchanged across working correlations, while the model-based standard error changes.

Worked Example: Comparing Three Working Correlations

Use the same five hypothetical paired clusters above, with marginal variance 2. For an intercept-only mean and equal cluster sizes, the model-based variance under an exchangeable working correlation \(\rho\) is

$$ \widehat{\operatorname{Var}}_{\mathrm{MB}}(\hat{\beta}) =\frac{2(1+\rho)}{2K} =\frac{1+\rho}{5}, \qquad K=5. $$

For \(\rho=0\), the model-based variance is \(1/5=0.2000\), giving \(SE_{\mathrm{MB}}=\sqrt{0.2000}\approx0.4472\). For \(\rho=0.3\), it is \(1.3/5=0.2600\), giving \(SE_{\mathrm{MB}}\approx0.5099\). For \(\rho=0.6\), it is \(1.6/5=0.3200\), giving \(SE_{\mathrm{MB}}\approx0.5657\).

For all three choices, the fitted mean remains 10. In this balanced intercept-only example, the sandwich variance also remains \(10/5^2=0.4000\), because the working-correlation factor in the cluster scores cancels with the bread factors. Thus the robust standard error remains about 0.6325, while the model-based standard error varies with \(\rho\). This cancellation is a feature of this simple balanced example, not a general property of GEE with covariates, unequal cluster sizes, or other mean structures.

Assumptions, Diagnostics, and Alternatives

The robust covariance estimate is not assumption-free. Its usual large-sample justification requires independent clusters, a correctly specified marginal mean model, adequate regularity conditions such as finite cluster-level score variances, and enough clusters for the empirical meat to estimate its expectation reliably. The model-based estimate additionally relies on the working covariance being correctly specified for its covariance interpretation. If either estimate is used with a misspecified mean model, the sandwich formula does not automatically repair the resulting bias in the mean coefficients.

When robust and model-based standard errors differ, treat the difference as information about sensitivity to the covariance assumptions, not as a test that identifies which estimate is “right.” Useful checks include examining whether the working correlation is plausible for the repeated-measure structure, comparing a small set of defensible working correlations, and reporting whether the substantive inference changes. A large difference signals that uncertainty estimates depend materially on the covariance assumptions or observed cluster contributions; it does not by itself diagnose the source.

The main alternatives have different trade-offs:

ApproachStrengthLimitation
Model-based covarianceCan be more precise when the working covariance is correctly specified.Can give misleading uncertainty estimates if that covariance is wrong.
Robust sandwich covarianceCan remain consistent under working-correlation misspecification when the mean model is correct and there are enough independent clusters.Can be unstable with limited cluster information and does not protect against mean-model misspecification.
Independence working correlation with robust covarianceProvides a simple set of working weights while retaining sandwich protection under its assumptions.May sacrifice efficiency when substantial within-cluster dependence could have been represented usefully.

The model-based estimate is not inherently inferior: when its covariance assumptions are well supported, it can be a useful and efficient estimate. Likewise, the robust estimate is not a universal safeguard. A defensible analysis states which covariance estimate is reported, checks the sensitivity that matters for the study, and bases interpretation on the actual mean-model and cluster assumptions.

Common pitfall: “The robust standard error is always larger, so it is automatically safer.” This is incorrect. The robust estimate can be smaller or larger than the model-based estimate because it is driven by the observed cluster-level score variation. It is robust to certain working-covariance errors under stated conditions, not to every form of model misspecification.
1
Fit the mean model.
State the marginal mean and identify the independent clusters. Correct mean specification is essential for the usual GEE coefficient and sandwich arguments.
2
Choose and assess working covariance.
Use a structure appropriate to the measurement design, and regard its adequacy as an assumption rather than a certainty.
3
Compare uncertainty estimates.
Compute model-based and robust standard errors, then assess whether their difference changes the interpretation relevant to the analysis.

Check Your Understanding

Answer each question, then compare your reasoning with the short solutions.

  1. Under what condition does the expected robust meat equal the bread?
  2. If the working correlation is wrong but the marginal mean is correct, which covariance estimate is designed to remain consistent under many independent clusters?
  3. In the five-cluster example, why did the robust standard error not change across the three working correlations?
  4. A researcher claims that a larger robust standard error proves the working correlation is wrong. What is the problem with this conclusion?

Solutions. (1) When the working covariance equals the true outcome covariance, \(E(U_iU_i^\top)=D_i^\top V_i^{-1}D_i\), so the expected meat equals the bread after summing clusters. (2) The robust sandwich estimate, provided the mean model is correct, clusters are independent, and the large-sample conditions are adequate. (3) In this balanced intercept-only example, the correlation factor in the scores cancels with the bread factors, leaving the raw sandwich variance equal to the sum of squared cluster-mean deviations divided by \(K^2\). This cancellation need not occur in other designs. (4) The difference alone does not identify the true covariance structure; robust standard errors can be either larger or smaller, and sample score variation also affects them.

Clinical Biostats