用matlab能求spearman秩相关系数吗
来源:百度知道 编辑:UC知道 时间:2024/05/05 10:23:09
请详细说明一下spearman 秩相关系数的定义、解法等,用什么软件可以求出一组数据的秩相关系数。谢谢!
老外的例子,不需要看懂英文,有算例。
Statistics Toolbox
Description: 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