Tutorials › VEE Mathematical Statistics › Estimating Contrasts With Pooled Error

VEE Mathematical Statistics · ANOVA Contrasts and Comparisons · Tutorial 813 of 880

Estimating Contrasts With Pooled Error

Estimate a contrast from group sample means and quantify its uncertainty using pooled within-group variation and residual degrees of freedom.

Advanced 10 min read

What You'll Learn

  • Define a linear contrast and its sample estimate.
  • Calculate the contrast’s standard error for equal or unequal group sizes.
  • Obtain the pooled within-group mean square from group summaries.
  • Explain why the variance formula uses squared contrast coefficients divided by sample sizes.
  • Check model assumptions and avoid treating unequal group sizes as equal.

Why Pooled Error Is Used for a Contrast

A one-way analysis of variance compares several population means while using the within-group variation to estimate a common variance. Once a comparison has been expressed as a linear contrast, the group sample means provide its estimate, and the pooled within-group mean square provides the estimated error variance needed to measure the estimate’s standard error. Both parts matter: the coefficients determine which means are compared, while the sample sizes determine how precisely each mean is estimated.

The calculation is aligned with the SOA VEE Mathematical Statistics syllabus. It uses the one-way ANOVA model and the definition of a contrast; it does not require a balanced design. The key is to retain each group’s own sample size in the standard-error calculation.

Definition: For \(k\) groups with population means \(\mu_1,\ldots,\mu_k\), a linear contrast is \(\psi=\sum_{i=1}^k c_i\mu_i\), where the fixed coefficients satisfy \(\sum_{i=1}^k c_i=0\). Its sample estimate is \(\hat{\psi}=\sum_{i=1}^k c_i\bar{Y}_i\), where \(\bar{Y}_i\) is the sample mean in group \(i\).

For example, the coefficients \(1,-1/2,-1/2\) define the difference between the first group mean and the average of the second and third group means. A coefficient of zero means that group does not enter the particular contrast. Multiplying all the coefficients by a constant also multiplies the contrast estimate and its standard error by the constant’s absolute value.

The Pooled-Error Standard Error

Suppose independent observations in group \(i\) follow \(Y_{ij}\sim N(\mu_i,\sigma^2)\), for \(i=1,\ldots,k\) and \(j=1,\ldots,n_i\). The group means \(\mu_i\) may differ, but the model assumes a common variance \(\sigma^2\). Let \(N=\sum_i n_i\), and let \(s_i^2\) be the usual sample variance within group \(i\). The pooled within-group mean square is

$$ \operatorname{MSE} =\frac{\sum_{i=1}^k(n_i-1)s_i^2}{N-k}. $$

The denominator \(N-k\) is the residual degrees of freedom: each group’s mean is estimated from that group’s observations, leaving \(n_i-1\) within-group degrees of freedom. The pooled mean square combines the within-group sums of squares under the common-variance assumption. In this model, it estimates \(\sigma^2\).

Theorem: Under independent sampling with a common within-group variance \(\sigma^2\), the contrast estimate has variance \(\operatorname{Var}(\hat{\psi})=\sigma^2\sum_{i=1}^k c_i^2/n_i\). Replacing \(\sigma^2\) by the pooled estimate \(\operatorname{MSE}\) gives the estimated standard error $$ \widehat{\operatorname{SE}}(\hat{\psi}) =\sqrt{\operatorname{MSE}\sum_{i=1}^k\frac{c_i^2}{n_i}}. $$

The formula applies to unequal as well as equal group sizes, provided the common-variance model is appropriate. In this tutorial, “standard error” refers to the estimated standard deviation of \(\hat{\psi}\); the formula by itself is not a confidence interval or a hypothesis test.

Why the Formula Has This Form

The result follows from the variance of a weighted sum of independent sample means. In group \(i\), the sample mean averages \(n_i\) independent observations, each with variance \(\sigma^2\), so its variance is \(\sigma^2/n_i\). Independence across groups means there are no covariance terms when finding the variance of the weighted sum.

1
Start with the contrast estimate.
\(\hat{\psi}=\sum_i c_i\bar{Y}_i\), where each coefficient is fixed.
2
Use independence of group means.
\(\operatorname{Var}(\hat{\psi})=\sum_i c_i^2\operatorname{Var}(\bar{Y}_i)\), because the covariance between distinct group means is zero.
3
Substitute each group-mean variance.
\(\operatorname{Var}(\hat{\psi})=\sum_i c_i^2(\sigma^2/n_i)=\sigma^2\sum_i c_i^2/n_i\).
4
Estimate the unknown variance.
Replacing \(\sigma^2\) by \(\operatorname{MSE}\) and taking a square root gives the estimated standard error.

The squared coefficients appear because variance scales by the square of a multiplier. The sample sizes appear in the denominators because a mean based on more independent observations has smaller variance. The contrast condition \(\sum_i c_i=0\) makes the linear combination a comparison of group means; it is not needed for the variance algebra itself.

Worked Calculations

Worked Example: A Group Versus the Average of Two Groups

A hypothetical study compares three independent treatment groups on a quantitative response. The group sample means are \(18,14,10\), with sample sizes \(5,8,10\), respectively. The within-group sum of squares is \(240\). Estimate the contrast comparing group 1 with the average of groups 2 and 3, and calculate its pooled-error standard error.

Model and assumptions. Use independent observations \(Y_{ij}\sim N(\mu_i,\sigma^2)\), with a common but unknown variance. The contrast coefficients are \(c_1=1,c_2=-1/2,c_3=-1/2\), which sum to zero. Interest and mortality assumptions do not apply to this statistical study.

Method: estimate the contrast from the sample means. Its estimate is \(\hat{\psi}=18-(1/2)(14)-(1/2)(10)=18-7-5=6\).

The total sample size is \(N=5+8+10=23\), and the number of groups is \(k=3\), so the residual degrees of freedom are \(23-3=20\). Thus \(\operatorname{MSE}=240/20=12\).

Calculate the size factor. \((1^2/5)+[(-1/2)^2/8]+[(-1/2)^2/10]=1/5+1/32+1/40\). With denominator \(160\), this is \(32/160+5/160+4/160=41/160=0.25625\).

Therefore, \(\widehat{\operatorname{SE}}(\hat{\psi})=\sqrt{12(0.25625)}=\sqrt{3.075}\approx1.7536\). Rounded to four decimal places, the estimate is \(6\) and its standard error is \(1.7536\). As a check, the contrast estimate is \(18\) minus the average \((14+10)/2=12\), which is \(6\). The common mistake to avoid is treating the three group sizes as equal when calculating the size factor.

Worked Example: A Planned Average Versus a Reference Group

In a hypothetical study of a laboratory measurement, a reference group and three intervention groups have sample means \(20,24,27,25\), in that order. Their sample sizes are \(6,9,12,9\). The four within-group sums of squares are \(80,128,144,160\). Estimate the average intervention mean minus the reference mean and find its standard error.

Model and assumptions. Assume independent group observations \(Y_{ij}\sim N(\mu_i,\sigma^2)\) with the same unknown variance in all four groups. Use \(c=(-1,1/3,1/3,1/3)\), a contrast because \(-1+1/3+1/3+1/3=0\). No interest rate or mortality assumption applies.

Method: form the specified weighted difference. \(\hat{\psi}=-(20)+(1/3)(24)+(1/3)(27)+(1/3)(25)=-20+8+9+25/3=16/3\approx5.3333\). The estimate is also the intervention average \((24+27+25)/3=76/3\), less the reference mean \(20\), giving \(76/3-60/3=16/3\).

The total sample size is \(N=6+9+12+9=36\), and \(k=4\), so the residual degrees of freedom are \(36-4=32\). The pooled within-group sum of squares is \(80+128+144+160=512\), giving \(\operatorname{MSE}=512/32=16\).

The size factor is \(1/6+(1/9)^2/9+(1/9)^2/12+(1/9)^2/9\). Equivalently, it is \(1/6+(1/9)(1/9+1/12+1/9)=1/6+11/324=65/324\).

The estimated standard error is \(\sqrt{16(65/324)}=\sqrt{260/81}=\sqrt{260}/9\approx1.7916\), rounded to four decimal places. The estimate and standard error are both positive; the estimate’s sign agrees with the intervention average being greater than the reference mean. The common mistake is to use one intervention sample size for the whole intervention average: each of its three coefficients must be paired with its own group sample size.

Worked Example: A Two-Group Difference With Unequal Sizes

A hypothetical comparison has sample means \(32\) and \(27\), sample sizes \(4\) and \(16\), and within-group sample variances \(9\) and \(9\). Estimate the first population mean minus the second and calculate the standard error.

Model and assumptions. Assume independent observations from \(Y_{1j}\sim N(\mu_1,\sigma^2)\) and \(Y_{2j}\sim N(\mu_2,\sigma^2)\), with a common unknown variance. The contrast coefficients are \(1,-1\). Interest and mortality assumptions are not relevant.

Method: pool the within-group sums of squares. The first group contributes \((4-1)9=27\); the second contributes \((16-1)9=135\). Thus the pooled sum of squares is \(27+135=162\). Here \(N=20\), \(k=2\), and the residual degrees of freedom are \(20-2=18\), so \(\operatorname{MSE}=162/18=9\).

The contrast estimate is \(32-27=5\). Its size factor is \(1^2/4+(-1)^2/16=1/4+1/16=5/16=0.3125\). Therefore, its standard error is \(\sqrt{9(5/16)}=\sqrt{45/16}=\sqrt{45}/4\approx1.6771\), rounded to four decimal places.

Common mistake and correction. Treating both groups as if they had size \(4\) gives the incorrect factor \(1/4+1/4\), and hence the incorrect standard error \(\sqrt{9(1/2)}\approx2.1213\). The actual second sample size is \(16\), so its contribution is \(1/16\), not \(1/4\). The corrected standard error is \(1.6771\). As a check, the unequal-size formula gives the larger group a smaller contribution to the variance, as expected.

Assumptions and Interpretation

The calculation relies on independent observations and a common within-group variance. The normal model is the standard setting for exact finite-sample ANOVA results; the variance formula itself follows from independence and the group variances. Diagnostics and the consequences of unequal variances belong to the broader ANOVA model assessment. If group variances differ substantially, pooling them as if they all estimate one common \(\sigma^2\) may not be appropriate, and this standard error should not be used without considering a suitable alternative.

A standard error describes sampling variability: across repeated studies under the model, the contrast estimate would vary around its population contrast. It does not measure bias in the study design, and it does not say whether the contrast is practically important. A small standard error indicates greater precision for this particular weighted comparison, not necessarily for every group mean.

A reliable calculation follows a fixed sequence: write the contrast coefficients, compute the estimate, obtain the pooled MSE with residual degrees of freedom, and then calculate \(\sum_i c_i^2/n_i\) using each group’s own size. Only after checking those components should the square root be taken. This keeps the comparison’s definition separate from the evidence about its precision.

Key takeaway: For a contrast estimate \(\hat{\psi}=\sum_i c_i\bar{Y}_i\), the pooled-error standard error is \(\sqrt{\operatorname{MSE}\sum_i c_i^2/n_i}\). Use the residual mean square from within-group variation and preserve the match between each coefficient and its group sample size.

Check Your Understanding

For each problem, use the common-variance one-way ANOVA model unless the question asks you to identify an assumption. Report standard errors to four decimal places where needed.

  1. Three independent groups have sample means \(11,8,7\), sample sizes \(4,8,8\), and \(\operatorname{MSE}=4\). For the contrast \(c=(1,-1/2,-1/2)\), find the contrast estimate and its standard error. (Answer: \(\hat{\psi}=3.5,\ \widehat{\operatorname{SE}}=1.1180\))
  2. Two independent groups have sample means \(41\) and \(35\), sample sizes \(5\) and \(20\), and \(\operatorname{MSE}=25\). Find the first mean minus the second and its standard error. (Answer: \(\hat{\psi}=6,\ \widehat{\operatorname{SE}}=2.5000\))
  3. Four groups have sample means \(15,17,12,14\) and sizes \(6,10,5,8\). For \(c=(1/2,1/2,-1,0)\), with \(\operatorname{MSE}=9\), calculate the contrast estimate and standard error. (Answer: \(\hat{\psi}=4,\ \widehat{\operatorname{SE}}=1.5492\))
  4. Three groups have sample means \(10,12,15\), sizes \(5,7,8\), and sample variances \(4,9,4\), respectively. For \(c=(1,-1/2,-1/2)\), calculate the pooled MSE using the residual degrees of freedom, then find the contrast estimate and standard error. (Answer: \(\operatorname{MSE}=98/17,\ \hat{\psi}=-3.5,\ \widehat{\operatorname{SE}}\approx1.2405\))
  5. Three groups of equal size \(6\) have means \(9,5,4\), and \(\operatorname{MSE}=3\). For \(c=(2,-1,-1)\), calculate the contrast estimate and standard error. (Answer: \(\hat{\psi}=9,\ \widehat{\operatorname{SE}}=1.7321\))
Clinical Biostats