Why Small Inferential Errors Matter
In two-sample and multiple-mean analyses, a calculation can look familiar and still answer the wrong question. Pooling covariances when groups differ, using the wrong residual degrees of freedom, or treating a data-selected comparison as if it had been planned can all make uncertainty look smaller than it is. The resulting test statistic may be computed correctly from the wrong ingredients.
Use the following notation. Group \(i\) has \(n_i\) independent \(p\)-dimensional observations, sample mean vector \(\bar X_i\), and unbiased sample covariance matrix \(S_i\). Write \(N=\sum_{i=1}^g n_i\). A planned contrast has fixed scalar weights \(c_1,\ldots,c_g\) and estimates the vector \(\sum_{i=1}^g c_i\bar X_i\). For a contrast among group means, the weights sum to zero.
Error 1: Pooling Covariances Without a Common-Covariance Assumption
When all groups share a covariance matrix, the pooled within-group covariance estimate is
The weights \(n_i-1\) reflect the degrees of freedom contributed by each group. If the covariances differ, this is still a computable weighted average, but it is not a common covariance estimate in the model-based sense. More importantly, it generally does not give the correct covariance for a mean contrast. With independent groups and possibly unequal covariances, that covariance is estimated by \(\sum_i c_i^2 S_i/n_i\). A James-type method or another procedure designed for unequal covariances is needed for inference; the pooled-covariance exact test is not made valid just by substituting the pooled matrix.
Proof. The covariance of the sample mean in group \(i\) is \(\Sigma_i/n_i\). Independence across groups makes every cross-covariance \(\operatorname{Cov}(\bar X_i,\bar X_j)\), \(i\ne j\), equal to zero. Expanding the covariance of the weighted sum therefore gives
Since \(E[S_i]=\Sigma_i\), taking expectations of \(\sum_i c_i^2S_i/n_i\) gives the same matrix. \(\square\)
Worked Example: A Pooled Estimate Can Misstate Contrast Uncertainty
Suppose two independent groups have \(n_1=10\), \(n_2=20\), and observed covariance matrices
For the difference \(\bar X_1-\bar X_2\), the unequal-covariance estimate is
If one instead imposes a common covariance, the pooled estimate is
Under that common-covariance model, the estimated covariance of the difference is \((1/10+1/20)S_p=0.15S_p\), or approximately
This differs materially from the unequal-covariance estimate: its first diagonal entry is larger, while its second is smaller. There is no universal direction in which inappropriate pooling changes uncertainty. The problem is the unsupported assumption, not a guaranteed increase or decrease.
Error 2: Losing or Borrowing Degrees of Freedom
Under a common covariance matrix, group \(i\)'s centered observations contribute \(n_i-1\) within-group degrees of freedom. Adding these contributions gives
Proof of the degrees-of-freedom statement. Within group \(i\), normal sampling gives \((n_i-1)S_i\) a Wishart distribution with scale \(\Sigma\) and \(n_i-1\) degrees of freedom. The groups are independent, so these Wishart matrices are independent. Independent Wishart matrices with the same scale add to a Wishart matrix whose degrees of freedom are the sum of the component degrees of freedom. Hence \(W\) has \( \sum_i(n_i-1)=N-g\) degrees of freedom, and division by \(N-g\) gives the pooled covariance estimate. \(\square\)
The stated \(F\) transformation additionally requires the common-covariance model, a fixed contrast, and the null \(\sum_i c_i\mu_i=0\). It does not license using \(N-g\) degrees of freedom with heterogeneous covariance estimates. For two groups, \(N-g=N-2\); for a one-way analysis with \(g\) groups, it is \(N-g\), not \(N-1\). Nor should the number of coordinates \(p\) be mistaken for the number of groups \(g\): they enter different parts of the reference distribution.
Worked Example: Counting Degrees of Freedom for a Planned Contrast
Consider \(g=3\) independent groups with sizes \(8,10,12\), and a two-dimensional response (\(p=2\)). Then \(N=30\), so the pooled within-group degrees of freedom are
not \(N-1=29\). For the planned weights \(c=(1,-1/2,-1/2)\), the contrast covariance multiplier under a common covariance is
If the observed squared Hotelling distance for the contrast is \(T^2=6\), its exact \(F\) statistic is
with \(2\) and \(26\) degrees of freedom. Using \(29\) in place of \(27\) would change both the scale factor and the denominator degrees of freedom, so it would not be the stated exact test.
Error 3: Calling the Wrong Weights a Contrast
A contrast of group means is a weighted sum whose coefficients satisfy \(\sum_i c_i=0\). This condition makes the estimate insensitive to adding the same vector to every group mean. If the weights do not sum to zero, the weighted sum is not a comparison that vanishes when all group means are equal.
Multiplying all contrast weights by the same nonzero constant changes the contrast's units, but not its Hotelling statistic when its covariance is scaled consistently. The numerator vector is multiplied by that constant and its covariance by the square of the constant, so the quadratic form is unchanged. A common error is to rescale the contrast estimate but retain the old covariance multiplier.
Worked Example: Checking and Rescaling Contrast Weights
Suppose three groups have sample means \(\bar X_1=(4,2)^\mathsf{T}\), \(\bar X_2=(6,3)^\mathsf{T}\), and \(\bar X_3=(5,1)^\mathsf{T}\). The weights \(c=(1/2,1/2,-1)\) sum to zero and compare the average of the first two group means with the third:
With sample sizes \(8,12,10\), the common-covariance multiplier is
If the weights are doubled to \((1,1,-2)\), the estimate becomes \((0,3)^\mathsf{T}\), and the multiplier becomes \(4q=73/120\). Both the estimate and its covariance have been rescaled consistently, so the Hotelling quadratic form is unchanged. By contrast, weights \((1,1,1)\) sum to \(3\), not zero; their weighted sum is not a contrast and does not test equality of the three means.
Error 4: Treating Many Tests as One Test
A significance level applies to a test or to a specified family of tests, depending on the procedure. Testing \(m\) pairwise comparisons each at level \(\alpha\) does not in general control the probability of at least one false rejection at \(\alpha\). Under independence, that probability when all null hypotheses are true is \(1-(1-\alpha)^m\). Pairwise multivariate tests are often dependent, so this expression is not generally their exact familywise error rate; the key point is that separate level-\(\alpha\) tests do not guarantee familywise control.
For example, Bonferroni testing uses level \(\alpha/m\) for each of \(m\) comparisons. By the union bound, the probability of one or more false rejections is then at most \(m(\alpha/m)=\alpha\), without requiring independence. Bonferroni regions, Dunnett-type procedures for comparisons with a common control, and Scheffé inference address different comparison families; choose the procedure to match the claims being made. An omnibus test of equality of means does not, by itself, provide simultaneous error control for every follow-up comparison.
Worked Example: Six Pairwise Tests
Suppose four groups are compared pairwise, giving \(m=4(3)/2=6\) tests. If each is tested at \(\alpha=0.05\), the independence benchmark for at least one false rejection when all six nulls are true is
This is not an exact calculation for dependent Hotelling tests, but it shows why six separate 5% tests should not be described as a 5% family. A Bonferroni allocation instead tests each comparison at \(0.05/6\approx0.00833\). The union bound guarantees familywise error no greater than \(6(0.05/6)=0.05\), regardless of dependence.
Error 5: Selecting a “Planned” Contrast After Seeing the Data
The exact calibration of a planned contrast assumes its weights were fixed independently of the data used for testing. If the analyst examines sample means, chooses the largest-looking difference, and then reports the ordinary planned-contrast \(p\)-value, the selection step has been ignored. The reported test is no longer the single fixed test whose null distribution was used to calculate that \(p\)-value. The same problem arises when only favorable comparisons are reported from a larger set.
The correction is to define the comparison family and selection rule in advance, or to use an inference procedure that accounts for the full family of comparisons. Scheffé inference is designed for inference over all linear contrasts under its assumptions; Bonferroni or a suitable simultaneous procedure can address a defined finite family. A genuinely independent validation sample can also be used for a comparison chosen using separate data, provided the validation analysis is specified appropriately.
A Practical Diagnostic Sequence
Ask whether a common covariance is defensible. If not, do not treat pooled covariance formulas or their exact reference distributions as automatically valid.
Verify that the weights sum to zero for a mean comparison, and calculate its covariance using the same weights and sample sizes.
For pooled within-group covariance, count \(\sum_i(n_i-1)=N-g\). Use the degrees of freedom for the specified exact or approximate procedure.
State which comparisons are included and whether they were chosen before seeing the data. Match error control to that family and selection process.
Check Your Understanding
For each question, identify the assumption or inferential step that needs checking.
- Three groups have unequal sample covariance matrices. What assumption is required to justify using a pooled within-group covariance as a common covariance estimate?
- For \(g\) groups with total sample size \(N\), why does the pooled within-group covariance use \(N-g\), rather than \(N-1\), degrees of freedom?
- Do weights \((2,-1,-1)\) define a contrast? What quantity do weights \((1,1,1)\) define instead?
- Six pairwise tests are each performed at level \(0.05\). What does Bonferroni change, and what guarantee does the union bound provide?
- An analyst chooses the contrast with the largest observed difference and reports its ordinary planned-test \(p\)-value. What step has that calculation failed to account for?