corrcoef : p value interpretation
Mostra commenti meno recenti
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 Commento
José-Luis
il 15 Lug 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.
Risposta accettata
Più risposte (0)
Categorie
Scopri di più su Analysis of Variance and Covariance in Centro assistenza e File Exchange
Prodotti
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!