Tutorials › Multivariate Statistics (Graduate) › A Three-Dimensional Hotelling Test: Worked Analysis

Inference on Mean Vectors · Tutorial 210 of 975

A Three-Dimensional Hotelling Test: Worked Analysis

Work through a three-dimensional Hotelling test numerically, checking its F calibration and inverting the test to obtain a confidence ellipsoid.

Intermediate 10 min read

What You'll Learn

  • Calculate the one-sample Hotelling statistic from a three-dimensional mean difference and sample covariance matrix
  • Convert the statistic to its exact F calibration under multivariate normal sampling
  • Evaluate an exact p-value using the F distribution and its beta-function representation
  • Construct the unknown-covariance confidence ellipsoid by inverting the test
  • Check numerical scaling and distinguish the statistic from its F-calibrated version

From Sample Summaries to a Multivariate Decision

A one-sample Hotelling test asks whether a population mean vector equals a specified target, while accounting for both the scales and dependence of its coordinates. In three dimensions, the test combines the three observed mean differences into one covariance-standardized distance. The calculation is compact, but it is easy to lose a factor when converting that distance to its exact reference distribution.

We will use one set of sample summaries throughout. They make it possible to check every step: the quadratic form, the F statistic, the p-value, and the confidence region. The exact calibration assumes independent observations from a multivariate normal distribution and a nonsingular sample covariance matrix; it is not a general distribution-free result.

Definition: For a sample of size \(n\) from a \(p\)-dimensional population, let \(\bar{X}\) be the sample mean vector and let \(S\) be the sample covariance matrix calculated with divisor \(n-1\). To test \(H_0:\mu=\mu_0\), the one-sample Hotelling statistic is $$ T^2=n(\bar{X}-\mu_0)'S^{-1}(\bar{X}-\mu_0). $$ If the observations are independent and distributed as \(N_p(\mu,\Sigma)\), with \(\Sigma\) positive definite and \(n>p\), then under \(H_0\), $$ \frac{n-p}{p(n-1)}T^2\sim F_{p,n-p}. $$

The inverse covariance matrix makes this a joint measure of discrepancy: it accounts for the variability of each coordinate and their covariances. The factor multiplying \(T^2\) is part of the exact finite-sample calibration. It is not optional, and it is not the same as \(T^2\) itself.

Worked Analysis: The Quadratic Form

Suppose 12 independent patients have three measurements recorded. The observed mean vector is \(\bar{x}=(12,22,32)'\), and the target is \(\mu_0=(10,20,30)'\). The sample covariance matrix is $$ S=\frac{11}{3}I_3, $$ where \(I_3\) is the three-dimensional identity matrix. Assume the observations are from a multivariate normal population. We first calculate the observed test statistic.

Worked Example: Calculating \(T^2\) From the Sample Summaries

The mean difference is \(d=\bar{x}-\mu_0=(2,2,2)'\). Since \(S=(11/3)I_3\), its inverse is \(S^{-1}=(3/11)I_3\). Therefore the covariance-standardized squared distance is $$ d'S^{-1}d =(2,2,2)\frac{3}{11}I_3 \begin{pmatrix}2\\2\\2\end{pmatrix} =\frac{3}{11}(2^2+2^2+2^2) =\frac{36}{11}. $$ Multiplying by the sample size gives $$ T^2=12\left(\frac{36}{11}\right)=\frac{432}{11}\approx39.2727. $$ This is the observed Hotelling statistic. It is not yet the value to compare directly with an \(F\) critical value.

This example has a spherical sample covariance matrix, so the standardization is especially transparent. Each coordinate contributes the same amount, and there are no sample covariances between coordinates. With a general positive-definite \(S\), the same definition applies, but one uses the full inverse matrix rather than treating the coordinates separately.

Exact F Calibration and the Test Decision

For this example \(p=3\) and \(n=12\), so the exact null reference distribution has 3 and 9 degrees of freedom. Substituting those values into the calibration gives $$ F_{\mathrm{obs}}=\frac{12-3}{3(12-1)}T^2 =\frac{9}{33}\left(\frac{432}{11}\right) =\frac{1296}{121} \approx10.7107. $$ The arithmetic can be checked by simplifying the multiplier first: \(9/33=3/11\), so \((3/11)(432/11)=1296/121\). In particular, the result is about \(10.71\), not \(9.82\).

At significance level \(0.05\), the upper-tail critical value is approximately \(F_{3,9;0.95}=3.8625\). Since \(10.7107>3.8625\), the test rejects \(H_0\) at this level. The decision concerns the mean vector as a whole; it does not, by itself, identify which coordinates account for the discrepancy.

Theorem: Under the stated independent multivariate-normal model, with \(n>p\) and nonsingular \(S\), the level-\(\alpha\) upper-tail Hotelling test rejects \(H_0:\mu=\mu_0\) when $$ \frac{n-p}{p(n-1)}T^2>F_{p,n-p;1-\alpha}, $$ where \(F_{p,n-p;1-\alpha}\) is the \(1-\alpha\) quantile of the central \(F\) distribution with \(p\) and \(n-p\) degrees of freedom.

The conversion is an algebraic rescaling of the statistic, not a new calculation of the distance. To see exactly how it controls the test, substitute the definition of \(T^2\) into the rejection rule: $$ \frac{n-p}{p(n-1)}n(\bar{X}-\mu_0)'S^{-1}(\bar{X}-\mu_0)>F_{p,n-p;1-\alpha}. $$ All multipliers are positive for \(n>p\), so this is equivalent to $$ T^2>\frac{p(n-1)}{n-p}F_{p,n-p;1-\alpha}. $$ Thus the critical value on the \(T^2\) scale is different from the critical value on the \(F\) scale. Keeping these scales distinct is a useful check on any calculation.

Worked Analysis: The Exact P-Value

The p-value is the null probability of obtaining an \(F_{3,9}\) value at least as large as the observed value. For an \(F_{d_1,d_2}\) variable, its upper-tail probability at \(f\) can be written as \(I_z(d_2/2,d_1/2)\), where \(z=d_2/(d_2+d_1f)\) and \(I_z(a,b)\) is the regularized incomplete beta function.

Worked Example: Evaluating the Upper-Tail Probability

Using \(F_{\mathrm{obs}}=1296/121\), calculate the beta-function argument: $$ z=\frac{9}{9+3(1296/121)} =\frac{1089}{1089+3888} =\frac{121}{553} \approx0.2188. $$ Consequently, the exact p-value is $$ P(F_{3,9}\geq10.7107) =I_{121/553}\left(\frac{9}{2},\frac{3}{2}\right) \approx0.0025. $$ For clarity, the regularized incomplete beta function here means $$ I_z(a,b)=\frac{\int_0^z t^{a-1}(1-t)^{b-1}\,dt}{\int_0^1 t^{a-1}(1-t)^{b-1}\,dt}. $$ The p-value is therefore about \(0.25\%\), consistent with the rejection at the \(5\%\) level. It is a probability calculated under the null model, not the probability that the null hypothesis is true.

Inverting the Test: The Confidence Ellipsoid

The same exact calibration gives a confidence region for the unknown mean vector when the covariance matrix is unknown and estimated by \(S\). For any proposed mean vector \(m\), calculate the Hotelling distance from \(\bar{X}\) to \(m\). Keeping the proposed value whenever the corresponding level-\(\alpha\) test does not reject produces the confidence ellipsoid.

Result: Under independent multivariate-normal sampling, with \(n>p\) and nonsingular \(S\), an exact \(100(1-\alpha)\%\) confidence region for \(\mu\) is $$ \left\{m\in\mathbb{R}^p: n(\bar{X}-m)'S^{-1}(\bar{X}-m) \leq \frac{p(n-1)}{n-p}F_{p,n-p;1-\alpha} \right\}. $$

To verify the inversion, fix any proposed \(m\). The test of \(H_0:\mu=m\) accepts precisely when its F-calibrated statistic is no greater than \(F_{p,n-p;1-\alpha}\). Multiplying that inequality by \(p(n-1)/(n-p)\), which is positive, gives the displayed bound on \(n(\bar{X}-m)'S^{-1}(\bar{X}-m)\). The confidence set is exactly the collection of accepted proposed means. If the true mean is \(\mu\), its probability of inclusion is the probability that the level-\(\alpha\) test of \(H_0:\mu=\mu\) accepts, which is \(1-\alpha\) under the exact calibration. This establishes the stated coverage.

Worked Example: Writing the 95% Confidence Ellipsoid

For the sample above, \(p=3\), \(n=12\), and \(F_{3,9;0.95}\approx3.8625\). The confidence-region inequality becomes $$ 12(\bar{x}-m)'S^{-1}(\bar{x}-m) \leq \frac{3(11)}{9}(3.8625) \approx14.162. $$ Since \(S^{-1}=(3/11)I_3\), the left side is $$ 12\frac{3}{11}\|\bar{x}-m\|^2 =\frac{36}{11}\|\bar{x}-m\|^2. $$ Therefore the region is equivalently $$ \|\bar{x}-m\|^2\leq\frac{121}{108}(3.8625)\approx4.3275. $$ It is a sphere in this particular example, centered at \((12,22,32)'\), with radius approximately \(\sqrt{4.3275}=2.080\). The target \((10,20,30)'\) is outside: its squared distance from the center is \(2^2+2^2+2^2=12\), which exceeds \(4.3275\). This agrees with the test decision. With a general covariance matrix, the region is an ellipsoid whose orientation and axis lengths are determined by \(S\).

Common Mistakes and Practical Checks

A multivariate calculation can go wrong even when the matrix operations are straightforward. Before reporting a result, check the statistic, the degrees of freedom, and the scale on which a critical value is being used.

  • Comparing \(T^2\) directly with an \(F\) critical value. The exact \(F\) variable is \(\{(n-p)/[p(n-1)]\}T^2\), not \(T^2\). Convert first, or use the equivalent \(T^2\)-scale critical value.
  • Dropping a factor of \(n\). The quadratic form \((\bar{X}-\mu_0)'S^{-1}(\bar{X}-\mu_0)\) is not itself \(T^2\); the definition multiplies it by \(n\).
  • Using the wrong degrees of freedom. For this one-sample test, the reference distribution is \(F_{p,n-p}\). Here that is \(F_{3,9}\), not \(F_{3,12}\).
  • Treating the p-value as a posterior probability. The p-value is a tail probability under the null distribution and does not give the probability that the null is true.
  • Forgetting the model conditions. The stated finite-sample calibration and ellipsoid coverage require the multivariate-normal model and a nonsingular sample covariance matrix, in addition to \(n>p\).

A useful numerical check is to compare the test decision with the confidence region: at the same significance level, the target mean is excluded by the two-sided ellipsoid exactly when the test rejects it. In this example, both calculations give that conclusion.

Check Your Understanding

Use the formulas and calculations in the analysis to answer these questions.

  1. For \(p=3\) and \(n=12\), what are the two degrees of freedom in the exact F calibration?
  2. Why is the sample covariance \(S\) inverted in the Hotelling quadratic form?
  3. For the worked sample, show how \(9/33\) simplifies before it is multiplied by \(432/11\).
  4. What event does the exact p-value measure under the null hypothesis?
  5. How does inverting the level-\(\alpha\) test produce a confidence region for the mean vector?
Clinical Biostats