Skip to content

15.7.4 Category Label Positions ​

/CLABELS {AUTO _|_ {ROWLABELS _|_ COLLABELS}={OPPOSITE _|_ LAYER}}

The CLABELS subcommand controls the position of category labels for the TABLE subcommand that it follows. By default, or if AUTO is specified, category labels for a given variable nest inside the variable’s label on the same axis. For example, the command below results in age categories nesting within the age group variable on the rows axis and gender categories within the gender variable on the columns axis:

CTABLES /TABLE ageGroup BY gender.
MaleFemale
S3a. GENDER:
CountCount
Age group15 or younger00
16 to 25594505
26 to 35476491
36 to 45489548
46 to 55526649
56 to 65516731
66 or older531943

ROWLABELS=OPPOSITE or COLLABELS=OPPOSITE move row or column variable category labels, respectively, to the opposite axis. The setting affects only the innermost variable or variables, which must be categorical, on the given axis. For example:

CTABLES /TABLE ageGroup BY gender /CLABELS ROWLABELS=OPPOSITE.
CTABLES /TABLE ageGroup BY gender /CLABELS COLLABELS=OPPOSITE.
15 or younger16 to 2526 to 3536 to 4546 to 5556 to 6566 or older15 or younger16 to 2526 to 3536 to 4546 to 5556 to 6566 or older
S3a. GENDER:
MaleFemale
CountCountCountCountCountCountCountCountCountCountCountCountCountCount
Age group05944764895265165310505491548649731943
S3a. GENDER:
Count
Age group15 or youngerMale0
Female0
16 to 25Male594
Female505
26 to 35Male476
Female491
36 to 45Male489
Female548
46 to 55Male526
Female649
56 to 65Male516
Female731
66 or olderMale531
Female943

ROWLABELS=LAYER or COLLABELS=LAYER move the innermost row or column variable category labels, respectively, to the layer axis.

Only one axis’s labels may be moved, whether to the opposite axis or to the layer axis.

Effect on Summary Statistics ​

CLABELS primarily affects the appearance of tables, not the data displayed in them. However, CTABLES can affect the values displayed for statistics that summarize areas of a table, since it can change the definitions of these areas.

For example, consider the following syntax and output:

CTABLES /TABLE ageGroup BY gender [ROWPCT, COLPCT].
Row %Column %Row %Column %
S3a. GENDER:
MaleFemale
Age group15 or younger..0%..0%
16 to 2554.0%19.0%46.0%13.1%
26 to 3549.2%15.2%50.8%12.7%
36 to 4547.2%15.6%52.8%14.2%
46 to 5544.8%16.8%55.2%16.8%
56 to 6541.4%16.5%58.6%18.9%
66 or older36.0%17.0%64.0%24.4%

Using COLLABELS=OPPOSITE changes the definitions of rows and columns, so that column percentages display what were previously row percentages and the new row percentages become meaningless (because there is only one cell per row):

CTABLES
    /TABLE ageGroup BY gender [ROWPCT, COLPCT]
    /CLABELS COLLABELS=OPPOSITE.
Row %Column %
S3a. GENDER:
Age group15 or youngerMale..
Female..
16 to 25Male100.0%54.0%
Female100.0%46.0%
26 to 35Male100.0%49.2%
Female100.0%50.8%
36 to 45Male100.0%47.2%
Female100.0%52.8%
46 to 55Male100.0%44.8%
Female100.0%55.2%
56 to 65Male100.0%41.4%
Female100.0%58.6%
66 or olderMale100.0%36.0%
Female100.0%64.0%

Moving Categories for Stacked Variables ​

If CLABELS moves category labels from an axis with stacked variables, the variables that are moved must have the same category specifications (see CTABLES Per-Variable Category Options) and the same value labels.

The following shows both moving stacked category variables and adapting to the changing definitions of rows and columns:

CTABLES /TABLE (likelihoodOfBeingStoppedByPolice
                + likelihoodOfHavingAnAccident) [COLPCT].
CTABLES /TABLE (likelihoodOfBeingStoppedByPolice
                + likelihoodOfHavingAnAccident) [ROWPCT]
  /CLABELS ROW=OPPOSITE.
Almost certainVery likelySomewhat likelySomewhat unlikelyVery unlikely
Column %
105b. How likely is it that drivers who have had too much to drink to drive safely will A. Get stopped by the police?Almost certain10.2%
Very likely21.8%
Somewhat likely40.2%
Somewhat unlikely19.0%
Very unlikely8.9%
105b. How likely is it that drivers who have had too much to drink to drive safely will B. Have an accident?Almost certain15.9%
Very likely40.8%
Somewhat likely35.0%
Somewhat unlikely6.2%
Very unlikely2.0%
Row %Row %Row %Row %Row %
105b. How likely is it that drivers who have had too much to drink to drive safely will A. Get stopped by the police?10.2%21.8%40.2%19.0%8.9%
105b. How likely is it that drivers who have had too much to drink to drive safely will B. Have an accident?15.9%40.8%35.0%6.2%2.0%

基于 GNU PSPP 2.0.1 手册与入门教程整理