Tutorials › Statistical Theory III - Theories of Inference, Multivariate Methods, and Contingency Tables › Robust Wald Tests for Quasi-Likelihood Contrasts

Quasi-Likelihood and Overdispersion · Tutorial 675 of 972

Robust Wald Tests for Quasi-Likelihood Contrasts

Use robust sandwich covariance estimates to test linear restrictions and build confidence regions, while distinguishing asymptotic calibration from finite-sample degrees-of-freedom choices.

Advanced 11 min read

What You'll Learn

  • Define linear contrasts and joint null hypotheses for quasi-likelihood parameters
  • Estimate contrast covariance using sensitivity and variability components
  • Construct scalar robust Wald tests and confidence intervals
  • Derive the asymptotic chi-square test for multiple restrictions
  • Identify how covariance between estimates affects a contrast
  • Distinguish asymptotic reference distributions from finite-sample degrees-of-freedom approximations

Why Robust Wald Inference Uses the Sandwich

Quasi-likelihood specifies a relationship between the mean and variance without requiring a complete probability distribution. Consequently, the covariance matrix implied by the working variance need not describe the actual sampling variability of the estimator. For a question about a linear combination of parameters, the relevant uncertainty is therefore the uncertainty estimated by the sandwich covariance, not automatically the covariance obtained by treating the working model as a full probability law.

This tutorial develops Wald tests and confidence regions for linear contrasts. The central steps are to define the contrast, estimate its covariance by propagating the sandwich covariance of the parameter estimator, and choose a reference distribution appropriate to the amount of independent information available.

Definition: Let \(\beta\in\mathbb{R}^p\) be a vector of quasi-likelihood parameters. A linear contrast is \(R\beta\), where \(R\) is a specified \(q\times p\) matrix. A joint null hypothesis has the form \(H_0:R\beta=r\), where \(r\in\mathbb{R}^q\). For a uniquely testable set of \(q\) restrictions, \(R\) has row rank \(q\).

A contrast need not be a difference between two coefficients. It can be a single coefficient, a sum, a difference, or a collection of such quantities. For example, a row of \(R\) can select one coefficient, while a row containing \(1\) and \(-1\) forms the difference between two coefficients. If the scientific claim is that several contrasts hold simultaneously, they belong in one matrix \(R\) and are tested jointly.

Estimating the Robust Covariance

Suppose the data consist of \(n\) independent observational units, or independent clusters, and the estimator solves estimating equations \(\sum_{i=1}^n\psi_i(\hat\beta)=0\). Here \(\psi_i\) is the score or estimating-function contribution from unit \(i\). In a quasi-likelihood model it may be a quasi-score contribution. The sandwich allows the variability of these contributions to differ from the working variance used to construct them.

Definition: Write \(A_n=\sum_{i=1}^n-\partial\psi_i(\hat\beta)/\partial\beta^\mathsf{T}\) for the estimated sensitivity matrix and \(B_n=\sum_{i=1}^n\psi_i(\hat\beta)\psi_i(\hat\beta)^\mathsf{T}\) for the empirical variability matrix. The sandwich estimator is $$ \widehat{\operatorname{Cov}}(\hat\beta)=A_n^{-1}B_nA_n^{-\mathsf{T}}, $$ when \(A_n\) is nonsingular. Here \(A_n^{-\mathsf{T}}=(A_n^{-1})^\mathsf{T}\). For clustered observations, each \(\psi_i\) in these sums is the contribution from one independent cluster.

The scale of this expression follows from using sums in both matrices. Equivalently, if sensitivity and variability are defined as averages, the corresponding covariance estimate includes a factor \(1/n\). These are the same convention expressed with different normalizations. Consistency requires appropriate regularity conditions, including independent sampling units, a well-behaved estimating equation, nonsingular limiting sensitivity, finite second moments, and consistent estimation of the sensitivity and variability. The sandwich protects against misspecification of the working variance, but does not by itself correct a misspecified mean model or dependence omitted from the definition of the independent units.

For a contrast, covariance is propagated by the same linear transformation used to form the contrast. Thus the estimated covariance of \(R\hat\beta\) is \(R\widehat{\operatorname{Cov}}(\hat\beta)R^\mathsf{T}\). In general, this step requires the off-diagonal entries of the parameter covariance matrix: coefficient estimates may be correlated.

Worked Example: Building a Sandwich Covariance from Scores

Suppose a two-parameter estimating equation has, at the fitted value, three independent-unit score contributions \(\psi_1=(1,1)^\mathsf{T}\), \(\psi_2=(-1,1)^\mathsf{T}\), and \(\psi_3=(0,-2)^\mathsf{T}\). Their sum is zero, as required at a solution. Suppose the estimated sensitivity is \(A_n=\begin{pmatrix}4&0\\0&2\end{pmatrix}\). Calculate the sandwich covariance estimate.

First, sum the outer products: \[ \psi_1\psi_1^\mathsf{T}=\begin{pmatrix}1&1\\1&1\end{pmatrix},\quad \psi_2\psi_2^\mathsf{T}=\begin{pmatrix}1&-1\\-1&1\end{pmatrix},\quad \psi_3\psi_3^\mathsf{T}=\begin{pmatrix}0&0\\0&4\end{pmatrix}. \] Therefore \(B_n=\begin{pmatrix}2&0\\0&6\end{pmatrix}\). Since \(A_n^{-1}=\begin{pmatrix}1/4&0\\0&1/2\end{pmatrix}\), the sandwich is \[ A_n^{-1}B_nA_n^{-\mathsf{T}} =\begin{pmatrix}1/4&0\\0&1/2\end{pmatrix} \begin{pmatrix}2&0\\0&6\end{pmatrix} \begin{pmatrix}1/4&0\\0&1/2\end{pmatrix} =\begin{pmatrix}1/8&0\\0&3/2\end{pmatrix}. \] Thus the estimated variances are \(0.125\) and \(1.5\), and the estimated covariance is zero. This small arithmetic example illustrates covariance construction; three units alone do not justify relying on a large-sample reference distribution.

Wald Tests and Confidence Regions

Let \(\widehat V=\widehat{\operatorname{Cov}}(\hat\beta)\). For testing \(H_0:R\beta=r\), the robust Wald statistic compares the estimated discrepancy \(R\hat\beta-r\) with its estimated covariance. A large discrepancy relative to that covariance is evidence against the null.

Theorem (asymptotic robust Wald test): Suppose \(\hat\beta\) is consistent for \(\beta\), \(\sqrt{n}(\hat\beta-\beta)\xrightarrow{d}N(0,\Sigma)\), and \(\widehat V\) consistently estimates the covariance of \(\hat\beta\), so that \(n\widehat V\xrightarrow{p}\Sigma\). If \(R\) has row rank \(q\) and \(R\Sigma R^\mathsf{T}\) is positive definite, then under \(H_0:R\beta=r\), $$ W=(R\hat\beta-r)^\mathsf{T} \left[R\widehat V R^\mathsf{T}\right]^{-1} (R\hat\beta-r) \xrightarrow{d}\chi^2_q. $$

Proof. Under the null, \(\sqrt{n}(R\hat\beta-r)\xrightarrow{d}N(0,R\Sigma R^\mathsf{T})\). Also, \(nR\widehat V R^\mathsf{T}\xrightarrow{p}R\Sigma R^\mathsf{T}\). Let \(C=R\Sigma R^\mathsf{T}\), which is positive definite by assumption. The continuous mapping theorem and Slutsky’s theorem imply that \[ W=\{\sqrt n(R\hat\beta-r)\}^\mathsf{T} \{nR\widehat V R^\mathsf{T}\}^{-1} \{\sqrt n(R\hat\beta-r)\} \xrightarrow{d}Z^\mathsf{T}C^{-1}Z, \] where \(Z\sim N(0,C)\). The vector \(C^{-1/2}Z\) has a \(q\)-dimensional standard normal distribution, so \(Z^\mathsf{T}C^{-1}Z\) is the sum of squares of \(q\) independent standard normal variables, which has a \(\chi^2_q\) distribution. This proves the result. \(\square\)

The corresponding asymptotic level-\(\alpha\) test rejects when \(W>\chi^2_{q,1-\alpha}\), the \(1-\alpha\) quantile of \(\chi^2_q\). For one contrast, \(q=1\), the squared Wald statistic is asymptotically \(\chi^2_1\); equivalently, the signed statistic is compared with standard normal critical values.

Theorem (asymptotic confidence region): Under the conditions above, an asymptotic \(1-\alpha\) confidence region for \(R\beta\) is $$ \left\{\eta\in\mathbb{R}^q: (R\hat\beta-\eta)^\mathsf{T} [R\widehat V R^\mathsf{T}]^{-1} (R\hat\beta-\eta) \leq \chi^2_{q,1-\alpha}\right\}. $$

Justification. If the true contrast is \(\eta=R\beta\), the expression on the left, evaluated at that value, converges in distribution to \(\chi^2_q\) by the same whitening argument as for the test. Its probability of being at most \(\chi^2_{q,1-\alpha}\) therefore tends to \(1-\alpha\). The region is an ellipsoid centered at \(R\hat\beta\), with its shape determined by the full estimated contrast covariance.

For a single contrast \(c^\mathsf{T}\beta\), a two-sided asymptotic \(1-\alpha\) interval is \[ c^\mathsf{T}\hat\beta\ \mathbin{\pm}\ z_{1-\alpha/2} \sqrt{c^\mathsf{T}\widehat Vc}, \] where \(z_{1-\alpha/2}\) is a standard normal quantile. This is an interval for the contrast, not a separate interval for each coefficient. Simultaneous statements about several contrasts call for a joint region or a specified simultaneous procedure.

Worked Example: A Robust Interval for a Difference

Suppose \(\hat\beta=(0.40,0.30,0.10)^\mathsf{T}\), with sandwich covariance estimate \[ \widehat V=\begin{pmatrix}0.04&0.01&0\\0.01&0.09&0.02\\0&0.02&0.16\end{pmatrix}. \] Find an approximate 95% interval for \(\beta_2-\beta_3\).

Set \(c=(0,1,-1)^\mathsf{T}\). The estimated contrast is \(c^\mathsf{T}\hat\beta=0.30-0.10=0.20\). Its variance estimate includes the covariance between the two estimates: \[ c^\mathsf{T}\widehat Vc=0.09+0.16-2(0.02)=0.21. \] The standard error is \(\sqrt{0.21}\approx0.4583\). Using \(z_{0.975}=1.96\), the interval is \(0.20\pm1.96(0.4583)=0.20\pm0.8983\), or approximately \((-0.698,1.098)\). The interval includes zero, so the corresponding two-sided asymptotic Wald test does not reject equality at the 5% level.

Worked Example: A Joint Robust Wald Test

Suppose the two estimated contrasts of interest are treatment and treatment-by-time effects, with estimate \(\hat\delta=(0.30,-0.10)^\mathsf{T}\) and robust covariance \[ \widehat V_\delta=\begin{pmatrix}0.09&0.015\\0.015&0.04\end{pmatrix}. \] Test the joint null that both effects are zero, using the asymptotic reference distribution.

Here \(q=2\), and the determinant of the covariance matrix is \(0.09(0.04)-(0.015)^2=0.003375\). Its inverse is \[ \widehat V_\delta^{-1}=\frac{1}{0.003375} \begin{pmatrix}0.04&-0.015\\-0.015&0.09\end{pmatrix}. \] The quadratic-form numerator is \[ 0.04(0.30)^2+0.09(-0.10)^2-2(0.015)(0.30)(-0.10) =0.0036+0.0009+0.0009=0.0054. \] Therefore \(W=0.0054/0.003375=1.60\). Under the null, compare this with \(\chi^2_2\); the upper-tail probability is \(\exp(-1.60/2)\approx0.449\). The joint null is not rejected at conventional significance levels. This test accounts for the covariance between the two estimated effects rather than treating them as independent.

Degrees of Freedom and Practical Interpretation

The chi-square and normal calibrations above are large-sample approximations. They do not assert that a robust Wald statistic has an exact chi-square or normal distribution in a finite sample. This distinction matters especially when independent information is limited. In clustered data, the relevant amount of information for robust inference is often more closely tied to the number of independent clusters than to the number of individual records within them.

A scalar test may be reported with a standard normal reference distribution, or with a \(t\) reference distribution using a stated degrees-of-freedom approximation. For a joint test, the asymptotic reference is \(\chi^2_q\); some finite-sample procedures instead use an \(F\) reference and an explicitly chosen denominator degrees of freedom. No single finite-sample degrees-of-freedom choice is universally exact for quasi-likelihood sandwich tests. The choice should reflect the design and the inferential procedure, and the report should state it. Simply substituting residual degrees of freedom or the number of clusters does not, by itself, establish exact calibration.

Worked Example: Keeping the Reference Distribution Explicit

Suppose a one-dimensional contrast estimate is \(0.50\) with sandwich standard error \(0.20\). The signed Wald statistic is \(0.50/0.20=2.50\), and the squared statistic is \(6.25\).

With an asymptotic standard normal reference, the two-sided \(p\)-value is approximately \(0.0124\). If a justified finite-sample procedure instead specifies a \(t\) reference with 8 degrees of freedom, the two-sided \(p\)-value is approximately \(0.037\). The covariance calculation and observed statistic are identical; the difference comes from the reference distribution. These values illustrate why an analysis must report its calibration rather than label every robust Wald test simply “a \(z\)-test.”

Common Pitfalls

  • Using the working-model covariance as if it were robust. The inverse sensitivity alone is generally not the sandwich. Use both sensitivity and empirical variability when robust inference is intended.
  • Dropping covariance terms. For a difference, the variance is \(\operatorname{Var}(\hat\beta_2)+\operatorname{Var}(\hat\beta_3)-2\operatorname{Cov}(\hat\beta_2,\hat\beta_3)\), not just the sum of the two variances.
  • Testing several restrictions one at a time and calling it a joint test. Separate tests do not produce the joint Wald statistic and do not use the covariance among contrasts.
  • Calling an asymptotic reference exact. A sandwich covariance estimate does not make a finite-sample normal, \(t\), \(F\), or chi-square distribution exact. State the approximation and degrees-of-freedom rule.
  • Ignoring the independent sampling unit. Treating correlated observations within a cluster as independent can invalidate the variability estimate. Form score contributions at the level of independent units or clusters.
Key takeaway: For a linear restriction \(R\beta=r\), first compute the robust covariance of \(R\hat\beta\) as \(R\widehat V R^\mathsf{T}\), then use the Wald quadratic form. Its standard chi-square calibration is asymptotic; finite-sample degrees of freedom require a stated, defensible choice.

Check Your Understanding

Work through these questions to check your understanding of robust Wald inference for contrasts.

  1. For a scalar contrast \(c^\mathsf{T}\beta\), write its sandwich-based estimated variance.
  2. Why can the covariance between two coefficient estimates affect the variance of their difference?
  3. Under what conditions does a joint Wald statistic have an asymptotic \(\chi^2_q\) reference distribution?
  4. What is the distinction between the asymptotic chi-square calibration and choosing an \(F\) reference with a finite denominator degrees of freedom?
  5. In clustered data, why does the number of records alone not necessarily describe the amount of independent information for robust inference?
Clinical Biostats