Difference between spearmann correlation and fit command
Mostra commenti meno recenti
Hello all,
I have some data that I want to analyze (EMG of muscles vs subjects' fatigue) in order to find the relation between two measurs.
At first, I used the 'corr' command to calculate the spearman correlation coefficient between the EMG and the fatigue for each subject. Afterwards, I used the 'fit' command to fit a linear model to my data.
To my surprise, in some cases (about 5% of the cases), the spearman correlation coefficient was positive, but the fitted linear model had a negative slope (or vice versa).
Shouldn't they have the same tendency? Or am I doing something wrong?
I'm attaching my matlab code, and excel file with some example data that shows the spoken discrepancy.
Thank you.
Risposta accettata
Più risposte (1)
Wayne King
il 11 Ott 2013
0 voti
I would not put any faith in the correlation coefficient, the p-value is 0.9 and the reported rho is close to 0.
1 Commento
Gena
il 11 Ott 2013
Categorie
Scopri di più su Linear and Nonlinear Regression in Centro assistenza e File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!