0todd0000 / spm1d

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

0D data analysis #36

Closed fmoissenet closed 8 years ago

fmoissenet commented 8 years ago

Dear Todd,

I would like to use the SPM Hotelling's T2 test on 0D data.

In the website "spm1d.org", I can read "All spm1d.stats functions now support both 0D and 1D data data analysis.". However, when I try to use it on the Python version of SPM, I have the error "Shape of array too small to calculate a numerical gradient".

My vector field is a 9x70x1 matrix.

Is the Hotelling's T2 test available for 0D data?

Best regards, Florent Moissenet.

0todd0000 commented 8 years ago

Hi Florent,

Yes, the test is available for 0D data. Please check the example files: ./examples/stats0d/ex_hotellings_paired.py ./examples/stats0d/ex_hotellings1.py ./examples/stats0d/ex_hotellings2.py The datasets in these examples contain links to websites which describe the tests in detail for 0D data.

In general, spm1d requires that multivariate 0D data are shaped (J x I) and that multivariate 1D data are shaped (J x Q x I) where: J = number of observations Q = number of nodes in the 1D continuum I = number of vector components

If your dataset does indeed contain J=9 and I=70 then Hotelling's tests are not possible because there are too many vector components. I cannot be greater than J.

Todd

fmoissenet commented 8 years ago

Hi Todd,

Thank you again for this fast answer. Problem solved. The problem was an inversion of I and J ... sorry. Python remains new for me and define columns before rows (opposite of Matlab) is confusing for me.

Best regards, Florent.

Le 15/12/2015 18:13, Todd Pataky a écrit :

Hi Florent,

Yes, the test is available for 0D data. Please check the example files: ./examples/stats0d/ex_hotellings_paired.py ./examples/stats0d/ex_hotellings1.py ./examples/stats0d/ex_hotellings2.py The datasets in these examples contain links to websites which describe the tests in detail for 0D data.

In general, spm1d requires that multivariate 0D data are shaped (J x I) and that multivariate 1D data are shaped (J x Q x I) where: J = number of observations Q = number of nodes in the 1D continuum I = number of vector components

If your dataset does indeed contain J=9 and I=70 then Hotelling's tests are not possible because there are too many vector components. I cannot be greater than J.

Todd

— Reply to this email directly or view it on GitHub https://github.com/0todd0000/spm1d/issues/36#issuecomment-164830277.

Florent MOISSENET

Ingénieur en Biomécanique (PhD)

/REHAZENTER - Centre National de Rééducation //Fonctionnelle et de Réadaptation /

/1 rue André Vésale, L-2674 Luxembourg +352 2698 94310 Pour sauver des arbres, mangez des castors et n’imprimez pas cet e-mail !/