The CORRELATION Procedure

WITH Statement

  • WITH variables;

The WITH statement lists variables for which to compute correlation coefficients. The WITH statement requests correlations of the form r left-parenthesis upper X Subscript i Baseline comma upper Y Subscript j Baseline right-parenthesis, where upper Y 1 comma ellipsis comma upper Y Subscript n Baseline are the row analysis variables that are specified in the WITH statement and upper X 1 comma ellipsis comma upper X Subscript m Baseline are the column analysis variables that are specified in the VAR statement; or, if there is no VAR statement, all numeric variables that are not specified in any other statement. The correlation matrix has a rectangular structure of the form

Start 3 By 3 Matrix 1st Row 1st Column r left-parenthesis upper Y 1 comma upper X 1 right-parenthesis 2nd Column midline-horizontal-ellipsis 3rd Column r left-parenthesis upper Y 1 comma upper X Subscript m Baseline right-parenthesis 2nd Row 1st Column vertical-ellipsis 2nd Column down-right-diagonal-ellipsis 3rd Column vertical-ellipsis 3rd Row 1st Column r left-parenthesis upper Y Subscript n Baseline comma upper X 1 right-parenthesis 2nd Column midline-horizontal-ellipsis 3rd Column r left-parenthesis upper Y Subscript n Baseline comma upper X Subscript m Baseline right-parenthesis EndMatrix

For example, the statements

proc correlation data=mycas.data;
   var x1 x2;
   with y1 y2 y3;
run;

produce correlations for the following combinations:

StartLayout 1st Row  Start 3 By 2 Matrix 1st Row 1st Column r left-parenthesis upper Y Baseline 1 comma upper X Baseline 1 right-parenthesis 2nd Column r left-parenthesis upper Y Baseline 1 comma upper X Baseline 2 right-parenthesis 2nd Row 1st Column r left-parenthesis upper Y Baseline 2 comma upper X Baseline 1 right-parenthesis 2nd Column r left-parenthesis upper Y Baseline 2 comma upper X Baseline 2 right-parenthesis 3rd Row 1st Column r left-parenthesis upper Y Baseline 3 comma upper X Baseline 1 right-parenthesis 2nd Column r left-parenthesis upper Y Baseline 3 comma upper X Baseline 2 right-parenthesis EndMatrix EndLayout
Last updated: December 08, 2021