add examples
[pspp] / doc / statistics.texi
index 2e4c96c6a17a566d502eca34fe3a9a2601f33c7b..0cfceb225afa5d59988a7a426f5042866d0291a2 100644 (file)
@@ -1658,7 +1658,14 @@ A subtotal (@pxref{CTABLES Totals and Subtotals}).
 If multiple elements of the list cover a given category, the last one
 in the list takes precedence.
 
-@c TODO example
+The following example syntax and output show how an explicit category
+can limit the displayed categories:
+
+@example
+CTABLES /TABLE qn1.
+CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 [1, 2, 3].
+@end example
+@psppoutput {ctables27}
 
 @node CTABLES Implicit Categories
 @subsubsection Implicit Categories
@@ -1687,7 +1694,15 @@ User-missing values are excluded by default, or with
 @code{MISSING=EXCLUDE}.  Specify @code{MISSING=INCLUDE} to include
 user-missing values.  The system-missing value is always excluded.
 
-@c TODO example
+The following example syntax and output show how
+@code{MISSING=INCLUDE} causes missing values to be included in a
+category list.
+
+@example
+CTABLES /TABLE qn1.
+CTABLES /TABLE qn1 /CATEGORIES VARIABLES=qn1 MISSING=INCLUDE.
+@end example
+@psppoutput {ctables28}
 
 @node CTABLES Totals and Subtotals
 @subsubsection Totals and Subtotals
@@ -1706,21 +1721,35 @@ subtotal.  Either way, the default label is ``Subtotal'', use
 @code{SUBTOTAL="@i{label}"} or @code{HSUBTOTAL="@i{label}"} to specify
 a custom label.
 
-@c TODO
+The following example syntax and output show how to use
+@code{TOTAL=YES} and @code{SUBTOTAL}:
+
+@example
+CTABLES
+    /TABLE qn1
+    /CATEGORIES VARIABLES=qn1 [OTHERNM, SUBTOTAL='Valid Total',
+                               MISSING, SUBTOTAL='Missing Total']
+                             TOTAL=YES LABEL='Overall Total'.
+@end example
+@psppoutput {ctables29}
 
 By default, or with @code{POSITION=AFTER}, totals are displayed in the
 output after the last category and subtotals apply to categories that
 precede them.  With @code{POSITION=BEFORE}, totals come before the
 first category and subtotals apply to categories that follow them.
 
-@c TODO
-
 Only categorical variables may have totals and subtotals.  Scalar
 variables may be ``totaled'' indirectly by enabling totals and
-subtotals on a categorical variable within which the scalar variable is
-summarized.
+subtotals on a categorical variable within which the scalar variable
+is summarized.  For example, the following syntax produces a mean,
+count, and valid count across all data by adding a total on the
+categorical @code{region} variable, as shown:
 
-@c TODO
+@example
+CTABLES /TABLE=region > qn20 [MEAN, VALIDN]
+    /CATEGORIES VARIABLES=region TOTAL=YES LABEL='All regions'.
+@end example
+@psppoutput {ctables30}
 
 By default, @pspp{} uses the same summary functions for totals and
 subtotals as other categories.  To summarize totals and subtotals