https://www.ibm.com/docs/zh/spss-statistics/29.0.0?topic=reference-ctables
example data
https://od.lk/d/178307401_DLXGb/tourist_enlabels.sav
SPSS custom table
CTABLES
/VLABELS VARIABLES=gender age_range4 region income_range3 expense_range4 DISPLAY=LABEL
/TABLE age_range4 + region + income_range3 + expense_range4 + gender [COUNT F40.0]
/CATEGORIES VARIABLES= age_range4 region income_range3 expense_range4 ORDER=A KEY=VALUE EMPTY=INCLUDE.
variable | count | |
age_range4 | below 20 | 39 |
20-40 | 127 | |
40-60 | 143 | |
above 60 | 64 | |
region | Central China | 62 |
East China | 60 | |
North China | 62 | |
Northeast China | 45 | |
Northwest China | 48 | |
Southwest China | 57 | |
West China | 39 | |
income per capita | Lowest thru 1999 | 76 |
2000-2999 | 191 | |
3000 thru Highest | 106 | |
average expense per capita | Lowest thru 299 | 152 |
300-399 | 144 | |
400-499 | 71 | |
500 thru Highest | 6 | |
gender | male | 214 |
female | 159 |
CTABLES
/VLABELS VARIABLES=gender age_range4 region income_range3 expense_range4 DISPLAY=LABEL
/TABLE gender[COUNT F40.0, COLPCT.COUNT PCT40.1]+ age_range4[COUNT F40.0, COLPCT.COUNT PCT40.1] + region[COUNT F40.0, COLPCT.COUNT PCT40.1] + income_range3[COUNT F40.0, COLPCT.COUNT PCT40.1] + expense_range4 [COUNT F40.0, COLPCT.COUNT PCT40.1]
/CATEGORIES VARIABLES= age_range4 region income_range3 expense_range4 ORDER=A KEY=VALUE EMPTY=INCLUDE
/CRITERIA CILEVEL=95.
variable | Count | Column N % | |
age_range4 | below 20 | 214 | 57.4% |
20-40 | 159 | 42.6% | |
40-60 | 39 | 10.5% | |
above 60 | 127 | 34.0% | |
region | Central China | 143 | 38.3% |
East China | 64 | 17.2% | |
North China | 62 | 16.6% | |
Northeast China | 60 | 16.1% | |
Northwest China | 62 | 16.6% | |
Southwest China | 45 | 12.1% | |
West China | 48 | 12.9% | |
income per capita | Lowest thru 1999 | 57 | 15.3% |
2000-2999 | 39 | 10.5% | |
3000 thru Highest | 76 | 20.4% | |
average expense per capita | Lowest thru 299 | 191 | 51.2% |
300-399 | 106 | 28.4% | |
400-499 | 152 | 40.8% | |
500 thru Highest | 144 | 38.6% | |
gender | male | 71 | 19.0% |
female | 6 | 1.6% |
CTABLES
/VLABELS VARIABLES=gender age_range4 region income_range3 expense_range4 DISPLAY=LABEL
/TABLE age_range4> sat2 [S][MEAN F40.2] + region > sat2 [S][MEAN F40.2]+ income_range3 > sat2 [S][MEAN F40.2] + expense_range4 > sat2 [S][MEAN F40.2] by gender.
satisfaction: hotel | gender | ||
male | female | ||
age_range4 | below 20 | 3.88 | 4.07 |
20-40 | 3.83 | 3.74 | |
40-60 | 3.71 | 3.85 | |
above 60 | 3.51 | 3.41 | |
region | Central China | 3.73 | 3.83 |
East China | 3.68 | 3.43 | |
North China | 3.77 | 4.17 | |
Northeast China | 3.61 | 3.35 | |
Northwest China | 3.92 | 3.74 | |
Southwest China | 3.78 | 3.90 | |
West China | 3.68 | 3.64 | |
income per capita | Lowest thru 1999 | 3.92 | 3.79 |
2000-2999 | 3.55 | 3.75 | |
3000 thru Highest | 3.94 | 3.73 | |
average expense per capita | Lowest thru 299 | 3.77 | 3.57 |
300-399 | 3.74 | 4.13 | |
400-499 | 3.61 | 3.45 | |
500 thru Highest | 4.00 | 5.00 |
Function |
Description |
Default Label* |
Default Format |
COUNT |
Number of cases in each category. This is the default for categorical and multiple response variables. |
Count |
Count |
ROWPCT.COUNT |
Row percentage based on cell counts. Computed within subtable. |
Row % |
Percent |
COLPCT.COUNT |
Column percentage based on cell counts. Computed within subtable. |
Column % |
Percent |
TABLEPCT.COUNT |
Table percentage based on cell counts. |
Table % |
Percent |
SUBTABLEPCT.COUNT |
Subtable percentage based on cell counts. |
Subtable % |
Percent |
LAYERPCT.COUNT |
Layer percentage based on cell counts. Same as table percentage if no layers are defined. |
Layer % |
Percent |
LAYERROWPCT.COUNT |
Row percentage based on cell counts. Percentages sum to 100% across the entire row (that is, across subtables). |
Layer Row % |
Percent |
LAYERCOLPCT.COUNT |
Column percentage based on cell counts. Percentages sum to 100% across the entire column (that is, across subtables). |
Layer Column % |
Percent |
ROWPCT.VALIDN |
Row percentage based on valid count. |
Row Valid N % |
Percent |
COLPCT.VALIDN |
Column percentage based on valid count. |
Column Valid N % |
Percent |
TABLEPCT.VALIDN |
Table percentage based on valid count. |
Table Valid N % |
Percent |
SUBTABLEPCT.VALIDN |
Subtable percentage based on valid count. |
Subtable Valid N % |
Percent |
LAYERPCT.VALIDN |
Layer percentage based on valid count. |
Layer Valid N % |
Percent |
LAYERROWPCT.VALIDN |
Row percentage based on valid count. Percentages sum to 100% across the entire row. |
Layer Row Valid N % |
Percent |
LAYERCOLPCT.VALIDN |
Column percentage based on valid count. Percentages sum to 100% across the entire column. |
Layer Column Valid N % |
Percent |
ROWPCT.TOTALN |
Row percentage based on total count, including user-missing and system-missing values. |
Row Total N % |
Percent |
COLPCT.TOTALN |
Column percentage based on total count, including user-missing and system-missing values. |
Column Total N % |
Percent |
TABLEPCT.TOTALN |
Table percentage based on total count, including user-missing and system-missing values. |
Table Total N % |
Percent |
SUBTABLEPCT.TOTALN |
Subtable percentage based on total count, including user-missing and system-missing values. |
Subtable Total N % |
Percent |
LAYERPCT.TOTALN |
Layer percentage based on total count, including user-missing and system-missing values. |
Layer Total N % |
Percent |
LAYERROWPCT.TOTALN |
Row percentage based on total count, including user-missing and system-missing values. Percentages sum to 100% across the entire row. |
Layer Row Total N % |
Percent |
LAYERCOLPCT.TOTALN |
Column percentage based on total count, including user-missing and system-missing values. Percentages sum to 100% across the entire column. |
Layer Column Total N % |
Percent |
*This is the default on a U.S.-English system.
The.COUNTsuffix can be omitted from percentages that are based on cell counts. Thus,ROWPCTis equivalent toROWPCT.COUNT.
Function |
Description |
Default Label |
Default Format |
MAXIMUM |
Largest value. |
Maximum |
General |
MEAN |
Arithmetic mean. The default for scale variables. |
Mean |
General |
MEDIAN |
50th percentile. |
Median |
General |
MINIMUM |
Smallest value. |
Minimum |
General |
MISSING |
Count of missing values (both user-missing and system-missing). |
Missing |
General |
MODE |
Most frequent value. If there is a tie, the smallest value is shown. |
Mode |
General |
PTILE |
Percentile. Takes a numeric value between 0 and 100 as a required parameter. PTILE is computed the same way as APTILE in the TABLES command. Note that in the TABLES command, the default percentile method was HPTILE. |
Percentile ####.## |
General |
RANGE |
Difference between maximum and minimum values. |
Range |
General |
SEMEAN |
Standard error of the mean. |
Std Error of Mean |
General |
STDDEV |
Standard deviation. |
Std Deviation |
General |
SUM |
Sum of values. |
Sum |
General |
TOTALN |
Count of nonmissing, user-missing, and system-missing values. The count excludes valid values hidden via the CATEGORIES subcommand. |
Total N |
Count |
VALIDN |
Count of nonmissing values. |
Valid N |
Count |
VARIANCE |
Variance. |
Variance |
General |
ROWPCT.SUM |
Row percentage based on sums. |
Row Sum % |
Percent |
COLPCT.SUM |
Column percentage based on sums. |
Column Sum % |
Percent |
TABLEPCT.SUM |
Table percentage based on sums. |
Table Sum % |
Percent |
SUBTABLEPCT.SUM |
Subtable percentage based on sums. |
Subtable Sum % |
Percent |
LAYERPCT.SUM |
Layer percentage based on sums. |
Layer Sum % |
Percent |
LAYERROWPCT.SUM |
Row percentage based on sums. Percentages sum to 100% across the entire row. |
Layer Row Sum % |
Percent |
LAYERCOLPCT.SUM |
Column percentage based on sums. Percentages sum to 100% across the entire column. |
Layer Column Sum % |
Percent |
Function |
Description |
Default Label |
Default Format |
RESPONSES |
Count of responses. |
Responses |
Count |
ROWPCT.RESPONSES |
Row percentage based on responses. Total number of responses is the denominator. |
Row Responses % |
Percent |
COLPCT.RESPONSES |
Column percentage based on responses. Total number of responses is the denominator. |
Column Responses % |
Percent |
TABLEPCT.RESPONSES |
Table percentage based on responses. Total number of responses is the denominator. |
Table Responses % |
Percent |
SUBTABLEPCT.RESPONSES |
Subtable percentage based on responses. Total number of responses is the denominator. |
Subtable Responses % |
Percent |
LAYERPCT.RESPONSES |
Layer percentage based on responses. Total number of responses is the denominator. |
Layer Responses % |
Percent |
LAYERROWPCT.RESPONSES |
Row percentage based on responses. Total number of responses is the denominator. Percentages sum to 100% across the entire row (that is, across subtables). |
Layer Row Responses % |
Percent |
LAYERCOLPCT.RESPONSES |
Column percentage based on responses. Total number of responses is the denominator. Percentages sum to 100% across the entire column (that is, across subtables). |
Layer Column Responses % |
Percent |
ROWPCT.RESPONSES.COUNT |
Row percentage: Responses are the numerator, and total count is the denominator. |
Row Responses % (Base: Count) |
Percent |
COLPCT.RESPONSES.COUNT |
Column percentage: Responses are the numerator, and total count is the denominator. |
Column Responses % (Base: Count) |
Percent |
TABLEPCT.RESPONSES.COUNT |
Table percentage: Responses are the numerator, and total count is the denominator. |
Table Responses % (Base: Count) |
Percent |
SUBTABLEPCT.RESPONSES.COUNT |
Subtable percentage: Responses are the numerator, and total count is the denominator. |
Subtable Responses % (Base: Count) |
Percent |
LAYERPCT.RESPONSES.COUNT |
Layer percentage: Responses are the numerator, and total count is the denominator. |
Layer Responses % (Base: Count) |
Percent |
LAYERROWPCT.RESPONSES.COUNT |
Row percentage: Responses are the numerator, and total count is the denominator. Percentages sum to 100% across the entire row (that is, across subtables). |
Layer Row Responses % (Base: Count) |
Percent |
LAYERCOLPCT.RESPONSES.COUNT |
Column percentage: Responses are the numerator, and total count is the denominator. Percentages sum to 100% across the entire column (that is, across subtables). |
Layer Column Responses % (Base: Count) |
Percent |
ROWPCT.COUNT.RESPONSES |
Row percentage: Count is the numerator, and total responses are the denominator. |
Row Count % (Base: Responses) |
Percent |
COLPCT.COUNT.RESPONSES |
Column percentage: Count is the numerator, and total responses are the denominator. |
Column Count % (Base: Responses) |
Percent |
TABLEPCT.COUNT.RESPONSES |
Table percentage: Count is the numerator, and total responses are the denominator. |
Table Count % (Base: Responses) |
Percent |
SUBTABLEPCT.COUNT. RESPONSES |
Subtable percentage: Count is the numerator, and total responses are the denominator. |
Subtable Count % (Base: Responses) |
Percent |
LAYERPCT.COUNT. RESPONSES |
Layer percentage: Count is the numerator, and total responses are the denominator. |
Layer Count % (Base: Responses) |
Percent |
LAYERROWPCT.COUNT.RESPONSES |
Row percentage: Count is the numerator, and total responses are the denominator. Percentages sum to 100% across the entire row (that is, across subtables). |
Layer Row Count % (Base: Responses) |
Percent |
LAYERCOLPCT.COUNT.RESPONSES |
Row percentage: Count is the numerator, and total responses are the denominator. Percentages sum to 100% across the entire column (that is, across subtables). |
Layer Column Count % (Base: Responses) |
Percent |