docs
authorBen Pfaff <blp@cs.stanford.edu>
Fri, 5 Aug 2022 23:46:15 +0000 (16:46 -0700)
committerBen Pfaff <blp@cs.stanford.edu>
Fri, 5 Aug 2022 23:46:15 +0000 (16:46 -0700)
doc/statistics.texi

index 60253236545786cc1cebba995a89c2bfee8ff691..75de355bd07bd0d9a263b8d47f1ad3eb1dd847e8 100644 (file)
@@ -1185,61 +1185,21 @@ produce the same output shown below:
 
 @psppoutput {ctables12}
 
-The following section lists the available summary functions.
+The following sections list the available summary functions.
 
 @menu
-* CTABLES Summary Functions::
+* CTABLES Summary Functions for Individual Cells::
+* CTABLES Summary Functions for Groups of Cells::
+* CTABLES Summary Functions for Adjusted Weights::
+* CTABLES Unweighted Summary Functions::
 @end menu
 
-@node CTABLES Summary Functions
-@subsubsection Summary Functions
+@node CTABLES Summary Functions for Individual Cells
+@subsubsection Summary Functions for Individual Cells
 
-This section lists the summary functions that can be applied to cells
-in @code{CTABLES}.  Many of these functions have an @var{area} in
-their names, indicating that they summarize over multiple cells within
-an area of the output chosen by the user.  The following basic
-@var{area}s are supported, in decreasing order of size:
-
-@table @code
-@item TABLE
-A @dfn{section}.  Stacked variables divide sections of the output from
-each other.  sections may span multiple layers.
-
-@item LAYER
-A section within a single layer.
-
-@item SUBTABLE
-A @dfn{subtable}, whose contents are the cells that pair an innermost
-row variable and an innermost column variable within a single layer.
-@end table
-
-The following shows how the output for the table expression @code{qn61
-> qn57 BY qnd7a > qn86 + qn64b BY qns3a}@footnote{This is not
-necessarily a meaningful table, so for clarity variable labels are
-omitted.} is divided up into @code{TABLE}, @code{LAYER}, and
-@code{SUBTABLE} areas.  Each unique value for Table ID is one section,
-and similarly for Layer ID and Subtable ID.  Thus, this output has two
-@code{TABLE} areas (one for @code{qnd7a} and one for @code{qn64b}),
-four @code{LAYER} areas (for those two variables, per layer), and 12
-@code{SUBTABLE} areas.
-@psppoutput {ctables22}
-
-@code{CTABLES} also supports the following @var{area}s that further
-divide a subtable or a layer within a section:
-
-@table @code
-@item LAYERROW
-@itemx LAYERCOL
-A row or column, respectively, in one layer of a section.
-
-@item ROW
-@itemx ROW
-A row or column, respectively, in a subtable.
-@end table
-
-The following summary functions may be applied to any variable
-regardless of whether it is categorical or scalar.  The default label
-for each function is listed in parentheses:
+This section lists the summary functions that can be applied to
+individual cells in @code{CTABLES}.  Only one such summary function,
+@code{COUNT}, may be applied to both categorical and scale variables:
 
 @table @asis
 @item @code{COUNT} (``Count'')
@@ -1250,18 +1210,9 @@ include missing values (@pxref{CTABLES Per-Variable Category
 Options}), then some or all of the categories for a cell might be
 missing values.  @code{COUNT} counts data included in a cell
 regardless of whether its categories are missing.
-
-@item @code{@i{area}PCT} or @code{@i{area}PCT.COUNT} (``@i{Area} %'')
-A percentage within the specified @var{area}.
-
-@item @code{@i{area}PCT.VALIDN} (``@i{Area} Valid N %'')
-A percentage of valid values within the specified @var{area}.
-
-@item @code{@i{area}PCT.TOTALN} (``@i{Area} Total N %'')
-A percentage of total values within the specified @var{area}.
 @end table
 
-The following summary functions apply only to scalar variables or
+The following summary functions apply only to scale variables or
 totals and subtotals for categorical variables.  Be cautious about
 interpreting the summary value in the latter case, because it is not
 necessarily meaningful; however, the mean of a Likert scale, etc.@:
@@ -1286,9 +1237,6 @@ Sum of weights of user- and system-missing values.
 @item @code{MODE} (``Mode'')
 The highest-frequency value.  Ties are broken by taking the smallest mode.
 
-@item @code{@i{area}PCT.SUM} (``@i{Area} Sum %'')
-Percentage of the sum of the values across @var{area}.
-
 @item @code{PTILE} @i{n} (``Percentile @i{n}'')
 The @var{n}th percentile, where @math{0 @leq{} @var{n} @leq{} 100}.
 
@@ -1327,6 +1275,77 @@ not count valid values that are in excluded categories.
 The variance.
 @end table
 
+@node CTABLES Summary Functions for Groups of Cells
+@subsubsection Summary Functions for Groups of Cells
+
+These summary functions summarize over multiple cells within an area
+of the output chosen by the user and specified as part of the function
+name.  The following basic @var{area}s are supported, in decreasing
+order of size:
+
+@table @code
+@item TABLE
+A @dfn{section}.  Stacked variables divide sections of the output from
+each other.  sections may span multiple layers.
+
+@item LAYER
+A section within a single layer.
+
+@item SUBTABLE
+A @dfn{subtable}, whose contents are the cells that pair an innermost
+row variable and an innermost column variable within a single layer.
+@end table
+
+The following shows how the output for the table expression @code{qn61
+> qn57 BY qnd7a > qn86 + qn64b BY qns3a}@footnote{This is not
+necessarily a meaningful table, so for clarity variable labels are
+omitted.} is divided up into @code{TABLE}, @code{LAYER}, and
+@code{SUBTABLE} areas.  Each unique value for Table ID is one section,
+and similarly for Layer ID and Subtable ID.  Thus, this output has two
+@code{TABLE} areas (one for @code{qnd7a} and one for @code{qn64b}),
+four @code{LAYER} areas (for those two variables, per layer), and 12
+@code{SUBTABLE} areas.
+@psppoutput {ctables22}
+
+@code{CTABLES} also supports the following @var{area}s that further
+divide a subtable or a layer within a section:
+
+@table @code
+@item LAYERROW
+@itemx LAYERCOL
+A row or column, respectively, in one layer of a section.
+
+@item ROW
+@itemx COL
+A row or column, respectively, in a subtable.
+@end table
+
+The following summary functions for groups of cells are available for
+each @var{area} described above, for both categorical and scale
+variables:
+
+@table @asis
+@item @code{@i{area}PCT} or @code{@i{area}PCT.COUNT} (``@i{Area} %'')
+A percentage of total counts within @var{area}.
+
+@item @code{@i{area}PCT.VALIDN} (``@i{Area} Valid N %'')
+A percentage of total counts for valid values within @var{area}.
+
+@item @code{@i{area}PCT.TOTALN} (``@i{Area} Total N %'')
+A percentage of total counts for all values within @var{area}.
+@end table
+
+Scale variables and totals and subtotals for categorical variables may
+use the following additional group cell summary function:
+
+@table @asis
+@item @code{@i{area}PCT.SUM} (``@i{Area} Sum %'')
+Percentage of the sum of the values within @var{area}.
+@end table
+
+@node CTABLES Summary Functions for Adjusted Weights
+@subsubsection Summary Functions for Adjusted Weights
+
 If the @code{WEIGHT} subcommand specified an adjustment weight
 variable, then the following summary functions use its value instead
 of the dictionary weight variable.  Otherwise, they are equivalent to
@@ -1343,6 +1362,9 @@ the summary function without the @samp{E}-prefix:
 @code{EVALIDN} (``Adjusted Valid N'')
 @end itemize
 
+@node CTABLES Unweighted Summary Functions
+@subsubsection Unweighted Summary Functions
+
 The following summary functions with a @samp{U}-prefix are equivalent
 to the same ones without the prefix, except that they use unweighted
 counts: