Hotelling's T-squared statistic (source code)

= Hotelling's T-squared statistic
{c}
{title2=$T^2=n(\bar X-\mu_0)^TS^{-1}(\bar X-\mu_0)$}

For independent <multivariate normal> observations with <positive-definite> covariance, this statistic is the maximum squared studentized mean contrast. With unbiased <sample covariance matrix> $S$ and $n>p$, its null distribution obeys $(n-p)T^2/(p(n-1))\sim F_{p,n-p}$. This follows from <independence> of the Gaussian <sample mean> and the residual <Wishart distribution>.