Table Data (CORRESPONDENCE command)

  • The cells of a table can be read and analyzed directly by using the keyword ALL after TABLE.
  • The columns of the input table must be specified as variables on the DATA LIST command. Only columns are defined, not rows.
  • ALL is followed by the number of rows in the table, a comma, and the number of columns in the table, all in parentheses.
  • The row variable is named ROW, and the column variable is named COLUMN.
  • The number of rows and columns specified can be smaller than the actual number of rows and columns if you want to analyze only a subset of the table.
  • The variables (columns of the table) are treated as the column categories, and the cases (rows of the table) are treated as the row categories.
  • Row categories can be assigned values (category codes) when you specify TABLE=ALL by the optional variable ROWCAT_. This variable must be defined as a numeric variable with unique values corresponding to the row categories. If ROWCAT_ is not present, the row index (case) numbers are used as row category values.

Example

DATA LIST /ROWCAT_ 1 COL1 3-4 COL2 6-7 COL3 9-10.
BEGIN DATA
1 50 19 26 
2 16 40 34 
3 12 35 65 
4 11 20 58 
END DATA.
VALUE LABELS ROWCAT_ 1 ‘ROW1’ 2 ‘ROW2’ 3 ‘ROW3’ 4 ‘ROW4’.
CORRESPONDENCE TABLE=ALL(4,3).
  • DATA LIST defines the row category naming variable ROWCAT_ and the three columns of the table as the variables.
  • The TABLE=ALL specification indicates that the data are the cells of a table. The (4,3) specification indicates that there are four rows and three columns.
  • The column variable is named COLUMN with categories labeled COL1, COL2, and COL3.
  • The row variable is named ROW with categories labeled ROW1, ROW2, ROW3, and ROW4.