MATLAB Answers

Spearman correlation in Matlab!

599 views (last 30 days)
M G
M G on 27 Oct 2011
Hey Matlab users,
If I have two series of data:
a = [1 4 6 3 4 6 7 8]; b [34 56 34 56 79 23 48 28];
and I want to perform a Spearman correlation what would be the proper command in MATLAB? I need both p-value and RHO.
Thanks for your help.
Mehdi

  0 Comments

Sign in to comment.

Accepted Answer

Wayne King
Wayne King on 27 Oct 2011
Hi, If you have the Statistics Toolbox.
a = [1 4 6 3 4 6 7 8];
b = [34 56 34 56 79 23 48 28];
[RHO,PVAL] = corr(a',b','Type','Spearman');

  0 Comments

Sign in to comment.

More Answers (0)