Spearman Rank Correlation
Version 1.0.0.0 (1 KB) by
Alexandros Leontitsis
It calculates the Spearman rank correlation coefficient.
15.1K Downloads
Updated
10 Oct 2006
No License
It calculates the Spearman rank correlation coefficient from 2 or more data sets, and the associated t-test and p-values. The code is adapted with major changes from the Numerical Recipes book (http://www.nr.com/)
Example:
>> x = [1 2 3 3 3]';
>> y = [1 2 2 4 3; rand(1,5)]';
>> [r,t,p] = spear(x,y)
>> [r,t,p]=spear(x,y)
r =
0.8250 -0.6000
t =
2.5285 -1.2990
p =
0.0855 0.2848
Cite As
Alexandros Leontitsis (2026). Spearman Rank Correlation (https://uk.mathworks.com/matlabcentral/fileexchange/4374-spearman-rank-correlation), MATLAB Central File Exchange. Retrieved .
MATLAB Release Compatibility
Created with
R14
Compatible with any release
Platform Compatibility
Windows macOS LinuxCategories
Find more on Random Number Generation in Help Center and MATLAB Answers
Tags
Discover Live Editor
Create scripts with code, output, and formatted text in a single executable document.
| Version | Published | Release Notes | |
|---|---|---|---|
| 1.0.0.0 | Minor bug fix, thanks to Sunnia Chai |
