# How to calculate the value of correlation coefficient r using Spearman correlation coefficient test?

조회 수: 10(최근 30일)
답변: Muhammad shahid 2017년 12월 7일
HI, For attached rainfall data sheet A.Xls I want to calculate the value of correlation coefficient "r" by using Spearman correlation coefficient test. Can some one help me to calculate it in mat-lab. Moreover kindly guide me how to interpret the value of r for strong, week and negligible correlation.
##### 댓글 수: 2표시숨기기 이전 댓글 수: 1
jean claude 2017년 12월 6일
yes that's your variables x and y , then rho is your coefficient r you're welcome!

댓글을 달려면 로그인하십시오.

### 채택된 답변

jean claude 2017년 12월 6일
if you have the statistics toolbox you can use
[RHO,PVAL] = corr(x,y,'type','Spearman')

댓글을 달려면 로그인하십시오.

### 추가 답변(1개)

Dear jean claude I have developed this code for data in one column. I wan to perform this on many columns like for attached data set "B.xls" hOW I Would have to modify this code?
data = xlsread('V'); [nrows, ncolumns] = size(data); for i = 1:ncolumns X = data(1:nrows-1); Y = data(2:nrows); [RHO,PVAL] = corr(X,Y,'type','Spearman'); end

댓글을 달려면 로그인하십시오.

### Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!