How this calculation works
Hotelling’s T squared tests several mean coordinates jointly while accounting for their covariance. Testing each variable separately ignores that dependence and creates a different multiple-testing problem. In one-sample mode, the mean vector is compared with a fixed null vector. Two-sample mode compares independent means using a pooled covariance under an equal-covariance assumption. The page returns the covariance actually used, the mean-difference vector and the finite-sample F conversion. A singular or ill-conditioned covariance is an explicit failure rather than a silent pseudoinverse substitution.
One sample T²=n(x̄−μ₀)ᵀS⁻¹(x̄−μ₀); F=(n−p)T²/[p(n−1)]. Two samples use pooled covariance and n₁n₂/(n₁+n₂).A worked example
For observations (1,1),(2,1),(1,2),(2,2),(3,2), the mean vector is (1.8,1.6). The sample covariance is ((0.7,0.15),(0.15,0.3)). Comparing with null vector (0,0), the quadratic covariance-adjusted distance is 152/15, and multiplying by n=5 gives T²=152/3, approximately 50.666667. With p=2, the F conversion multiplies by (5−2)/(2×4)=3/8, giving F=19 with degrees of freedom two and three.
Good to know
3–200 rows per sample and 1–6 variables. One-sample n must exceed p; two-sample n1+n2 must exceed p+1. The covariance must be nonsingular and sufficiently conditioned under a relative pivot check. Classical F calibration assumes independent multivariate-normal observations; pooled two-sample mode also assumes equal population covariances. No paired mode, regularization, high-dimensional correction, missing-data deletion or pseudoinverse fallback. The multivariate mean result does not identify individual affected coordinates.
Reference: Statsmodels — multivariate mean tests and Hotelling conversion (opens in a new tab) ↗
Covariance defines the direction-sensitive distance
The inverse covariance weights mean differences by the variation available in each direction. A combination of variables with little sample variability can be more unusual than a larger raw difference along a highly variable direction. Off-diagonal covariances therefore matter: replacing them by zeros changes the hypothesis statistic. The covariance table lets the user inspect whether variables are redundant or nearly linearly dependent before interpreting the result.
Changing measurement units consistently changes both the mean-difference vector and covariance, leaving the theoretical quadratic statistic invariant under invertible linear re-expression. Numeric conditioning can still deteriorate when units differ enormously, which is why the solver checks its pivots. A perfectly duplicated variable makes covariance singular; it is not extra independent evidence. The page rejects such an input rather than pretending the full original dimension still supplies valid F degrees of freedom.
The two-sample model is not a multivariate Welch test
Two independent samples contribute their within-sample covariance matrices with weights n1−1 and n2−1. The resulting pooled estimate assumes a common population covariance. Unequal sample sizes are permitted, but unequal sizes do not relax that covariance assumption. Related unequal-covariance multivariate tests use different approximations and are outside this calculator. Pairing or repeated measures would also change the covariance of the mean difference.
A significant joint test says the specified mean vectors differ under the model; it does not assign the difference to a particular coordinate or establish practical importance. Follow-up analysis needs an appropriate multiplicity and interpretation plan. The Welch two sample t test calculator compares a scalar mean under a different variance model. Running it repeatedly on columns is not the same as this covariance-adjusted joint hypothesis, even when some resulting p-values look similar.
A few questions, answered
Can I use more variables than observations?
Not with this classical covariance-inverse test. One-sample observations must outnumber variables, and the estimated covariance must have full rank.
Why does the calculator show both T squared and F?
T squared is the covariance-adjusted mean statistic. The displayed F transformation supplies the stated finite-sample reference distribution and degrees of freedom under the classical assumptions.