corrcoef : p value interpretation
Afficher commentaires plus anciens
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 commentaire
José-Luis
le 15 Juil 2014
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.
Réponse acceptée
Plus de réponses (0)
Catégories
En savoir plus sur Analysis of Variance and Covariance dans Centre d'aide et File Exchange
Produits
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!