0todd0000 / spm1d

One-Dimensional Statistical Parametric Mapping in Python
GNU General Public License v3.0
61 stars 21 forks source link

Can anyone elaborate the (J x Q x I) arrays for multivariate 1D tests #75

Closed jasiozaucha closed 6 years ago

jasiozaucha commented 6 years ago

I am trying to use the SPM package to compute the Paired Hotelling’s T2 test in python using 2 arrays of shape N subjects and 5 criteria (the format is the same as in the following Excel example: http://www.real-statistics.com/multivariate-statistics/hotellings-t-square-statistic/paired-sample-hotellings-t-square/)

It is unclear to me whether the dimension of 5 corresponds to Q or I. Anyway, the third dimension in my case is 1, but the Paired Hotelling’s T2 requires both Q and I to be at least 2. Can anyone explain what am I missing?

m-a-robinson commented 6 years ago

Hello,

It is a little tricky to use the example in the link you provide for an explanation as these data are not 1-dimensional. For spm1d, the J x Q x I format represents observations x nodes x components, so in an example of ten subjects mean ground reaction forces the J x Q x I array would be a 10 (subject) x 101 (nodes or time) x 3 (Fx, Fy, Fz) array.

If you have a paired design, you would therefore have two identically structured 10 x 101 x 3 arrays that you would enter in to the Hotellings T2 function.

Regards Mark

jasiozaucha commented 6 years ago

Hi Mark, I don't see how a 10 (subject) x 101 (nodes or time) x 3 (Fx, Fy, Fz) array is 1-dimensional. Isn't it 3-dimensional?

the data I have is N subjets x 5 nodes x Fx. To me this is one dimensional.

Does it mean it is impossible to use the function to calculate the t2 statistic for the data I have?

Best, Jan

0todd0000 commented 6 years ago

Mark's right, the main point of spm1d is to analyze univariate and multivariate 1D data (nearly all other software packages can analyze multivariate 0D data).

If you really want to use spm1d to analyze 0D data please look at this example: ./spm1d/examples/stats0d/ex_hotellings1.py and in particular the following dataset:

dataset = spm1d.data.mv0d.hotellings1.RSXLHotellings1()

This is the dataset from the real-statistics site above, so you should be able to see from these data how you should organize your own data: as a (J x I) array for 0D data, and as a (J x Q x I) array for 1D data as Mark notes above.

Todd

jasiozaucha commented 6 years ago

Many thanks Todd,

Unfortunately, this is the only Hotelling T2 test python impplementation I could find.

m-a-robinson commented 6 years ago

Hello Jan,

I understand that this might appear confusing, some further clarification regarding data structure is provided in this thread

Regards Mark