Examples (CTABLES command)

Example: Column Percentages

CTABLES /TABLE POLVIEWS [COLPCT] BY AGECAT.
Figure 1. Table with column percentages
Table with column percentages
  • POLVIEWS defines the rows, and AGECAT defines the columns. Column percentages are requested, overriding the default COUNT function.

Example: Using a Multiple Response Set

CTABLES  /TABLE $MLTNEWS [COUNT COLPCT] BY SEX 
  /SLABELS VISIBLE=NO
  /CATEGORIES VARIABLES=SEX TOTAL=YES.
Figure 2. Multiple response set table
Multiple response set table
  • $MLTNEWS is a multiple response set.
  • The COLPCT function uses the number of respondents as the percentage base, so each cell shows the percentage of males or females who gave each response, and the sum of percentage for each column is greater than 100.
  • Summary labels are hidden.
  • The CATEGORIES subcommand creates a total for both sexes.

Example: Concatenation

CTABLES /TABLE (CONFINAN + CONBUS + CONBUS + CONEDUC 
  + CONPRESS + CONMEDIC)[COUNT ROWPCT]
  /CLABELS ROWLABELS=OPPOSITE.
Figure 3. Table with category labels in columns
Table with category labels in columns
  • The six confidence variables all have the same categories with the same value labels for each category.
  • The CLABELS subcommand moves the category labels to the columns.