Closed MarkKramer closed 2 years ago
Hi Mark,
Yes, for simple linear regression (spm1d.stats.regress
), you should be able to access the correlation coefficient through spm.r
:
spm = spm1d.stats.regress(y, x);
r = spm.r
There is a relatively simple transform between the r- and t-statistics; you can also manually calculate the former from the latter like this:
r = sqrt( t.^2 / (n - 2 + t.^2) );
where n
is the sample size (n = size(y,1)
) and t
is the t-statistic (spm.z
).
Brilliant, thank you once again.
Dear Prof Pataky: Why is the correlation coefficient obtained using "spm.r" in MATLAB exactly the same as the one obtained using the "correl" function in Excel? What are the differences between SPM statistical correlation analysis and traditional Pearson correlation analysis? Thank you your time
Huang
This issue was closed so thank you Huang for opening a new issue (#203). I've replied there.
Dear Prof Pataky,
I am busy completing an SPM1d regression between continuous forceplate data and peak torque values. Does the SPM1d analysis actually provide the "correlation coefficient" in the outputs? I was thinking that perhaps it is under "spm.r" or perhaps something else? It would be great if I could somehow show that if there is a significant cluster, what the approximate correlation is within that cluster?
Thank you again for all your time and effort.
Kind regards,
Mark