Relationship between the Hotelling's \(T^2\) and James' test.
james.hotel(x1, x2)
A list including:
A vector with two values, the James test statistic value and the sum of the two Hotelling's test statistic using the common mean.
The common mean computed the closed form expression seen in the help file of james
.
The common mean vector obtained from the minimisation process.
A matrix containing the Euclidean data of the first group.
A matrix containing the Euclidean data of the second group.
Michail Tsagris.
R implementation and documentation: Michail Tsagris mtsagris@uoc.gr.
Emerson (2009, pg. 76--81) mentioned a very nice result between the Hotelling's one sample \(T^2\) and James test for two mean vectors
$$
J\left(\pmb{\mu}\right) = T_1^2\left(\pmb{\mu}\right) + T_2^2\left(\pmb{\mu}\right),
$$
where \(J\left(\pmb{\mu}\right)\) is the James test statistic (James, 1954) and \(T_1^2\left(\pmb{\mu}\right)\) and \(T_1^2\left(\pmb{\mu}\right)\) are the two one sample Hotelling's \(T^2\) test statistic values (see function hotel1T2
) for each sample from their common mean vector \(\pmb{\mu}_c\) (see the help file of james
). In fact, James test statistic is found from minimizing the right hand side of the above expression with respect to \(\pmb{\mu}\). The sum is mimized when \(\pmb{\mu}\) takes the form of the common mean vector \(\pmb{\mu}_c\). The same is true for the t-test in the univariate case.
I have created this function illustrating this result, so this one is for educational purposes. It calculates the James test statistic, the sum of the two \(T^2\) test statistics, the common mean vector and the one found via numerical optimization. In the univariate case, the common mean vector is a weighted linear combination of the two sample means. So, if we take a segment connecting the two means, the common mean is somewhere on that segment.
Emerson S. (2009). Small sample performance and calibration of the Empirical Likelihood method. PhD thesis, Stanford university.
James G.S. (1954). Tests of Linear Hypothese in Univariate and Multivariate Analysis when the Ratios of the Population Variances are Unknown. Biometrika, 41(1/2): 19--43.
hotel2T2, maovjames, el.test2, eel.test2
james.hotel( as.matrix(iris[1:50, 1:4]), as.matrix(iris[51:100, 1:4]) )
james( as.matrix(iris[1:50, 1:4]), as.matrix(iris[51:100, 1:4]), R = 1 )
Run the code above in your browser using DataLab