Next: Overriding Measurement Level, Previous: Categorical Variables, Up: Basics [Contents][Index]
For a categorical variable, CTABLES
divides the table into a
cell per category. For a scalar variable, CTABLES
instead
calculates a summary measure, by default the mean, of the values that
fall into a cell. For example, if the only variable specified is a
scalar variable, then the output is a single cell that holds the mean
of all of the data:
CTABLES /TABLE qnd1.
|
A scalar variable may nest with categorical variables. The following example shows the mean age of survey respondents across gender and language groups:
CTABLES /TABLE qns3a > qnd1 BY region.
|
The order of nesting of scalar and categorical variables affects table labeling, but it does not affect the data displayed in the table. The following example shows how the output changes when the nesting order of the scalar and categorical variable are interchanged:
CTABLES /TABLE qnd1 > qns3a BY region.
|
Only a single scalar variable may appear in each section; that is, a
scalar variable may not nest inside a scalar variable directly or
indirectly. Scalar variables may only appear on one axis within
TABLE
.
Next: Overriding Measurement Level, Previous: Categorical Variables, Up: Basics [Contents][Index]