필터 지우기
필터 지우기

How to find significance of correlation coefficients?

조회 수: 38 (최근 30일)
Keegan Carvalho
Keegan Carvalho 2020년 4월 13일
댓글: Adam Danz 2020년 4월 13일
Hi Matlab World,
I am trying to find the significance of the correlation coefficients between two variables ssh and t (Zip file attached). I have hence used the following code:
lat = ncread('ssh.nc','latitude');
lon = ncread('ssh.nc','longitude');
ssh = ncread('ssh.nc','zos');
t = ncread('ssh.nc','bottomT');
nx=length(lon);
ny=length(lat);
rxy = zeros(nx,ny) ;
sxy = zeros(nx,ny) ;
for i=1:nx
for j=1:ny
[r,s] = corr(squeeze(t(i,j,:)),squeeze(ssh(i,j,:)));
rxy(i,j)=r;
end
end
I wanted to find how much of the area has significant correlation at 95% significance level (p value < 0.05) and plot it thereafter. Looking forward to your assistance.

채택된 답변

Adam Danz
Adam Danz 2020년 4월 13일
The 2nd output to corr() gives you the p-value. You just need to save those values.
[rxy(i,j),sxy(i,j)] = corr(squeeze(t(i,j,:)),squeeze(ssh(i,j,:)));

추가 답변 (0개)

카테고리

Help CenterFile Exchange에서 NetCDF에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by