Skip to content
Prev 67817 / 398506 Next

Pearson corelation and p-value for matrix

John,

Interesting test. Thanks for pointing that out.

You are right, there is a knee-jerk reaction to avoid loops, especially
nested loops.

On the indexing of rows, I did that because Dren had indicated in his
initial post:

 "I was trying to evaluate the pearson correlation and the p-values 
  for an nxm matrix, where each row represents a vector.
  One way to do it would be to iterate through each row, and find its
  correlation value( and the p-value) with respect to the other rows."

So I ran the correlations by row, rather than by column.

Thanks again. Good lesson.

Marc
On Fri, 2005-04-15 at 21:36 -0400, John Fox wrote: