I'm having trouble understanding the differences between the p-values returned from corrcoef and regress. I have a large data set with variables in the columns and instances in the rows. I determine which variables have significant relationships using corrcoef like this:
[R,P,RLO,RUP] = corrcoef(binaryDataXlx,'rows','pairwise');[sigx,sigy] = find(P < 0.05);sig = [sigx sigy];
Then, for those that are significant, I remove the NaN entries and use regress to find the coefficients of linear regression:
[B,BINT,Rregress,RINT,STATS] = regress(tempPruned(:,2),Xregress,0.05);
My main problem is that the p-values from corrcoef do not agree with the p-values from STATS(3). Is this because corrcoef compares all relationships, not just linear ones? And if so, why are the p-values from regress sometimes smaller than those from corrcoef?
Thanks you so much!!
Matthew
Best Answer