Skip to content
Prev 360728 / 398503 Next

find high correlated variables in a big matrix

The rcorr function in Hmisc will return a list whose first element is a correlation matrix
[,1]      [,2]      [,3]
[1,] 1.0000000 0.9631220 0.9721688
[2,] 0.9631220 1.0000000 0.9666564
[3,] 0.9721688 0.9666564 1.0000000

You can use which to to find the locations meeting a criterion (or two):
row col
[1,]   3   1
[2,]   1   3