corrcoef : p value interpretation
이전 댓글 표시
Hi !
According to corrcoef help page, we can read : "If P(i,j) is small, say less than 0.05, then the correlation R(i,j) is significant."
Here is a snippet :
clear all;close all;clc;
N = 1000;
X = 1*rand(N,2);
Y = [2*X(:,1),-2*X(:,2)];
[r p] = corrcoef(X,Y)
We easily notice that X and Y are truly correlated. Here is an output of this script :
r =
1.0000 -0.0108
-0.0108 1.0000
p =
1.0000 0.6278
0.6278 1.0000
We have p(1,2) = p(2,1) > .05, means that R(1,2) = R(2,1) are not significant, which is fine to me.
Nevertheless, p(1,1) = p(2,2) > .05, means that R(1,1) = R(2,2) shouldn't be trusted either. I feel this result inconsistent.
Indeed, the correlation coefficient of a random vector with itself is 1, which reflects a perfect correlation. So why p(i,i) is not zero ?
Many thanks for your help.
Sylvain
댓글 수: 1
José-Luis
2014년 7월 15일
This is annoying. Whoever had answered this question deleted that and with it all the comments of people that were trying to contribute.
You are right Sylvain, it should be zero and should ignore the values in the diagonal.
채택된 답변
추가 답변 (0개)
카테고리
도움말 센터 및 File Exchange에서 Analysis of Variance and Covariance에 대해 자세히 알아보기
제품
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!