Tutorials › Multi-Arm Multi-Stage (MAMS) Designs › Estimating Contrast Covariance From a Common Variance

Shared-Control Correlation · Tutorial 95 of 499

Estimating Contrast Covariance From a Common Variance

Estimate the shared-control contrast covariance matrix from pooled within-group variation, and check when this common-variance plug-in is justified.

Advanced 12 min read

What You'll Learn

  • Define the common-variance model for treatment and shared-control group means.
  • Calculate the pooled within-group variance from group summaries and its degrees of freedom.
  • Estimate the covariance matrix for treatment-versus-control contrasts by plug-in.
  • Extend the estimate to general linear contrasts using a contrast matrix.
  • Check assumptions and recognize common pooling and interpretation errors.
  • Compare the plug-in estimator with known-variance and unequal-variance approaches.

Why Estimate a Shared-Control Covariance Matrix?

When several treatment groups are compared with the same control group, each treatment-control difference contains the control sample mean. Consequently, the estimated differences are generally dependent. Their theoretical covariance matrix depends on the common outcome variance, which is usually unknown. This tutorial shows how to estimate that matrix by estimating the common variance from within-group variation and substituting the estimate into the covariance formulas.

The target here is the covariance matrix of the estimated contrasts, not the covariance of individual patient outcomes and not an uncertainty interval for an estimated correlation. The plug-in calculation is useful when a common-variance model is appropriate: it gives a single matrix that reflects both the estimated variability and the allocation of participants across groups.

Model and notation: Let group \(0\) be the shared control and groups \(1,\ldots,K\) be treatment groups. In group \(j\), let \(Y_{ij}\) denote the outcome for participant \(i\), let \(n_j\) be the sample size, and let \(\bar{Y}_j\) and \(s_j^2\) be the sample mean and sample variance. Assume the observations are independent across participants and groups, and that \(Y_{ij}\sim N(\mu_j,\sigma^2)\) for all \(j=0,\ldots,K\). Thus groups may have different means, but share the same variance \(\sigma^2\). Define the treatment-control contrast \(D_j=\bar{Y}_j-\bar{Y}_0\).

The Pooled Variance and the Plug-In Estimate

The common variance is estimated by pooling the within-group sums of squares. The group means do not enter this calculation: they describe between-group differences, whereas the pooled estimate uses variation around each group’s own mean. Write \(N=\sum_{j=0}^K n_j\) for the total sample size.

$$ s_p^2 = \frac{\displaystyle\sum_{j=0}^K (n_j-1)s_j^2} {\displaystyle\sum_{j=0}^K(n_j-1)} = \frac{\displaystyle\sum_{j=0}^K\sum_{i=1}^{n_j}(Y_{ij}-\bar{Y}_j)^2} {N-(K+1)}. $$

The denominator \(N-(K+1)\) is the residual degrees of freedom: there are \(K+1\) groups, and each group mean is estimated from its own data. Under the stated normal, independent, common-variance model, \(s_p^2\) is unbiased for \(\sigma^2\). Substituting \(s_p^2\) for \(\sigma^2\) in the covariance formulas produces the estimated contrast covariance matrix.

Definition: For the vector \(D=(D_1,\ldots,D_K)^\mathsf{T}\) of treatment-control contrasts, the plug-in covariance estimator has diagonal entries \(s_p^2(1/n_j+1/n_0)\) and off-diagonal entries \(s_p^2/n_0\). The positive off-diagonal terms arise because every contrast includes the same control mean with coefficient \(-1\).

The full matrix can be written compactly. Let \(C\) be the \(K\)-by-\((K+1)\) matrix whose row \(j\) has coefficient \(1\) for treatment group \(j\), coefficient \(-1\) for control group \(0\), and zero elsewhere. Let \(M=(\bar{Y}_0,\bar{Y}_1,\ldots,\bar{Y}_K)^\mathsf{T}\), and let \(V_n=\operatorname{diag}(1/n_0,\ldots,1/n_K)\). Then \(D=CM\). The estimate is:

$$ \widehat{\operatorname{Cov}}(D) = s_p^2 C V_n C^\mathsf{T}. $$

This matrix form also applies when the target contrasts are not all treatment versus control. If the rows of a matrix \(A\) define the desired linear contrasts of the group means, the corresponding plug-in estimate is \(s_p^2 A V_n A^\mathsf{T}\). Each row of \(A\) specifies which group means are added or subtracted and with what coefficients.

Why the Substitution Works

Independence across groups implies that the covariance matrix of \(M\) is diagonal: the variance of \(\bar{Y}_j\) is \(\sigma^2/n_j\), and different group means have covariance zero. For any fixed contrast matrix \(A\), the covariance of \(AM\) is therefore obtained by multiplying this diagonal matrix on the left by \(A\) and on the right by \(A^\mathsf{T}\).

$$ \operatorname{Cov}(AM) = A\operatorname{Cov}(M)A^\mathsf{T} = \sigma^2 A V_n A^\mathsf{T}. $$

Under independent normal observations with a common variance, the within-group residual sum of squares in group \(j\), divided by \(\sigma^2\), has a chi-square distribution with \(n_j-1\) degrees of freedom. These residual sums of squares are independent across groups. Their sum, divided by \(\sigma^2\), therefore has a chi-square distribution with \(\sum_j(n_j-1)=N-(K+1)\) degrees of freedom. Its expectation is that degrees of freedom, so \(E(s_p^2)=\sigma^2\). Consequently, replacing \(\sigma^2\) by \(s_p^2\) gives an unbiased estimate of each covariance entry:

$$ E\!\left[s_p^2 A V_n A^\mathsf{T}\right] = \sigma^2 A V_n A^\mathsf{T} = \operatorname{Cov}(AM). $$

This justification depends on the common-variance model. It establishes unbiasedness of the covariance estimator under that model; it does not mean that every element of the estimated matrix is known without sampling error.

Worked Example: Three Treatment-Control Contrasts

Suppose a hypothetical study has one control group and three treatment groups. The sample sizes are \(n_0=20\), \(n_1=18\), \(n_2=16\), and \(n_3=14\). Suppose the within-group sums of squares are 190, 170, 150, and 130 outcome-units squared, respectively. Calculate the pooled variance estimate and the estimated covariance matrix of the three treatment-control differences.

The total within-group sum of squares is \(190+170+150+130=640\). The residual degrees of freedom are \((20-1)+(18-1)+(16-1)+(14-1)=64\), so:

$$ s_p^2=\frac{640}{64}=10.0 \quad\text{outcome-units}^2. $$

For treatment group 1, the estimated variance of \(\bar{Y}_1-\bar{Y}_0\) is \(10(1/18+1/20)=10(0.105556)=1.056\) outcome-units squared. The corresponding diagonal entries for groups 2 and 3 are \(10(1/16+1/20)=1.125\) and \(10(1/14+1/20)=1.214\). Each off-diagonal entry is \(10(1/20)=0.500\). Thus:

$$ \widehat{\operatorname{Cov}}(D) = \begin{pmatrix} 1.056 & 0.500 & 0.500\\ 0.500 & 1.125 & 0.500\\ 0.500 & 0.500 & 1.214 \end{pmatrix} \quad\text{outcome-units}^2. $$

The common positive off-diagonal entries reflect the shared control mean. The diagonal entries differ because the treatment sample sizes differ. The matrix estimates covariance among the three unstandardized differences; its entries are not correlations.

Using Group Summaries and General Contrasts

Often the available report gives each group’s sample size and sample variance rather than the individual outcomes. The weighted pooling formula uses each group variance multiplied by its within-group degrees of freedom, not a simple average of the group variances.

Worked Example: Pooling Reported Group Variances

In a hypothetical four-group comparison, suppose the control has \(n_0=10\) and \(s_0^2=4\), while the three treatment groups have \((n_1,s_1^2)=(12,9)\), \((n_2,s_2^2)=(8,6)\), and \((n_3,s_3^2)=(10,5)\). Treat the squared outcome units consistently across groups. First calculate the pooled estimate:

$$ s_p^2 = \frac{9(4)+11(9)+7(6)+9(5)}{9+11+7+9} = \frac{222}{36} = 6.167. $$

With \(n_0=10\), the shared off-diagonal entry is \(6.167/10=0.6167\). The diagonal entries are \(6.167(1/12+1/10)=1.131\), \(6.167(1/8+1/10)=1.388\), and \(6.167(1/10+1/10)=1.233\). Therefore:

$$ \widehat{\operatorname{Cov}}(D) = \begin{pmatrix} 1.131 & 0.6167 & 0.6167\\ 0.6167 & 1.388 & 0.6167\\ 0.6167 & 0.6167 & 1.233 \end{pmatrix} \quad\text{outcome-units}^2. $$

The group variances in this hypothetical summary are not identical. The pooled calculation is still mechanically defined, but its interpretation as an estimate of a single common variance relies on the common-variance assumption; the calculation alone cannot validate that assumption.

For other contrasts, use their coefficients directly rather than trying to adjust the treatment-control formula by inspection. For example, let \(D_1=\bar{Y}_1-\bar{Y}_0\), \(D_2=\bar{Y}_2-\bar{Y}_0\), and \(D_3=\bar{Y}_3-\bar{Y}_0\). The contrast \(\bar{Y}_1-\bar{Y}_2\) equals \(D_1-D_2\); its control component cancels. A matrix multiplication automatically handles that cancellation and preserves the correct covariance with any other contrast.

Worked Example: Estimating Covariance for a Re-expressed Contrast

Suppose a hypothetical study has \(n_0=12\), \(n_1=10\), \(n_2=15\), and \(n_3=9\), and its pooled within-group variance estimate is \(s_p^2=2.00\) outcome-units squared. Let \(Q=D_1-D_2=\bar{Y}_1-\bar{Y}_2\), and consider its covariance with \(D_3\).

The treatment-control covariance entries needed are \(\widehat{\operatorname{Var}}(D_1)=2(1/10+1/12)=0.3667\), \(\widehat{\operatorname{Var}}(D_2)=2(1/15+1/12)=0.3000\), and \(\widehat{\operatorname{Cov}}(D_1,D_2)=2/12=0.1667\). Therefore:

$$ \widehat{\operatorname{Var}}(Q) = 0.3667+0.3000-2(0.1667) = 0.3333 \quad\text{outcome-units}^2. $$

Both \(\widehat{\operatorname{Cov}}(D_1,D_3)\) and \(\widehat{\operatorname{Cov}}(D_2,D_3)\) equal \(2/12=0.1667\). Hence:

$$ \widehat{\operatorname{Cov}}(Q,D_3) = \widehat{\operatorname{Cov}}(D_1,D_3) - \widehat{\operatorname{Cov}}(D_2,D_3) = 0.1667-0.1667=0. $$

The zero covariance follows from cancellation of the common control component in \(Q\). It is a covariance result under the specified independent-group, common-variance model; it is not a claim that all possible outcomes or analyses are independent.

Assumptions, Diagnostics, and Alternatives

Before using the plug-in matrix, check that its model matches the design and outcome. Independent observations are needed for the group-mean covariance calculation. The pooled variance also assumes a common within-group variance. Normality is needed for the exact chi-square justification for \(s_p^2\); substantial skewness or influential outliers can make the pooled estimate and normal-model inference unreliable, especially in small groups.

Useful checks include examining residuals within each group, comparing group spreads, and identifying outliers or data errors. Notice that sample variances will not be identical even when population variances are equal. Diagnostics are evidence about the plausibility of the assumption, not a proof that it holds. If group variances are markedly different, a common pooled estimate can give a poor representation of the covariance structure.

ApproachVariance inputWhen it is appropriate
Common-variance plug-inOne pooled within-group estimate \(s_p^2\)When a common within-group variance is a reasonable model.
Known-variance formulaThe specified value \(\sigma^2\)When the common variance is genuinely known; otherwise it is a theoretical formula, not an estimated matrix.
Group-specific variance formulaSeparate estimates \(s_j^2\)When unequal variances are allowed and the analysis is constructed to use them rather than imposing a common variance.

These choices are not interchangeable. The shared-control structure determines which group means appear together in each contrast, while the variance model determines how the uncertainty of those means is estimated. Changing the variance model does not remove the shared-control contribution; it changes the appropriate covariance calculation. A simple pooled plug-in matrix is limited when the common-variance assumption is implausible, when observations are dependent in a way the model omits, or when the data do not support stable within-group variance estimates.

Common Pitfalls

  • Using the wrong denominator. Dividing the total within-group sum of squares by \(N\) or \(N-1\) ignores the group means estimated from the data. Use \(N-(K+1)\).
  • Averaging variances without weights. Group variances have different degrees of freedom when sample sizes differ. Pool \((n_j-1)s_j^2\) and divide by the sum of the degrees of freedom.
  • Putting zero in the off-diagonal entries. Treatment-control contrasts share the control mean, so their covariance is generally nonzero under this model.
  • Calling the estimate a correlation matrix. The entries have squared outcome units. Correlations require division by the relevant standard deviations.
  • Treating pooled variance as assumption-free. The formula can be calculated even when variances differ, but its common-variance interpretation then lacks its model justification.
Key takeaway: Estimate the common variance by pooling within-group sums of squares with \(N-(K+1)\) residual degrees of freedom, then substitute that estimate into the covariance formula for the specified contrasts. The resulting matrix reflects both the shared-control design and the assumed common within-group variance.

Check Your Understanding

Answer each question, then compare with the solutions below.

  1. There are one control and two treatment groups, with sample sizes 12, 10, and 8. What are the residual degrees of freedom for the pooled variance estimate?
  2. For treatment-control contrasts with \(n_0=20\) and \(s_p^2=4\), calculate the estimated covariance between the two contrasts.
  3. Suppose four groups have within-group sums of squares totaling 300 and total sample size 50. Calculate \(s_p^2\) and state the degrees of freedom.
  4. Why is the pooled estimate not generally the arithmetic mean of the group sample variances?
  5. What model feature explains the shared off-diagonal covariance of treatment-control contrasts?

Solutions. (1) There are three groups, so \(df=(12-1)+(10-1)+(8-1)=27\). (2) The estimated covariance is \(s_p^2/n_0=4/20=0.200\) outcome-units squared. (3) The residual degrees of freedom are \(50-4=46\), giving \(s_p^2=300/46=6.522\) squared outcome-units. (4) Each group variance has weight \(n_j-1\), so groups with different sample sizes contribute different amounts of within-group information; the pooled estimate is a degrees-of-freedom-weighted average. (5) The contrasts share the same estimated control mean, with coefficient \(-1\) in each, producing covariance \(\sigma^2/n_0\), estimated by \(s_p^2/n_0\).

Clinical Biostats