CTABLES
CTABLES is available in Custom Tables and Advanced
Statistics.
Note: Square brackets that are used in the CTABLES syntax
chart are required parts of the syntax and are not used to indicate
optional elements. All subcommands except /TABLE are
optional.
CTABLES
/FORMAT MINCOLWIDTH={DEFAULT} MAXCOLWIDTH={DEFAULT}
{value } {value }
UNITS={POINTS} EMPTY= {ZERO } MISSING= {'.' }
{INCHES } {BLANK } {'chars'}
{CM } {'chars'}
/VLABELS VARIABLES= varlist
DISPLAY= {DEFAULT}
{NAME }
{LABEL }
{BOTH }
{NONE }
/MRSETS COUNTDUPLICATES= {NO}
{YES }
/SMISSING {VARIABLE}
{LISTWISE }
/PCOMPUTE &catname= EXPR(expression)
/PPROPERTIES &catname &catname...
LABEL= "label"
FORMAT= summary format ... summary format
HIDESOURCECATS= {NO**}
{YES }
/WEIGHT VARIABLE=varname
/HIDESMALLCOUNTS COUNT = {5 }
{integer}
/TABLE rows BY columns BY layers
/SLABELS POSITION= {COLUMN} VISIBLE= {YES}
{ROW } {NO }
{LAYER }
/CLABELS {AUTO }
{ROWLABELS= {OPPOSITE} }
{LAYER }
{COLLABELS= {OPPOSITE} }
{LAYER }
/CRITERIA CILEVEL={95** }
{value}
/CATEGORIES VARIABLES= varlist
{ [value, value, value...] }
{ ORDER= {A} KEY= {VALUE } MISSING= {EXCLUDE} }
{D } {LABEL } {INCLUDE }
{summary(varname)}
TOTAL= {NO} LABEL= "label" POSITION= {AFTER } EMPTY= {INCLUDE}
{YES } {BEFORE} {EXCLUDE }
Explicit value lists can include SUBTOTAL=’label’, HSUBTOTAL=’label’, MISSING, OTHERNM.
/TITLES CAPTION= ['text' 'text'...]
CORNER= ['text' 'text'...]
TITLE= ['text' 'text'...]
Text can contain the symbols )DATE )TIME )TABLE
/SIGTEST TYPE= CHISQUARE ALPHA= {0.05 }
{significance level}
INCLUDEMRSETS={YES }
{NO }
CATEGORIES={ALLVISIBLE }
{SUBTOTALS }
/COMPARETEST TYPE= {PROP} ALPHA= {0.05 }
{MEAN} {value, value}
ADJUST= {BONFERRONI }
{BH }
{NONE }
INCLUDEMRSETS={YES**} MEANSVARIANCE={ALLCATS }
{NO } {TESTEDCATS}
CATEGORIES={ALLVISIBLE**}
{SUBTOTALS }
MERGE={NO**}
{YES}
STYLE={APA** }
{SIMPLE}
SHOWSIG={NO**}
{YES }
** Default if subcommand or keyword omitted.
Row, column, and layer elements each have the general form
varname {[C]} [summary ‘label’ format...] {+} varname ...
{[S]} {>}
When nesting (>) and concatenation (+) are combined, as in a
+ b > c, nesting occurs before concatenation; parentheses
can be used to change precedence, as in (a + b) > c.
Summary functions available for all variables
COUNT ROWPCT.COUNT COLPCT.COUNT TABLEPCT.COUNT SUBTABLEPCT.COUNT LAYERPCT.COUNT
LAYERROWPCT.COUNT LAYERCOLPCT.COUNT ROWPCT.VALIDN COLPCT.VALIDN TABLEPCT.VALIDN SUBTABLEPCT.VALIDN
LAYERPCT.VALIDN LAYERROWPCT.VALIDN LAYERCOLPCT.VALIDN ROWPCT.TOTALN COLPCT.TOTALN TABLEPCT.TOTALN
SUBTABLEPCT.TOTALN LAYERPCT.TOTALN LAYERROWPCT.TOTALN LAYERCOLPCT.TOTALN
Summary functions available for scale variables and for totals and subtotals of numeric variables
MAXIMUM MEAN MEDIAN MINIMUM MISSING MODE PTILE RANGE SEMEAN STDDEV SUM TOTALN VALIDN
VARIANCE ROWPCT.SUM COLPCT.SUM TABLEPCT.SUM SUBTABLEPCT.SUM LAYERPCT.SUM LAYERROWPCT.SUM
LAYERCOLPCT.SUM
Summary functions available for multiple response variables and their totals
RESPONSES ROWPCT.RESPONSES COLPCT.RESPONSES TABLEPCT.RESPONSES SUBTABLEPCT.RESPONSES
LAYERPCT.RESPONSES LAYERROWPCT.RESPONSES LAYERCOLPCT.RESPONSES ROWPCT.RESPONSES.COUNT
COLPCT.RESPONSES.COUNT TABLEPCT.RESPONSES.COUNT SUBTABLEPCT.RESPONSES.COUNT LAYERPCT.RESPONSES.COUNT
LAYERROWPCT.RESPONSES.COUNT LAYERCOLPCT.RESPONSES.COUNT ROWPCT.COUNT.RESPONSES
COLPCT.COUNT.RESPONSES TABLEPCT.COUNT.RESPONSES SUBTABLEPCT.COUNT.RESPONSES LAYERPCT.COUNT.RESPONSES
LAYERROWPCT. COUNT.RESPONSES LAYERCOLPCT.COUNT.RESPONSES
Summary functions for effective base weight
If you specify an effective base weight variable on the WEIGHT subcommand, the
following summary statistics are available:
ECOUNT. The adjusted count used in effective base weight calculations.EVALIDN. The adjusted valid N used in effective base weight calculations.ETOTALN. The adjusted total N used in effective base weight calculations.
Unweighted summaries
For unweighted summaries, prefix U to a function name, as in
UCOUNT.
Confidence intervals and standard error
Upper and lower confidence limits are available for counts, percents, mean. median, percentiles, and sum.
- The keyword for the lower confidence limit is the summary statistic keyword followed by the
suffix
.LCL. For example,COUNT.LCL. - The keyword for the upper confidence limit is the summary statistic keyword followed by the
suffix
.UCL. For example,COUNT.UCL.
Standard error is available for counts, percents, mean, and sum.
- The keyword for standard error is the summary statistic keyword followed by the suffix
.SE. For example,COUNT.SE.
Confidence intervals and standard errors are not available for multiple response sets.
Formats for summaries
COMMAw.d DOLLARw.d Fw.d NEGPARENw.d NEQUALw.d PARENw.d PCTw.d PCTPARENw.d DOTw.d
CCA...CCEw.d Nw.d Ew.d and all DATE formats
This command reads the active dataset and causes execution of any pending commands. See the topic Command Order for more information.
Syntax for
the CTABLES command can be generated from the Custom Tables dialog.
Release History
Release 13.0
-
HSUBTOTALkeyword introduced on theCATEGORIESsubcommand.
Release 14.0
-
INCLUDEMRSETSkeyword introduced on theSIGTESTandCOMPARETESTsubcommands. -
CATEGORIESkeyword introduced on theSIGTESTandCOMPARETESTsubcommands. -
MEANSVARIANCEkeyword introduced on theCOMPARETESTsubcommand.
Release 18.0
-
MERGEkeyword introduced on theCOMPARETESTsubcommand. -
PCOMPUTEandPPROPERTIESsubcommands introduced.
Release 19.0
-
HIDESMALLCOUNTSsubcommand introduced.
Release 24.0
SHOWSIGkeyword added toCOMPARETESTsubcommand.CRITERIAsubcommand introduced.ADJUST=BHadded toCOMPARETESTsubcommand for Benjamini-Hochberg correction.STYLEkeyword added toCOMPARETESTsubcommand.- Confidence intervals added for counts, percents, mean, median, and sum statistics.
WEIGHTsubcommand introduced.
Examples
CTABLES /TABLE POLVIEWS [COLPCT] BY AGECAT.
CTABLES /TABLE $MLTNEWS [COUNT COLPCT] BY SEX
/SLABELS VISIBLE=NO
/CATEGORIES VARIABLES=SEX TOTAL=YES.
CTABLES /TABLE (CONFINAN + CONBUS + CONBUS + CONEDUC
+ CONPRESS + CONMEDIC)[COUNT ROWPCT]
/CLABELS ROWLABELS=OPPOSITE.