Why Linear Contrasts Need the Full Covariance Matrix
Many scientific questions concern a combination of regression coefficients rather than one coefficient in isolation. A contrast such as the difference between two treatment effects, or the sum of two slope coefficients, is estimated by combining coefficient estimates. Its uncertainty depends not only on the uncertainty of each coefficient but also on how those estimates vary together. The sandwich covariance matrix provides the ingredients for this calculation when quasi-estimating equations are used.
The focus here is inference for one prespecified linear contrast. The resulting confidence interval is an asymptotic, large-sample procedure. It is not automatically an exact finite-sample interval, and it does not require a likelihood for the response distribution.
Write \(\widehat C\) for an estimated covariance matrix of \(\hat{\beta}\), using the sandwich covariance or an appropriate dispersion-scaled covariance. The estimated variance and standard error of the contrast are
The off-diagonal entries of \(\widehat C\) matter whenever the contrast combines more than one coefficient. In particular, a difference can be more or less precise depending on whether the two coefficient estimates tend to move together.
Deriving the Contrast Variance and Interval
Suppose a quasi-estimator satisfies the asymptotic normality result \(\sqrt{n}(\hat{\beta}-\beta)\xrightarrow{d}N(0,V)\), where \(V\) is a finite, positive semidefinite \(p\times p\) matrix. For a fixed vector \(c\), the corresponding contrast has asymptotic variance \(c^\mathsf{T}Vc/n\). In practice, an estimated covariance \(\widehat C\) estimates this covariance for \(\hat{\beta}\) itself.
Proof. The map \(x\mapsto c^\mathsf{T}x\) is linear and continuous. The continuous mapping theorem therefore gives \(\sqrt{n}c^\mathsf{T}(\hat{\beta}-\beta)\xrightarrow{d}N(0,c^\mathsf{T}Vc)\). Since \(c^\mathsf{T}Vc>0\), dividing by \(\sqrt{c^\mathsf{T}Vc}\) gives a standard normal limit. Consistency of \(\widehat C\) for \(V/n\) implies \(n c^\mathsf{T}\widehat Cc\xrightarrow{p}c^\mathsf{T}Vc\), so the estimated standard deviation divided by \(\sqrt{c^\mathsf{T}Vc/n}\) converges in probability to one. Slutsky’s theorem gives the stated studentized limit. \(\square\)
Let \(z_{1-\alpha/2}\) denote the \(1-\alpha/2\) quantile of the standard normal distribution. A two-sided, approximate \(100(1-\alpha)\%\) confidence interval is
This interval has asymptotic coverage \(1-\alpha\) under the theorem’s conditions. The conclusion follows because the standardized statistic converges to a continuous standard normal distribution, whose probability between \(-z_{1-\alpha/2}\) and \(z_{1-\alpha/2}\) is \(1-\alpha\). It is an asymptotic result: the sandwich estimate’s consistency and the normal approximation do not guarantee exact coverage at a particular finite sample size.
Worked Example: A Contrast With Correlated Coefficient Estimates
Suppose \(\hat{\beta}=(0.4,-0.2)^\mathsf{T}\), and the estimated sandwich covariance matrix is \(\widehat C=\begin{pmatrix}1/2&1/12\\1/12&2/9\end{pmatrix}\). Find the estimate, standard error, and 95% asymptotic confidence interval for the contrast \(c^\mathsf{T}\beta=\beta_1+2\beta_2\).
Here \(c=(1,2)^\mathsf{T}\). The estimated contrast is \(c^\mathsf{T}\hat{\beta}=0.4+2(-0.2)=0\). Its estimated variance, retaining the exact covariance entries, is \[ c^\mathsf{T}\widehat Cc =\frac12+4\left(\frac{2}{9}\right)+4\left(\frac{1}{12}\right) =\frac12+\frac89+\frac13 =\frac{31}{18} \approx 1.7222. \] Thus the standard error is \(\sqrt{31/18}\approx1.3123\). Using \(z_{0.975}\approx1.96\), the interval is \[ 0\pm1.96(1.3123)\approx 0\pm2.572, \] or approximately \((-2.572,2.572)\). The positive covariance contributes to the variance because the contrast adds a positive multiple of the second coefficient to the first.
Where Dispersion Enters
In quasi-likelihood settings, dispersion describes the scale of the response variance relative to the specified mean–variance relationship. Under a correctly specified variance function with scalar dispersion \(\phi\), the usual quasi-score covariance has the form \(\phi M^{-1}\), where \(M\) is the information-like matrix formed from the mean-model derivatives and working weights. If \(\phi\) is estimated, the plug-in covariance uses \(\hat{\phi}M^{-1}\), and the contrast variance is \( \hat{\phi}c^\mathsf{T}M^{-1}c\).
A robust sandwich covariance is instead built from an estimated sensitivity (“bread”) and variability of the estimating contributions (“meat”). When the meat is computed from residual contributions, the scale of their variability is already represented in that matrix. One should not multiply such an already dispersion-inclusive sandwich covariance by \(\hat{\phi}\) again. Always identify how the covariance estimate was constructed before applying a dispersion factor.
Worked Example: Applying an Estimated Dispersion Factor
Suppose a quasi-score analysis reports \(M^{-1}=\begin{pmatrix}0.4&0.1\\0.1&0.2\end{pmatrix}\) and estimates dispersion by \(\hat{\phi}=1.5\). Let \(\hat{\beta}=(0.8,0.3)^\mathsf{T}\). Find a 95% interval for \(\beta_1-\beta_2\) using the dispersion-scaled covariance.
The contrast vector is \(c=(1,-1)^\mathsf{T}\), and the estimate is \(c^\mathsf{T}\hat{\beta}=0.8-0.3=0.5\). Before scaling, its variance is \[ c^\mathsf{T}M^{-1}c=0.4+0.2-2(0.1)=0.4. \] The dispersion-scaled variance is \(1.5(0.4)=0.6\), giving standard error \(\sqrt{0.6}\approx0.7746\). The 95% interval is \[ 0.5\pm1.96(0.7746)\approx0.5\pm1.5182, \] or approximately \((-1.018,2.018)\). The factor \(1.5\) is used once because the starting covariance \(M^{-1}\) did not yet include dispersion.
Estimating \(\phi\) rather than knowing it does not ordinarily change the first-order large-sample interval argument when \(\hat{\phi}\xrightarrow{p}\phi\): replacing \(\phi\) by a consistent estimate changes the standard error by a factor converging in probability to one. This is a plug-in, asymptotic justification; it does not make a normal interval an exact small-sample procedure.
Worked Example: Contrasting Robust and Dispersion-Scaled Covariance
Suppose the reported robust sandwich covariance for \(\hat{\beta}\) is \(\widehat C=\begin{pmatrix}1&1/6\\1/6&1\end{pmatrix}\), and \(\hat{\beta}=(0.7,0.2)^\mathsf{T}\). Find a 95% interval for \(\beta_1-\beta_2\).
For \(c=(1,-1)^\mathsf{T}\), the contrast estimate is \(0.7-0.2=0.5\). Its estimated variance is \[ c^\mathsf{T}\widehat Cc=1+1-2\left(\frac16\right)=\frac53\approx1.6667, \] so its standard error is \(\sqrt{5/3}\approx1.2910\). The interval is \[ 0.5\pm1.96(1.2910)\approx0.5\pm2.5304, \] or approximately \((-2.030,3.030)\). Since \(\widehat C\) is specified as the robust covariance estimate itself, no additional dispersion multiplier is applied.
Why the Off-Diagonal Terms Matter
For a two-coefficient contrast \(c^\mathsf{T}\beta=a\beta_1+b\beta_2\), its variance is \[ a^2\operatorname{Var}(\hat{\beta}_1) +b^2\operatorname{Var}(\hat{\beta}_2) +2ab\operatorname{Cov}(\hat{\beta}_1,\hat{\beta}_2). \] The covariance term can increase or decrease the uncertainty, depending on the signs of \(a\), \(b\), and the covariance. Treating the coefficient estimates as independent without justification drops this term and generally gives the wrong standard error.
For a single contrast, the essential inferential steps are to state the coefficient vector \(c\), compute the estimate \(c^\mathsf{T}\hat{\beta}\), identify the correct covariance estimate, and evaluate its quadratic form. The substantive interpretation then belongs to the original parameterization: for example, a contrast may represent an adjusted difference between groups or a change in a specified linear predictor. The interval quantifies uncertainty about that particular scalar quantity, not about all coefficients simultaneously.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- For a contrast \(2\beta_1-\beta_2\), what vector \(c\) should be used in the variance calculation?
- Why can the off-diagonal covariance terms change the standard error of a difference?
- If a covariance matrix is already a residual-based robust sandwich estimate that includes response variability, should it be multiplied by an additional dispersion estimate? Explain.
- Suppose \(c^\mathsf{T}\widehat Cc=0.25\) and the estimated contrast is \(1.2\). Give the standard error and the form of its approximate 95% confidence interval.
- Why does consistency of an estimated dispersion factor support a plug-in asymptotic interval, but not establish exact finite-sample coverage?