Tutorials › Generalized Linear Models › Joint Wald Tests for GEE Contrasts

GEE Inference and Limitations · Tutorial 880 of 981

Joint Wald Tests for GEE Contrasts

Use the robust covariance of GEE coefficient estimates to test several linear restrictions together, and interpret the resulting large-sample chi-square statistic.

Advanced 12 min read

What You'll Learn

  • Express joint hypotheses as a full-row-rank matrix restriction on GEE coefficients
  • Construct a Wald statistic from the robust covariance estimate
  • Apply the large-sample chi-square result with the covariance scaling made explicit
  • Test categorical predictors and interaction terms jointly
  • Build and evaluate prespecified contrast matrices
  • Recognize singular restrictions and common errors in joint testing

Why Test Restrictions Jointly?

A coefficient-by-coefficient analysis can miss the scientific question. For example, a categorical predictor represented by several indicator variables has no single coefficient that captures its overall association with the response. Likewise, an interaction may be assessed by asking whether all its coefficients are zero, rather than by examining each coefficient separately. A joint Wald test provides one test of several linear restrictions at once.

In generalized estimating equations (GEE), the observations within a cluster may be correlated, while distinct clusters are treated as independent. Joint Wald inference uses the estimated coefficient vector and its robust sandwich covariance. The covariance between coefficient estimates matters: treating the restrictions as separate tests generally does not produce the same test.

Definition: Let \(\hat{\beta}\) be a \(p\)-dimensional GEE coefficient estimator and let \(\hat{\Sigma}\) be its estimated robust covariance matrix. A set of \(q\) linear restrictions is written \(H_0:R\beta=r\), where \(R\) is a fixed \(q\times p\) matrix of rank \(q\), and \(r\) is a fixed \(q\)-vector. When \(R\hat{\Sigma}R^\top\) is invertible, the joint Wald statistic is $$ W=(R\hat{\beta}-r)^\top \left(R\hat{\Sigma}R^\top\right)^{-1} (R\hat{\beta}-r). $$

The rank condition means that the restrictions are linearly independent: the matrix does not ask the data to test the same restriction more than once in different forms. The vector \(R\hat{\beta}-r\) records the estimated departures from the null values, and \(R\hat{\Sigma}R^\top\) is the estimated covariance matrix of those departures. Thus the statistic measures the departures relative to their joint uncertainty.

Large-Sample Reference Distribution

The usual reference distribution is justified as the number of independent clusters increases. Write \(G\) for that number, and assume the coefficient dimension \(p\) and restriction count \(q\) remain fixed. Under the null, suppose the estimator and robust covariance estimator satisfy $$ \sqrt{G}(\hat{\beta}-\beta)\xrightarrow{d}N(0,\Sigma), \qquad G\hat{\Sigma}\xrightarrow{p}\Sigma, $$ where \(\Sigma\) is a finite covariance matrix and \(R\Sigma R^\top\) is positive definite. Here \(\hat{\Sigma}\) estimates the covariance of \(\hat{\beta}\), so it is of order \(1/G\); it is \(G\hat{\Sigma}\), not \(\hat{\Sigma}\) itself, that converges to \(\Sigma\).

Theorem: Under the stated assumptions, if \(H_0:R\beta=r\) holds, the joint Wald statistic satisfies \(W\xrightarrow{d}\chi^2_q\) as \(G\to\infty\).

Proof. Under the null, \(R\beta-r=0\), so \(R\hat{\beta}-r=R(\hat{\beta}-\beta)\). Define \(Z_G=\sqrt{G}R(\hat{\beta}-\beta)\) and \(V_G=G R\hat{\Sigma}R^\top\). The assumed limits give \(Z_G\xrightarrow{d}N(0,R\Sigma R^\top)\) and \(V_G\xrightarrow{p}R\Sigma R^\top\). Since the latter limit is positive definite, matrix inversion is continuous at that limit, and Slutsky’s theorem applies. Rewriting the statistic with these scaled quantities gives $$ W=Z_G^\top V_G^{-1}Z_G \xrightarrow{d} Z^\top(R\Sigma R^\top)^{-1}Z, \qquad Z\sim N(0,R\Sigma R^\top). $$ The quadratic form on the right has a \(\chi^2_q\) distribution: if \(A=R\Sigma R^\top\), then \(A^{-1/2}Z\sim N(0,I_q)\), and the quadratic form is \((A^{-1/2}Z)^\top(A^{-1/2}Z)\), a sum of squares of \(q\) independent standard normal variables. Therefore \(W\xrightarrow{d}\chi^2_q\). \(\square\)

This is an asymptotic result, not an exact finite-sample distribution. The usual large-sample \(p\)-value is the upper-tail probability \(P(\chi^2_q\geq W_{\mathrm{obs}})\). The degrees of freedom are the number \(q\) of independent restrictions, not the number of fitted coefficients \(p\).

Worked Tests in GEE Models

Worked Example: Joint Test of a Treatment Effect and an Interaction

Suppose a marginal mean model uses coefficients \(\beta=(\beta_0,\beta_A,\beta_t,\beta_{At})^\top\), for an intercept, treatment indicator, time, and treatment-by-time interaction. The robust estimates for treatment and interaction are \(0.4\) and \(-0.2\). Their robust covariance submatrix is $$ \hat{V}= \begin{pmatrix} 0.04&0.01\\ 0.01&0.09 \end{pmatrix}. $$ Test whether treatment has no effect at the reference time and whether its effect does not change with time: \(H_0:\beta_A=\beta_{At}=0\).

The restriction matrix selects those two coefficients: \(R=\begin{pmatrix}0&1&0&0\\0&0&0&1\end{pmatrix}\), \(r=(0,0)^\top\). The estimated restriction vector is \(c=(0.4,-0.2)^\top\). The determinant of \(\hat V\) is \(0.04(0.09)-0.01^2=0.0035\), so $$ \hat V^{-1}=\frac{1}{0.0035} \begin{pmatrix} 0.09&-0.01\\ -0.01&0.04 \end{pmatrix}. $$ Consequently, $$ W=c^\top\hat V^{-1}c =\frac{0.09(0.4)^2-0.02(0.4)(-0.2)+0.04(-0.2)^2}{0.0035} =\frac{0.0176}{0.0035} \approx 5.029. $$

The reference distribution is \(\chi^2_2\), because there are two independent restrictions. For two degrees of freedom, the upper-tail probability is \(e^{-W/2}\), giving \(e^{-5.029/2}\approx 0.081\). This test does not reject at the 5% level. It tests the pair of restrictions together; it is not obtained by combining two separate coefficient tests.

Worked Example: Joint Test of a Three-Level Categorical Predictor

A three-level predictor is represented by two indicators, with coefficients \(\beta_1\) and \(\beta_2\) relative to the reference category. Suppose their estimates are \((0.3,-0.1)^\top\), with robust covariance $$ \hat V= \begin{pmatrix} 0.09&0.03\\ 0.03&0.04 \end{pmatrix}. $$ The overall null of no difference from the reference category is \(H_0:\beta_1=\beta_2=0\). Here \(R\) selects both coefficients and \(r=(0,0)^\top\).

The determinant is \(0.09(0.04)-0.03^2=0.0027\), and hence $$ \hat V^{-1}=\frac{1}{0.0027} \begin{pmatrix} 0.04&-0.03\\ -0.03&0.09 \end{pmatrix}. $$ With \(c=(0.3,-0.1)^\top\), the numerator of \(c^\top\hat V^{-1}c\), before division by \(0.0027\), is \(0.04(0.3)^2-0.06(0.3)(-0.1)+0.09(-0.1)^2 =0.0036+0.0018+0.0009=0.0063\). Thus \(W=0.0063/0.0027\approx2.333\). The asymptotic reference distribution is \(\chi^2_2\), giving an upper-tail probability of \(e^{-2.333/2}\approx0.311\). The test assesses the categorical predictor as a whole, accounting for the covariance between its two estimated coefficients.

Worked Example: Testing Prespecified Time-Specific Contrasts

Suppose the treatment effect at time \(t\) is \(\beta_A+t\beta_{At}\). A study prespecifies the two questions of whether the treatment effects at times 1 and 2 are both zero. The corresponding restriction matrix for \((\beta_A,\beta_{At})^\top\) is $$ R=\begin{pmatrix}1&1\\1&2\end{pmatrix}. $$ Let the coefficient estimates be \((0.3,-0.1)^\top\), with robust covariance \(\hat V=\begin{pmatrix}0.04&0.01\\0.01&0.01\end{pmatrix}\). The two estimated contrasts are \(c=R\hat\beta=(0.2,0.1)^\top\).

Their covariance must also be transformed by \(R\): $$ R\hat V R^\top= \begin{pmatrix} 0.07&0.09\\ 0.09&0.12 \end{pmatrix}. $$ For example, the first contrast variance is \(0.04+2(0.01)+0.01=0.07\), and the covariance between the contrasts is \(0.04+2(0.01)+0.01+2(0.01)=0.09\). The determinant is \(0.07(0.12)-0.09^2=0.0003\); the inverse is $$ (R\hat V R^\top)^{-1} =\frac{1}{0.0003} \begin{pmatrix}0.12&-0.09\\-0.09&0.07\end{pmatrix}. $$ Therefore \(W=\{0.12(0.2)^2-0.18(0.2)(0.1)+0.07(0.1)^2\}/0.0003 =0.0019/0.0003\approx6.333\). With two restrictions, the \(\chi^2_2\) upper-tail probability is \(e^{-6.333/2}\approx0.042\). The joint test rejects at the 5% level.

Equivalent Restriction Matrices

A hypothesis can sometimes be written in more than one way. For example, testing two time-specific effects jointly can be expressed as two contrasts or as restrictions directly on the underlying coefficients. If two matrices describe the same restrictions, they should give the same Wald statistic, provided they are related by an invertible change of basis.

Result: If \(A\) is a fixed invertible \(q\times q\) matrix, replacing \((R,r)\) by \((AR,Ar)\) leaves the Wald statistic unchanged, whenever the required covariance matrices are invertible.

Derivation. The new estimated departure is \(A(R\hat{\beta}-r)\), and its estimated covariance is \(A(R\hat{\Sigma}R^\top)A^\top\). For invertible \(A\), \((A M A^\top)^{-1}=(A^\top)^{-1}M^{-1}A^{-1}\), where \(M=R\hat{\Sigma}R^\top\). Substitution gives $$ \{A(R\hat{\beta}-r)\}^\top \{A M A^\top\}^{-1} \{A(R\hat{\beta}-r)\} =(R\hat{\beta}-r)^\top M^{-1}(R\hat{\beta}-r). $$ Thus the statistic depends on the restrictions themselves, not on the particular invertible basis used to express them. \(\square\)

Practical Checks and Common Mistakes

Before calculating a test, write the null as \(R\beta=r\), verify that \(R\) has full row rank, and use the covariance of the restrictions \(R\hat{\beta}\). In GEE, the covariance should be the robust sandwich estimate when robust Wald inference is intended. The test is only defined by the displayed inverse when \(R\hat{\Sigma}R^\top\) is invertible; a singular matrix can indicate redundant restrictions or a covariance estimate that cannot support the requested test.

  • Wrong: “Each coefficient has a nonsignificant individual test, so the joint null must be true.” Individual tests do not account for the joint covariance structure and do not establish the joint restriction.
  • Correction: Form the full restriction vector and its covariance, then calculate one Wald statistic with \(q\) degrees of freedom.
  • Wrong: Use an unscaled covariance limit in the statistic while assuming that \(\hat{\Sigma}\) itself converges to a nonzero \(\Sigma\). For a covariance estimate of \(\hat{\beta}\), the usual scaling is \(G\hat{\Sigma}\xrightarrow{p}\Sigma\).
  • Correction: Keep the scaling consistent: the statistic uses \(\hat{\Sigma}\), while its asymptotic proof uses the scaled covariance \(G\hat{\Sigma}\).
  • Wrong: Count all fitted coefficients as the degrees of freedom. The degrees of freedom are the number of independent restrictions, \(q\).

Joint Wald tests are useful when the scientific claim concerns a collection of coefficients or contrasts rather than one coefficient in isolation. Their validity depends on correctly specifying the hypothesis and using a covariance estimate with the appropriate scaling and dependence structure. The chi-square calibration is large-sample; it should not be interpreted as a guarantee of accurate calibration when the number of independent clusters is small.

Check Your Understanding

For each question, identify the restriction or calculation needed before interpreting a joint Wald test.

  1. A four-level categorical predictor is represented by three indicators. What is the null hypothesis for testing its overall association against a reference category, and what are the degrees of freedom?
  2. In the large-cluster asymptotic result, if \(G\hat{\Sigma}\xrightarrow{p}\Sigma\), what covariance matrix belongs in the finite-sample Wald statistic?
  3. Why can two separate coefficient \(p\)-values not generally replace a joint Wald test of both coefficients?
  4. For a restriction matrix \(R\), what matrix estimates the covariance of \(R\hat{\beta}\)?
  5. If an invertible matrix \(A\) changes the restrictions from \((R,r)\) to \((AR,Ar)\), does the Wald statistic change? State the condition that makes the two tests equivalent.
Clinical Biostats