0todd0000 / spm1dmatlab

One-Dimensional Statistical Parametric Mapping in Matlab.
GNU General Public License v3.0
28 stars 13 forks source link

SPM1D Regression Interpretation #197

Closed nmartonick closed 9 months ago

nmartonick commented 9 months ago

Hello,

I am investigating whether tissue stiffness values obtained by ultrasound are related to kinematics during a single leg squat. My findings using spm1d.stats.regress indicate a linear relationship but I do not know how to determine whether that relationship is negative or positive based on the output. Can this information be obtained with the SPM regression analysis?

Nick

0todd0000 commented 9 months ago

Hello Nick,

The sign of the t-value indicates the correlation direction. If the t-value is positive then the correlation coefficient is also positive implying a positive correlation, and vice versa for negative t-values.

Alternatively you can retrieve the correlation coefficient $r$ from the output SPM object like this:

spm = spm1d.stats.regress(y, x);
r   = spm.r;   % correlation coefficient

There is a simple transformation between the t- and r-values. The only real difference is that r-values are constrained to the range [-1, +1] but t-values have the range: [-∞, +∞].

nmartonick commented 9 months ago

Excellent, Thank you Todd.