1

I need to compare many multivariate means. Usually, I would do this using Hotelling's T-square test statistics.

The original Hotelling's equation is: T^2 = (nxny/nx+ny) (X-Y)' S^-1 (X-Y)

where X and Y are the vector means, S is the pooled covariance matrix, and nx/y are the sample sizes.

However, an assumption of the normal Hotelling's test is that the sample covariance matrices are equal/homogeneous. I know from Box's test that this is not true for my data. These websites present a modified version of Hotelling's T-square test that does not assume equal covariance matrices:

http://www.real-statistics.com/multivariate-statistics/hotellings-t-square-statistic/hotellings-t-square-unequal-covariance-matrices/

https://ncss-wpengine.netdna-ssl.com/wp-content/themes/ncss/pdf/Procedures/NCSS/Hotellings_Two-Sample_T2.pdf

The modified equation is: T^2 = (X-Y)' ((Sx/nx) + (Sy/ny))^-1 (X-Y)

where X and Y are the vector means, Sx/y are the corresponding covariance matrices, and nx/y are the sample sizes.

I've scoured R packages to try and find one that does this modified version of the equation with no luck. Does anyone know of a package that would do this in R?

TAH
  • 120
  • 1
  • 3
  • 11

2 Answers2

1

You can use the function TwoSamplesHT2 of the MVTests package. This package has been removed from CRAN but it is available in the archive.

Stéphane Laurent
  • 75,186
  • 15
  • 119
  • 225
  • Thank you! Currently working with the maintainer of the 'Hotelling' package as well to add the unequal covariance matrix functionality. I'll add that as an answer once we've finalized it, but this was really helpful. – TAH Feb 07 '20 at 17:18
0

The "SHT" package, short for Statistical Hypothesis Testing Toolbox has some of the implementations you may be interested in. There are more than one function that may meet your requirement (one is a modified version of the Nel and van der Merwe test mentioned in the NCSS pdf) so perhaps check the documentation for the specifics.