The two-sample version of Hotelling T2. The quantity D2, introduced by Mahalanobis in a 1930 paper, may be considered to be a measure of the distance between two groups of p-dimensional observations. Let x̄j be the p×1 vector of means for group j (j=1,2), with Sj the corresponding variance–covariance matrix. D2 is given by where S is given by and n1 and n2 are the sample sizes.