Hello!
I have a correlation matrix (called C) with dimensions [723, 723]. The matrix consist mostly of zeros (about 80%) and some non-zero correlation coefficients. I am now interested in finding the row and column indices (i.e. the id-numbers) for the non-zeros.
Is there a way to extract these indices into a list or a matrix? (Or in other case, shrink matrix C such that it only keeps the non-zeros?)
That would be great! I am very grateful for you tips!
(I am using Stata 14.)
Best,
Louise
I have a correlation matrix (called C) with dimensions [723, 723]. The matrix consist mostly of zeros (about 80%) and some non-zero correlation coefficients. I am now interested in finding the row and column indices (i.e. the id-numbers) for the non-zeros.
Is there a way to extract these indices into a list or a matrix? (Or in other case, shrink matrix C such that it only keeps the non-zeros?)
That would be great! I am very grateful for you tips!
(I am using Stata 14.)
Best,
Louise
Comment