I have several hundred measurements. Now, I am considering utilizing some kind of software to correlate every measure with every measure. This means that there are thousands of correlations. Among these there should (statistically) be a high correlation, even if the data is completely random (each measure has only about 100 datapoints).
When I find a correlation, how do I include the information about how hard I looked for a correlation, into it?
I am not at a high level in statistics, so please bear with me.
R
on this machine takes 18 seconds to obtain 1000 realizations of the null permutation distribution of the max correlation coefficient for a 300 by 100 matrixx
:correl <- function(x, k=1) { n <- dim(x)[2] * (dim(x)[2]-1) / 2; v <- cor(x); sort(v[lower.tri(v)])[(n-k+1):n] }; sim <- replicate(1000, correl(apply(x,2,sample)))
$\endgroup$