Skip to main content
ARS Home » Research » Publications at this Location » Publication #182889

Title: SIMPLE METHODS TO PULL THE DIAGONAL OUT OF A CORRELATION MATRIX

Author
item Thornton, Laura

Submitted to: Proceedings of SAS Users Group
Publication Type: Proceedings
Publication Acceptance Date: 8/1/2005
Publication Date: 9/11/2005
Citation: Thornton, L.L. 2005. Simple methods to pull the diagonal out of a correlation matrix. Proceedings of 18th Annual Northeast SAS Users Group Conference, September 11-14, 2005, Portland, Maine. 2 pp.

Interpretive Summary: When using large data sets with many variables, it is often necessary to find how the variables are correlated. However, many times, the cross-correlations among all the variables are not as important as the diagonal of a correlation matrix where both the var and with clauses are invoked. A simple and effective use of macro variable references can be employed to display only the diagonal using the noprint option for the PROC CORR and a single dataset step. While the simple statistics are not printed prior to the diagonal of the matrix, they can be obtained using a PROC MEANS prior to the invocation to the correlation procedure. The methodology for two ways of extraction of singular pieces from the matrix and various adaptations are presented.

Technical Abstract: When using large data sets with many variables, it is often necessary to find how the variables are correlated. However, many times, the cross-correlations among all the variables are not as important as the diagonal of a correlation matrix where both the var and with clauses are invoked. A simple and effective use of macro variable references can be employed to display only the diagonal using the noprint option for the PROC CORR and a single dataset step. While the simple statistics are not printed prior to the diagonal of the matrix, they can be obtained using a PROC MEANS prior to the invocation to the correlation procedure. The methodology for two ways of extraction of singular pieces from the matrix and various adaptations are presented.