Next: Statistics Positions and Labels, Previous: Basics, Up: CTABLES [Contents][Index]
The CTABLES
command allows the user to control how the data are
summarized with summary specifications, syntax that lists one or
more summary function names, optionally separated by commas, and which
are enclosed in square brackets following a variable name on the
TABLE
subcommand. When all the variables are categorical,
summary specifications can be given for the innermost nested variables
on any one axis. When a scalar variable is present, only the scalar
variable may have summary specifications.
The following example includes a summary specification for column and row percentages for categorical variables, and mean and median for a scalar variable:
CTABLES /TABLE=age [MEAN, MEDIAN] BY gender /TABLE=ageGroup [COLPCT, ROWPCT] BY gender.
|
A summary specification may override the default label and format by appending a string or format specification or both (in that order) to the summary function name. For example:
CTABLES /TABLE=ageGroup [COLPCT 'Gender %' PCT5.0, ROWPCT 'Age Group %' PCT5.0] BY gender.
|
In addition to the standard formats, CTABLES
allows the user to
specify the following special formats:
NEGPARENw.d | Encloses negative numbers in parentheses. | 42.96 | (42.96) |
NEQUALw.d | Adds a N= prefix. | N=42.96 | N=-42.96 |
| Encloses all numbers in parentheses. | (42.96) | (-42.96) |
PCTPARENw.d | Encloses all numbers in parentheses with a ‘%’ suffix. | (42.96%) | (-42.96%) |
Parentheses provide a shorthand to apply summary specifications to multiple variables. For example, both of these commands:
CTABLES /TABLE=ageGroup[COLPCT] + membersOver16[COLPCT] BY gender. CTABLES /TABLE=(ageGroup + membersOver16)[COLPCT] BY gender.
produce the same output shown below:
|
The following sections list the available summary functions. After each function’s name is given its default label and format. If no format is listed, then the default format is the print format for the variable being summarized.
Next: Statistics Positions and Labels, Previous: Basics, Up: CTABLES [Contents][Index]