Why a Several-Group Test Needs an Approximation
When independent groups have different covariance matrices, the pooled-covariance Hotelling test does not match the sampling structure: there is no single covariance matrix shared by the groups. A natural alternative is to compare the estimated mean contrasts using their estimated covariance. The resulting quadratic form is a Wald statistic, but its reference distribution is not generally an exact F distribution because the covariance estimate combines contributions from several group-specific sample covariance matrices.
A James-type test addresses this calibration problem by approximating the covariance estimate with a scaled Wishart matrix. Moment matching supplies an effective degrees of freedom, and the resulting Wald statistic is compared with an F distribution. This is an approximation, not an exact finite-sample calibration.
Contrasts and the James-Type Statistic
Stack the group means into \(\bar X=(\bar X_1',\ldots,\bar X_k')'\). Choose a \(q\times kp\) contrast matrix \(C=(C_1,\ldots,C_k)\) of full row rank, where each \(C_i\) has \(p\) columns. For the equality hypothesis, take \(q=p(k-1)\) and choose \(C\) so that \(C\mu=0\) holds exactly when all group means are equal. For example, contrasts of each of the first \(k-1\) means with the last group give such a matrix. The contrast estimate is \(Y=C\bar X=\sum_i C_i\bar X_i\).
Under the null, \(E[Y]=0\). Independence between groups gives the covariance of \(Y\) as a sum of group contributions. Estimate each contribution using that group's own sample covariance:
Here \(Q\) is the estimated-covariance Wald quadratic form. It has \(q\) contrast dimensions. To calibrate it, define \(A_i=\widehat\Omega^{-1/2}B_i\widehat\Omega^{-1/2}\), where the inverse square root exists when \(\widehat\Omega\) is positive definite. The moment-matched degrees of freedom are
Equivalently, the traces can be computed without explicitly forming the inverse square root by using \(\widehat\Omega^{-1}B_i\) in their place. The James-type statistic and its reference distribution are
The denominator degrees of freedom must be positive, so the calculation requires \(\widehat\nu>q-1\). In practice, the contrast covariance estimate must also be nonsingular. A small sample or nearly singular covariance estimate can make the approximation unreliable even when the formula is computable.
Why the Degrees-of-Freedom Formula Has This Form
The formula matches the overall covariance variability of the estimated contrast covariance to that of a Wishart covariance estimate. The derivation below assumes the stated Gaussian model, so that each \((n_i-1)S_i\) has a Wishart distribution and is independent of the group sample mean. This also makes \(Y\) independent of \(\widehat\Omega\).
To verify the result, put \(E_i=C_iS_iC_i'/n_i\). For a sample covariance from \(n_i\) independent Gaussian observations, the Wishart covariance identity gives \(\operatorname{Cov}((S_i)_{ab},(S_i)_{cd})= \{(\Sigma_i)_{ac}(\Sigma_i)_{bd}+(\Sigma_i)_{ad}(\Sigma_i)_{bc}\}/(n_i-1)\). A linear transformation preserves the corresponding Wishart covariance identity. Thus, after whitening, the contribution from group \(i\) has total elementwise variance \(\{(\operatorname{tr}A_i^*)^2+\operatorname{tr}((A_i^*)^2)\}/(n_i-1)\). The groups are independent, so these contributions add. For a whitened Wishart matrix with mean \(I_q\) and degrees of freedom \(\nu\), the variance of element \((a,b)\) is \((\delta_{ac}\delta_{bd}+\delta_{ad}\delta_{bc})/\nu\) in covariance notation; summing the diagonal element variances and twice the off-diagonal variances gives \(q(q+1)/\nu\). Equating totals proves the moment-matching expression. Replacing population matrices by their sample estimates yields \(\widehat\nu\). \(\square\)
The F conversion follows from the corresponding Wishart identity. If \(Z\sim N_q(0,I_q)\) and independently \(W\sim\operatorname{Wishart}_q(I_q,\nu)\), then \(Z'(W/\nu)^{-1}Z=\nu Z'W^{-1}Z\). Integrating the independent normal and Wishart densities gives the density of \(R=Z'W^{-1}Z\):
This is the beta-prime density of \((\chi_q^2)/(\chi_{\nu-q+1}^2)\), with the two chi-square variables independent. Therefore \(R\) has distribution \(qF_{q,\nu-q+1}/(\nu-q+1)\). Under the scaled-Wishart approximation to \(\widehat\Omega\), the same identity yields \((\widehat\nu-q+1)Q/(\widehat\nu q)\) as an approximate \(F_{q,\widehat\nu-q+1}\) statistic.
Worked Calculations
Worked Example: Encoding Equality of Three Mean Vectors
Suppose three independent groups each have \(p=2\) measurements. Equality of their mean vectors imposes four scalar contrast restrictions. Compare groups 1 and 2 with group 3 by taking \(C_1=\begin{pmatrix}1&0\\0&1\\0&0\\0&0\end{pmatrix}\), \(C_2=\begin{pmatrix}0&0\\0&0\\1&0\\0&1\end{pmatrix}\), and \(C_3=\begin{pmatrix}-1&0\\0&-1\\-1&0\\0&-1\end{pmatrix}\).
Then \(q=4\) and \(Y=(\bar X_1-\bar X_3,\bar X_2-\bar X_3)'\), with each two-dimensional difference stacked as a block. The equation \(C\mu=0\) says \(\mu_1-\mu_3=0\) and \(\mu_2-\mu_3=0\), which is precisely equality of all three mean vectors. The covariance estimate is formed by adding \(C_i(S_i/n_i)C_i'\) for all three groups. Group 3 contributes to both contrasts, so its contribution includes covariance between those two contrast blocks; it must not be omitted or counted as if the contrasts were independent.
Worked Example: Applying the James-Type F Calibration
For a three-group, two-dimensional comparison, suppose \(q=4\), the computed Wald statistic is \(Q=1.2\), and the three contributions to the denominator of the degrees-of-freedom formula are \(0.4000\), \(0.3000\), and \(0.2066\). These contributions are each the trace expression for one group divided by its \(n_i-1\). Their sum is \(0.9066\), while \(q(q+1)=4(5)=20\). Thus
The numerator degrees of freedom are \(q=4\), and the approximate denominator degrees of freedom are \(22.06-4+1=19.06\). Substitution gives
The test compares \(0.2592\) with an \(F_{4,19.06}\) reference distribution. This is far below the usual 5% upper-tail critical value, which is about 2.9, so the null hypothesis is not rejected at level 0.05. The conclusion is a lack of evidence against equality, not proof that the population mean vectors are identical.
Worked Example: Reading the Calibration Before Testing
Consider a second four-dimensional contrast problem with \(\widehat\Omega=\operatorname{diag}(2,1,1,0.5)\) and \(Y=(1,1,0,0)'\). Then the inverse covariance estimate is \(\operatorname{diag}(0.5,1,1,2)\), and
Suppose the group trace contributions in the degrees-of-freedom formula sum to \(0.5\). Since \(q(q+1)=20\), the matched degrees of freedom are \(\widehat\nu=20/0.5=40\). The statistic is therefore
This example separates two inputs that are sometimes confused: \(Q\) measures the observed contrast relative to its estimated covariance, while \(\widehat\nu\) describes the estimated covariance's variability. A larger \(Q\) does not itself imply a particular denominator degrees of freedom.
Assumptions, Interpretation, and a Common Pitfall
The Gaussian assumption provides the Wishart covariance identity and independence of each sample mean from its sample covariance. Independent groups are also essential: dependence between groups changes the covariance of the stacked contrasts and invalidates the sum-of-group-contributions construction as written. In applications with substantial nonnormality, small samples, or highly unstable covariance estimates, the nominal F calibration can be inaccurate. The statistic should be reported as an approximate test, alongside the group sample sizes and the covariance-estimation method.
A frequent mistake is to use the raw quadratic form \(Q\) as though it were itself an F statistic with \(q\) numerator degrees of freedom, or to use the pooled two-sample calibration despite unequal group covariances. The correction is to compute the moment-matched \(\widehat\nu\), use the factor \((\widehat\nu-q+1)/(\widehat\nu q)\), and state the reference distribution \(F_{q,\widehat\nu-q+1}\). Another mistake is to assume that an approximate F reference makes the test exact. The calibration rests on a scaled-Wishart moment match; it does not turn the heterogeneous-covariance problem into an exact pooled-covariance test.
Check Your Understanding
Use the definitions and calculations above to answer these questions.
- For \(k\) groups with \(p\)-dimensional means, how many independent scalar restrictions express equality of all group means?
- Why does the covariance contribution from a group-specific sample covariance have \(n_i-1\) in the degrees-of-freedom calculation?
- If \(q=3\), \(Q=2\), and \(\widehat\nu=18\), write the James-type F statistic and its reference degrees of freedom.
- Why is the James-type calibration approximate rather than an exact finite-sample F test?
- What problem arises if the estimated contrast covariance \(\widehat\Omega\) is singular?