Documentation: New markup for subcommands
[pspp] / doc / statistics.texi
index 18cc79e7ace82bdd38e55b4908aaf64a5e8a47b3..d8b1cae96b424665e85d89bc58950295a308a324 100644 (file)
@@ -1,7 +1,7 @@
 @node Statistics
 @chapter Statistics
 
-This chapter documents the statistical procedures that PSPP supports so
+This chapter documents the statistical procedures that @pspp{} supports so
 far.
 
 @menu
@@ -11,6 +11,7 @@ far.
 * CORRELATIONS::                Correlation tables.
 * CROSSTABS::                   Crosstabulation tables.
 * FACTOR::                      Factor analysis and Principal Components analysis
+* MEANS::                       Average values and other statistics.
 * NPAR TESTS::                  Nonparametric tests.
 * T-TEST::                      Test hypotheses about means.
 * ONEWAY::                      One way analysis of variance.
@@ -44,12 +45,12 @@ descriptive
 statistics requested by the user.  In addition, it can optionally
 compute Z-scores.
 
-The VARIABLES subcommand, which is required, specifies the list of
-variables to be analyzed.  Keyword VARIABLES is optional.
+The @subcmd{VARIABLES} subcommand, which is required, specifies the list of
+variables to be analyzed.  Keyword @subcmd{VARIABLES} is optional.
 
 All other subcommands are optional:
 
-The MISSING subcommand determines the handling of missing variables.  If
+The @subcmd{MISSING} subcommand determines the handling of missing variables.  If
 INCLUDE is set, then user-missing values are included in the
 calculations.  If NOINCLUDE is set, which is the default, user-missing
 values are excluded.  If VARIABLE is set, then missing values are
@@ -57,12 +58,12 @@ excluded on a variable by variable basis; if LISTWISE is set, then
 the entire case is excluded whenever any value in that case has a
 system-missing or, if INCLUDE is set, user-missing value.
 
-The FORMAT subcommand affects the output format.  Currently the
+The @subcmd{FORMAT} subcommand affects the output format.  Currently the
 LABELS/NOLABELS and NOINDEX/INDEX settings are not used.  When SERIAL is
 set, both valid and missing number of cases are listed in the output;
 when NOSERIAL is set, only valid cases are listed.
 
-The SAVE subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
+The @subcmd{SAVE} subcommand causes @cmd{DESCRIPTIVES} to calculate Z scores for all
 the specified variables.  The Z scores are saved to new variables.
 Variable names are generated by trying first the original variable name
 with Z prepended and truncated to a maximum of 8 characters, then the
@@ -71,7 +72,7 @@ ZZZZ09, ZQZQ00 through ZQZQ09, in that sequence.  In addition, Z score
 variable names can be specified explicitly on VARIABLES in the variable
 list by enclosing them in parentheses after each variable.
 
-The STATISTICS subcommand specifies the statistics to be displayed:
+The @subcmd{STATISTICS} subcommand specifies the statistics to be displayed:
 
 @table @code
 @item ALL
@@ -104,10 +105,10 @@ Standard error of the kurtosis.
 Standard error of the skewness.
 @end table
 
-The SORT subcommand specifies how the statistics should be sorted.  Most
+The @subcmd{SORT} subcommand specifies how the statistics should be sorted.  Most
 of the possible values should be self-explanatory.  NAME causes the
 statistics to be sorted by name.  By default, the statistics are listed
-in the order that they are specified on the VARIABLES subcommand.  The A
+in the order that they are specified on the @subcmd{VARIABLES} subcommand.  The A
 and D settings request an ascending or descending sort order,
 respectively.
 
@@ -144,13 +145,13 @@ variables.
 @cmd{FREQUENCIES} can also output
 histograms and pie charts.  
 
-The VARIABLES subcommand is the only required subcommand.  Specify the
+The @subcmd{VARIABLES} subcommand is the only required subcommand.  Specify the
 variables to be analyzed.
 
-The FORMAT subcommand controls the output format.  It has several
+The @subcmd{FORMAT} subcommand controls the output format.  It has several
 possible settings:  
 
-@itemize @bullet
+@itemize @subcmd{}
 @item
 TABLE, the default, causes a frequency table to be output for every
 variable specified.  NOTABLE prevents them from being output.  LIMIT
@@ -164,7 +165,7 @@ AFREQ and DFREQ tables are sorted in ascending and descending order,
 respectively, by frequency count.
 @end itemize
 
-The MISSING subcommand controls the handling of user-missing values.
+The @subcmd{MISSING} subcommand controls the handling of user-missing values.
 When EXCLUDE, the default, is set, user-missing values are not included
 in frequency tables or statistics.  When INCLUDE is set, user-missing
 are included.  System-missing values are never included in statistics,
@@ -180,12 +181,12 @@ mean, minimum, and maximum are reported for each variable.
 PERCENTILES causes the specified percentiles to be reported.
 The percentiles should  be presented at a list of numbers between 0
 and 100 inclusive.  
-The NTILES subcommand causes the percentiles to be reported at the
+The @subcmd{NTILES} subcommand causes the percentiles to be reported at the
 boundaries of the data set divided into the specified number of ranges.
 For instance, @code{/NTILES=4} would cause quartiles to be reported.
 
 @cindex histogram
-The HISTOGRAM subcommand causes the output to include a histogram for
+The @subcmd{HISTOGRAM} subcommand causes the output to include a histogram for
 each specified numeric variable.  The X axis by default ranges from
 the minimum to the maximum value observed in the data, but the MINIMUM
 and MAXIMUM keywords can set an explicit range.  Specify NORMAL to
@@ -193,97 +194,167 @@ superimpose a normal curve on the histogram.  Histograms are not
 created for string variables.
 
 @cindex piechart
-The PIECHART adds a pie chart for each variable to the data.  Each
+The @subcmd{PIECHART} subcommand adds a pie chart for each variable to the data.  Each
 slice represents one value, with the size of the slice proportional to
 the value's frequency.  By default, all non-missing values are given
 slices.  The MINIMUM and MAXIMUM keywords can be used to limit the
 displayed slices to a given range of values.  The MISSING keyword adds
 slices for missing values.
 
-The FREQ and PERCENT options on HISTOGRAM and PIECHART are accepted
-but not currently honored.
+The FREQ and PERCENT options on @subcmd{HISTOGRAM} and @subcmd{PIECHART} are accepted
+but not currently honoured.
 
 @node EXAMINE
-@comment  node-name,  next,  previous,  up
 @section EXAMINE
-@vindex EXAMINE
 
+@vindex EXAMINE
+@cindex Exploratory data analysis
 @cindex Normality, testing for
 
 @display
 EXAMINE
-        VARIABLES=var_list [BY factor_list ]
-        /STATISTICS=@{DESCRIPTIVES, EXTREME[(n)], ALL, NONE@}
+        VARIABLES= @var{var1} [@var{var2}] @dots{} [@var{varN}]
+           [BY @var{factor1} [BY @var{subfactor1}]
+             [ @var{factor2} [BY @var{subfactor2}]]
+             @dots{}
+             [ @var{factor3} [BY @var{subfactor3}]]
+            ]
+        /STATISTICS=@{DESCRIPTIVES, EXTREME[(@var{n})], ALL, NONE@}
         /PLOT=@{BOXPLOT, NPPLOT, HISTOGRAM, ALL, NONE@}
-        /CINTERVAL n
+        /CINTERVAL @var{p}
         /COMPARE=@{GROUPS,VARIABLES@}
-        /ID=var_name
+        /ID=@var{identity_variable}
         /@{TOTAL,NOTOTAL@}
-        /PERCENTILE=[value_list]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
+        /PERCENTILE=[@var{percentiles}]=@{HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL @}
         /MISSING=@{LISTWISE, PAIRWISE@} [@{EXCLUDE, INCLUDE@}] 
                [@{NOREPORT,REPORT@}]
 
 @end display
 
-The @cmd{EXAMINE} command is used to test how closely a distribution is to a 
-normal distribution.  It also shows you outliers and extreme values.
+The @cmd{EXAMINE} command is used to perform exploratory data analysis.
+In particular, it is useful for testing how closely a distribution follows a
+normal distribution, and for finding outliers and extreme values.
 
-The VARIABLES subcommand specifies the dependent variables and the
-independent variable to use as factors for the analysis.   Variables
-listed before the first BY keyword are the dependent variables.
+The @subcmd{VARIABLES} subcommand is mandatory.  
+It specifies the dependent variables and optionally variables to use as
+factors for the analysis.
+Variables listed before the first BY keyword (if any) are the 
+dependent variables.
 The dependent variables may optionally be followed by a list of
-factors which tell PSPP how to break down the analysis for each
-dependent variable.  The format for each factor is 
+factors which tell @pspp{} how to break down the analysis for each
+dependent variable. 
+
+Following the dependent variables, factors may be specified.
+The factors (if desired) should be preceeded by a single BY keyword.
+The format for each factor is 
 @display
-var [BY var].
+@var{factorvar} [BY @var{subfactorvar}].
 @end display
+Each unique combination of the values of  @var{factorvar} and
+@var{subfactorvar} divide the dataset into @dfn{cells}.
+Statistics will be calculated for each cell
+and for the entire dataset (unless NOTOTAL is given).
 
-
-The STATISTICS subcommand specifies the analysis to be done.  
+The @subcmd{STATISTICS} subcommand specifies which statistics to show.
 DESCRIPTIVES will produce a table showing some parametric and
-non-parametrics statistics.  EXTREME produces a table showing extreme
-values of the dependent variable.  A number in parentheses determines
-how many upper and lower extremes to show.  The default number is 5.
-
+non-parametrics statistics.
+EXTREME produces a table showing the extremities of each cell.
+A number in parentheses, @var{n} determines
+how many upper and lower extremities to show.
+The default number is 5.
+
+The subcommands TOTAL and NOTOTAL are mutually exclusive.
+If TOTAL appears, then statistics will be produced for the entire dataset
+as well as for each cell.
+If NOTOTAL appears, then statistics will be produced only for the cells
+(unless no factor variables have been given).
+These subcommands have no effect if there have  been no factor variables
+specified.
 
 @cindex boxplot
 @cindex histogram
 @cindex npplot
-The PLOT subcommand specifies which plots are to be produced if any.
+The @subcmd{PLOT} subcommand specifies which plots are to be produced if any.
 Available plots are HISTOGRAM, NPPLOT and BOXPLOT.
+They can all be used to visualise how closely each cell conforms to a 
+normal distribution.
+Boxplots will also show you the outliers and extreme values.
 
-The COMPARE subcommand is only relevant if producing boxplots, and it is only 
-useful there is more than one dependent variable and at least one factor.   If 
+The @subcmd{COMPARE} subcommand is only relevant if producing boxplots, and it is only 
+useful there is more than one dependent variable and at least one factor.
+If 
 /COMPARE=GROUPS is specified, then one plot per dependent variable is produced,
-containing boxplots for all the factors.
-If /COMPARE=VARIABLES is specified, then one plot per factor is produced, each 
+each of which contain boxplots for all the cells.
+If /COMPARE=VARIABLES is specified, then one plot per cell is produced,
 each containing one boxplot per dependent variable.
-If the /COMPARE subcommand is ommitted, then PSPP uses the default value of 
-/COMPARE=GROUPS.
+If the @subcmd{/COMPARE} subcommand is omitted, then @pspp{} behaves as if
+/COMPARE=GROUPS were given.
  
-The ID subcommand also pertains to boxplots.  If given, it must
-specify a variable name.   Outliers and extreme cases plotted in
-boxplots will be labelled with the case from that variable.  Numeric or
-string variables are permissible.  If the ID subcommand is not given,
-then the casenumber will be used for labelling.
+The @subcmd{ID} subcommand is relevant only if /PLOT=BOXPLOT or 
+/STATISTICS=EXTREME has been given.
+If given, it shoule provide the name of a variable which is to be used
+to labels extreme values and outliers.
+Numeric or string variables are permissible.  
+If the @subcmd{ID} subcommand is not given, then the casenumber will be used for
+labelling.
 
-The CINTERVAL subcommand specifies the confidence interval to use in
-calculation of the descriptives command.  The default it 95%.
+The @subcmd{CINTERVAL} subcommand specifies the confidence interval to use in
+calculation of the descriptives command.  The default is 95%.
 
 @cindex percentiles
-The PERCENTILES subcommand specifies which percentiles are to be calculated, 
+The @subcmd{PERCENTILES} subcommand specifies which percentiles are to be calculated, 
 and which algorithm to use for calculating them.  The default is to
 calculate the 5, 10, 25, 50, 75, 90, 95 percentiles using the
 HAVERAGE algorithm.
 
-The TOTAL and NOTOTAL subcommands are mutually exclusive.  If NOTOTAL
-is given and factors have been specified in the VARIABLES subcommand,
+The @subcmd{TOTAL} and @subcmd{NOTOTAL} subcommands are mutually exclusive.  If NOTOTAL
+is given and factors have been specified in the @subcmd{VARIABLES} subcommand,
 then then statistics for the unfactored dependent variables are
 produced in addition to the factored variables.  If there are no
 factors specified then TOTAL and NOTOTAL have no effect.
 
+
+The following example will generate descriptive statistics and histograms for
+two variables @var{score1} and @var{score2}.
+Two factors are given, @i{viz}: @var{gender} and @var{gender} BY @var{culture}.
+Therefore, the descriptives and histograms will be generated for each
+distinct  value
+of @var{gender} @emph{and} for each distinct combination of the values
+of @var{gender} and @var{race}.
+Since the NOTOTAL keyword is given, statistics and histograms for 
+@var{score1} and @var{score2} covering the  whole dataset are not produced.
+@example
+EXAMINE @var{score1} @var{score2} BY 
+        @var{gender}
+        @var{gender} BY @var{culture}
+        /STATISTICS = DESCRIPTIVES
+        /PLOT = HISTOGRAM
+        /NOTOTAL.
+@end example
+
+Here is a second example showing how the @cmd{examine} command can be used to find extremities.
+@example
+EXAMINE @var{height} @var{weight} BY 
+        @var{gender}
+        /STATISTICS = EXTREME (3)
+        /PLOT = BOXPLOT
+        /COMPARE = GROUPS
+        /ID = @var{name}.
+@end example
+In this example, we look at the height and weight of a sample of individuals and
+how they differ between male and female.
+A table showing the 3 largest and the 3 smallest values of @var{height} and 
+@var{weight} for each gender, and for the whole dataset will be shown.
+Boxplots will also be produced.
+Because /COMPARE = GROUPS was given, boxplots for male and female will be
+shown in the same graphic, allowing us to easily see the difference between
+the genders.
+Since the variable @var{name} was specified on the @subcmd{ID} subcommand, this will be
+used to label the extreme values.
+
 @strong{Warning!}
-If many dependent variable are given, or factors are given for which
+If many dependent variables are specified, or if factor variables are
+specified for which
 there are many distinct values, then @cmd{EXAMINE} will produce a very
 large quantity of output.
 
@@ -311,11 +382,11 @@ CORRELATIONS
 The @cmd{CORRELATIONS} procedure produces tables of the Pearson correlation coefficient
 for a set of variables.  The significance of the coefficients are also given.
 
-At least one VARIABLES subcommand is required. If the WITH keyword is used, then a non-square
+At least one @subcmd{VARIABLES} subcommand is required. If the WITH keyword is used, then a non-square
 correlation table will be produced.
 The variables preceding WITH, will be used as the rows of the table, and the variables following
 will be the columns of the table.
-If no WITH subcommand is given, then a square, symmetrical table using all variables is produced.
+If no @subcmd{WITH} subcommand is given, then a square, symmetrical table using all variables is produced.
 
 
 The @cmd{MISSING} subcommand determines the handling of missing variables.  
@@ -332,7 +403,7 @@ If PAIRWISE is set, then a case is considered missing only if either of the
 values  for the particular coefficient are missing.
 The default is PAIRWISE.
 
-The PRINT subcommand is used to control how the reported significance values are printed.
+The @subcmd{PRINT} subcommand is used to control how the reported significance values are printed.
 If the TWOTAIL option is used, then a two-tailed test of significance is 
 printed.  If the ONETAIL option is given, then a one-tailed test is used.
 The default is TWOTAIL.
@@ -342,11 +413,11 @@ If the NOSIG option is specified, then correlation coefficients with significanc
 If SIG is specified, then no highlighting is performed.  This is the default.
 
 @cindex covariance
-The STATISTICS subcommand requests additional statistics to be displayed.  The keyword 
+The @subcmd{STATISTICS} subcommand requests additional statistics to be displayed.  The keyword 
 DESCRIPTIVES requests that the mean, number of non-missing cases, and the non-biased
 estimator of the standard deviation are displayed.
 These statistics will be displayed in a separated table, for all the variables listed
-in any /VARIABLES subcommand.
+in any @subcmd{/VARIABLES} subcommand.
 The XPROD keyword requests cross-product deviations and covariance estimators to 
 be displayed for each pair of variables.
 The keyword ALL is the union of DESCRIPTIVES and XPROD.
@@ -361,7 +432,6 @@ CROSSTABS
         /MISSING=@{TABLE,INCLUDE,REPORT@}
         /WRITE=@{NONE,CELLS,ALL@}
         /FORMAT=@{TABLES,NOTABLES@}
-                @{LABELS,NOLABELS,NOVALLABS@}
                 @{PIVOT,NOPIVOT@}
                 @{AVALUE,DVALUE@}
                 @{NOINDEX,INDEX@}
@@ -380,27 +450,27 @@ tables requested by the user.  It can calculate several statistics for
 each cell in the crosstabulation tables.  In addition, a number of
 statistics can be calculated for each table itself.
 
-The TABLES subcommand is used to specify the tables to be reported.  Any
+The @subcmd{TABLES} subcommand is used to specify the tables to be reported.  Any
 number of dimensions is permitted, and any number of variables per
-dimension is allowed.  The TABLES subcommand may be repeated as many
+dimension is allowed.  The @subcmd{TABLES} subcommand may be repeated as many
 times as needed.  This is the only required subcommand in @dfn{general
 mode}.  
 
 Occasionally, one may want to invoke a special mode called @dfn{integer
-mode}.  Normally, in general mode, PSPP automatically determines
+mode}.  Normally, in general mode, @pspp{} automatically determines
 what values occur in the data.  In integer mode, the user specifies the
 range of values that the data assumes.  To invoke this mode, specify the
-VARIABLES subcommand, giving a range of data values in parentheses for
-each variable to be used on the TABLES subcommand.  Data values inside
+@subcmd{VARIABLES} subcommand, giving a range of data values in parentheses for
+each variable to be used on the @subcmd{TABLES} subcommand.  Data values inside
 the range are truncated to the nearest integer, then assigned to that
 value.  If values occur outside this range, they are discarded.  When it
-is present, the VARIABLES subcommand must precede the TABLES
+is present, the @subcmd{VARIABLES} subcommand must precede the @subcmd{TABLES}
 subcommand.
 
 In general mode, numeric and string variables may be specified on
 TABLES.  In integer mode, only numeric variables are allowed.
 
-The MISSING subcommand determines the handling of user-missing values.
+The @subcmd{MISSING} subcommand determines the handling of user-missing values.
 When set to TABLE, the default, missing values are dropped on a table by
 table basis.  When set to INCLUDE, user-missing values are included in
 tables and statistics.  When set to REPORT, which is allowed only in
@@ -408,24 +478,19 @@ integer mode, user-missing values are included in tables but marked with
 an @samp{M} (for ``missing'') and excluded from statistical
 calculations.
 
-Currently the WRITE subcommand is ignored.
+Currently the @subcmd{WRITE} subcommand is ignored.
 
-The FORMAT subcommand controls the characteristics of the
+The @subcmd{FORMAT} subcommand controls the characteristics of the
 crosstabulation tables to be displayed.  It has a number of possible
 settings:
 
-@itemize @bullet
+@itemize @subcmd{}
 @item
 TABLES, the default, causes crosstabulation tables to be output.
 NOTABLES suppresses them.
 
 @item
-LABELS, the default, allows variable labels and value labels to appear
-in the output.  NOLABELS suppresses them.  NOVALLABS displays variable
-labels but suppresses value labels.
-
-@item
-PIVOT, the default, causes each TABLES subcommand to be displayed in a
+PIVOT, the default, causes each @subcmd{TABLES} subcommand to be displayed in a
 pivot table format.  NOPIVOT causes the old-style crosstabulation format
 to be used.
 
@@ -440,7 +505,7 @@ INDEX/NOINDEX is currently ignored.
 BOX/NOBOX is currently ignored.
 @end itemize
 
-The CELLS subcommand controls the contents of each cell in the displayed
+The @subcmd{CELLS} subcommand controls the contents of each cell in the displayed
 crosstabulation table.  The possible settings are:
 
 @table @asis
@@ -470,7 +535,7 @@ Suppress cells entirely.
 COLUMN, and TOTAL.  If CELLS is not specified at all then only COUNT
 will be selected.
 
-The STATISTICS subcommand selects statistics for computation:
+The @subcmd{STATISTICS} subcommand selects statistics for computation:
 
 @table @asis
 @item CHISQ
@@ -514,7 +579,7 @@ statistic.  Certain statistics require tables of a particular size, and
 some statistics are calculated only in integer mode.
 
 @samp{/STATISTICS} without any settings selects CHISQ.  If the
-STATISTICS subcommand is not given, no statistics are calculated.
+@subcmd{STATISTICS} subcommand is not given, no statistics are calculated.
 
 @strong{Please note:} Currently the implementation of CROSSTABS has the
 followings bugs:
@@ -570,23 +635,23 @@ FACTOR  VARIABLES=var_list
 The FACTOR command performs Factor Analysis or Principal Axis Factoring on a dataset.  It may be used to find
 common factors in the data or for data reduction purposes.
 
-The VARIABLES subcommand is required.  It lists the variables which are to partake in the analysis.
+The @subcmd{VARIABLES} subcommand is required.  It lists the variables which are to partake in the analysis.
 
-The /EXTRACTION subcommand is used to specify the way in which factors (components) are extracted from the data.
+The @subcmd{/EXTRACTION} subcommand is used to specify the way in which factors (components) are extracted from the data.
 If PC is specified, then Principal Components Analysis is used.  If PAF is specified, then Principal Axis Factoring is
 used. By default Principal Components Analysis will be used.
 
-The /ROTATION subcommand is used to specify the method by which the extracted solution will be rotated.
+The @subcmd{/ROTATION} subcommand is used to specify the method by which the extracted solution will be rotated.
 Three methods are available: VARIMAX (which is the default), EQUAMAX, and QUARTIMAX.
 If don't want any rotation to be performed, the word NOROTATE will prevent the command from performing any
 rotation on the data. Oblique rotations are not supported.
 
-The /METHOD subcommand should be used to determine whether the covariance matrix or the correlation matrix of the data is
+The @subcmd{/METHOD} subcommand should be used to determine whether the covariance matrix or the correlation matrix of the data is
 to be analysed.  By default, the correlation matrix is analysed.
 
-The /PRINT subcommand may be used to select which features of the analysis are reported:
+The @subcmd{/PRINT} subcommand may be used to select which features of the analysis are reported:
 
-@itemize
+@itemize @subcmd{}
 @item UNIVARIATE
       A table of mean values, standard deviations and total weights are printed.
 @item INITIAL
@@ -611,15 +676,15 @@ The /PRINT subcommand may be used to select which features of the analysis are r
       Identical to INITIAL and EXTRACTION.
 @end itemize
 
-If /PLOT=EIGEN is given, then a ``Scree'' plot of the eigenvalues will be printed.  This can be useful for visualising
+If /PLOT=EIGEN is given, then a ``Scree'' plot of the eigenvalues will be printed.  This can be useful for visualizing
 which factors (components) should be retained.
 
-The /FORMAT subcommand determined how data are to be displayed in loading matrices.  If SORT is specified, then the variables
+The @subcmd{/FORMAT} subcommand determined how data are to be displayed in loading matrices.  If SORT is specified, then the variables
 are sorted in descending order of significance.  If BLANK(@var{n}) is specified, then coefficients whose absolute value is less
-than @var{n} will not be printed.  If the keyword DEFAULT is given, or if no /FORMAT subcommand is given, then no sorting is 
+than @var{n} will not be printed.  If the keyword DEFAULT is given, or if no @subcmd{/FORMAT} subcommand is given, then no sorting is 
 performed, and all coefficients will be printed.
 
-The /CRITERIA subcommand is used to specify how the number of extracted factors (components) are chosen.  If FACTORS(@var{n}) is
+The @subcmd{/CRITERIA} subcommand is used to specify how the number of extracted factors (components) are chosen.  If FACTORS(@var{n}) is
 specified, where @var{n} is an integer, then @var{n} factors will be extracted.  Otherwise, the MINEIGEN setting will
 be used.  MINEIGEN(@var{l}) requests that all factors whose eigenvalues are greater than or equal to @var{l} are extracted.
 The default value of @var{l} is 1.    The ECONVERGE and ITERATE settings have effect only when iterative algorithms for factor
@@ -634,13 +699,151 @@ calculations, but system-missing values are not.
 If EXCLUDE is set, which is the default, user-missing
 values are excluded as well as system-missing values. 
 This is the default.
-If LISTWISE is set, then the entire case is excluded from analysis
+If @subcmd{LISTWISE} is set, then the entire case is excluded from analysis
 whenever any variable  specified in the @cmd{VARIABLES} subcommand
 contains a missing value.   
-If PAIRWISE is set, then a case is considered missing only if either of the
+If @subcmd{PAIRWISE} is set, then a case is considered missing only if either of the
 values  for the particular coefficient are missing.
-The default is LISTWISE.
+The default is @subcmd{LISTWISE}.
+
+@node MEANS
+@section MEANS
+
+@vindex MEANS
+@cindex means
+
+@display 
+MEANS [TABLES =] 
+      @{varlist@} 
+        [ BY @{varlist@} [BY @{varlist@} [BY @{varlist@} @dots{} ]]]
+
+      [ /@{varlist@} 
+         [ BY @{varlist@} [BY @{varlist@} [BY @{varlist@} @dots{} ]]] ]
+
+      [/CELLS = [MEAN] [COUNT] [STDDEV] [SEMEAN] [SUM] [MIN] [MAX] [RANGE]
+        [VARIANCE] [KURT] [SEKURT] 
+        [SKEW] [SESKEW] [FIRST] [LAST] 
+        [HARMONIC] [GEOMETRIC] 
+        [DEFAULT]
+        [ALL]
+        [NONE] ]
+
+      [/MISSING = [TABLE] [INCLUDE] [DEPENDENT]]
+@end display 
+
+You can use the @cmd{MEANS} command to calculate the arithmetic mean and similar
+statistics, either for the dataset as a whole or for categories of data.
+
+The simplest form of the command is
+@example
+MEANS @var{v}.
+@end example
+@noindent which calculates the mean, count and standard deviation for @var{v}.
+If you specify a grouping variable, for example
+@example
+MEANS @var{v} BY @var{g}.
+@end example
+@noindent then the means, counts and standard deviations for @var{v} after having
+been grouped by @var{g} will be calculated.
+Instead of the mean, count and standard deviation, you could specify the statistics
+in which you are interested:
+@example
+MEANS @var{x} @var{y} BY @var{g}
+      /CELLS = HARMONIC SUM MIN.
+@end example
+This example calculates the harmonic mean, the sum and the minimum values of @var{x} and @var{y}
+grouped by @var{g}.
+
+The @subcmd{CELLS} subcommand specifies which statistics to calculate.  The available statistics
+are:
+@itemize
+@item MEAN
+@cindex arithmetic mean
+      The arithmetic mean.
+@item COUNT
+      The count of the values.
+@item STDDEV
+      The standard deviation.
+@item SEMEAN
+      The standard error of the mean.
+@item SUM
+      The sum of the values.
+@item MIN
+      The minimum value.
+@item MAX
+      The maximum value.
+@item RANGE
+      The difference between the maximum and minimum values.
+@item VARIANCE
+      The variance.
+@item FIRST
+      The first value in the category.
+@item LAST
+      The last value in the category.
+@item SKEW
+      The skewness.
+@item SESKEW
+      The standard error of the skewness.
+@item KURT
+      The kurtosis
+@item SEKURT
+      The standard error of the kurtosis.
+@item HARMONIC
+@cindex harmonic mean
+      The harmonic mean.
+@item GEOMETRIC
+@cindex geometric mean
+      The geometric mean.
+@end itemize
+
+In addition, three special keywords are recognized:
+@itemize
+@item DEFAULT
+      This is the same as MEAN COUNT STDDEV
+@item ALL
+      All of the above statistics will be calculated.
+@item NONE
+      No statistics will be calculated (only a summary will be shown).
+@end itemize
+
+
+More than one @dfn{table} can be specified in a single command. 
+Each table is separated by a @samp{/}. For
+example
+@example
+MEANS TABLES =
+      @var{c} @var{d} @var{e} BY @var{x}
+      /@var{a} @var{b} BY @var{x} @var{y}
+      /@var{f} BY @var{y} BY @var{z}.
+@end example
+has three tables (the @samp{TABLE =} is optional).
+The first table has three dependent variables @var{c}, @var{d} and @var{e}
+and a single categorical variable @var{x}.
+The second table has two dependent variables @var{a} and @var{b}, 
+and two categorical variables @var{x} and @var{y}.
+The third table has a single dependent variables @var{f}
+and a categorical variable formed by the combination of @var{y} and @var{z}.
+
+
+By default values are omitted from the analysis only if missing values
+(either system missing or user missing)
+for any of the variables directly involved in their calculation are 
+encountered.
+This behaviour can be modified with the  @subcmd{/MISSING} subcommand.
+Three options are possible: TABLE, INCLUDE and DEPENDENT.
+
+/MISSING = TABLE causes cases to be dropped if any variable is missing 
+in the table specification currently being processed, regardless of 
+whether it is needed to calculate the statistic.
+
+/MISSING = INCLUDE says that user missing values, either in the dependent
+variables or in the categorical variables should be taken at their face
+value, and not excluded.
+
+/MISSING = DEPENDENT says that user missing values, in the dependent
+variables should be taken at their face value, however cases which 
+have user missing values for the categorical variables should be omitted 
+from the calculation.
 
 @node NPAR TESTS
 @section NPAR TESTS
@@ -667,7 +870,7 @@ NPAR TESTS performs nonparametric tests.
 Non parametric tests make very few assumptions about the distribution of the 
 data.
 One or more tests may be specified by using the corresponding subcommand.
-If the /STATISTICS subcommand is also specified, then summary statistics are 
+If the @subcmd{/STATISTICS} subcommand is also specified, then summary statistics are 
 produces for each variable that is the subject of any test.
 
 Certain tests may take a long time to execute, if an exact figure is required.
@@ -707,7 +910,7 @@ is used.
      [ /BINOMIAL[(p)]=var_list[(value1[, value2)] ] ]
 @end display 
 
-The /BINOMIAL subcommand compares the observed distribution of a dichotomous 
+The @subcmd{/BINOMIAL} subcommand compares the observed distribution of a dichotomous 
 variable with that of a binomial distribution.
 The variable @var{p} specifies the test proportion of the binomial 
 distribution.  
@@ -740,7 +943,7 @@ significance of observing the observed proportion or less is reported.
 That is to say, the test is always performed in the observed
 direction. 
 
-PSPP uses a very precise approximation to the gamma function to
+@pspp{} uses a very precise approximation to the gamma function to
 compute the binomial significance.  Thus, exact results are reported
 even for very large sample sizes.
 
@@ -757,13 +960,13 @@ even for very large sample sizes.
 @end display 
 
 
-The /CHISQUARE subcommand produces a chi-square statistic for the differences 
+The @subcmd{/CHISQUARE} subcommand produces a chi-square statistic for the differences 
 between the expected and observed frequencies of the categories of a variable. 
 Optionally, a range of values may appear after the variable list.  
 If a range is given, then non integer values are truncated, and values
 outside the  specified range are excluded from the analysis.
 
-The /EXPECTED subcommand specifies the expected values of each
+The @subcmd{/EXPECTED} subcommand specifies the expected values of each
 category.  
 There must be exactly one non-zero expected value, for each observed
 category, or the EQUAL keywork must be specified.
@@ -771,7 +974,7 @@ You may use the notation @var{n}*@var{f} to specify @var{n}
 consecutive expected categories all taking a frequency of @var{f}.
 The frequencies given are proportions, not absolute frequencies.  The
 sum of the frequencies need not be 1.
-If no /EXPECTED subcommand is given, then then equal frequencies 
+If no @subcmd{/EXPECTED} subcommand is given, then then equal frequencies 
 are expected.
 
 
@@ -847,7 +1050,7 @@ they follow a normal distribution with a mean of 3.5 and a standard deviation of
   NPAR TESTS
         /KOLMOGOROV-SMIRNOV (normal 3.5 2.0) = @var{score} @var{age}.
 @end example
-If the variables need to be tested against different distributions, then a seperate
+If the variables need to be tested against different distributions, then a separate
 subcommand must be used.  For example the following syntax tests @var{score} against
 a normal distribution with mean of 3.5 and standard deviation of 2.0 whilst @var{age}
 is tested against a normal distribution of mean 40 and standard deviation 1.5.
@@ -945,7 +1148,7 @@ The median test is used to test whether independent samples come from
 populations with a common median.
 The median of the populations against which the samples are to be tested
 may be given in parentheses immediately after the 
-/MEDIAN subcommand.  If it is not given, the median will be imputed from the 
+@subcmd{/MEDIAN} subcommand.  If it is not given, the median will be imputed from the 
 union of all the samples.
 
 The variables of the samples to be tested should immediately follow the @samp{=} sign. The
@@ -966,11 +1169,11 @@ range [@var{value1},@var{value2}].
      [ /RUNS (@{MEAN, MEDIAN, MODE, value@})  = varlist ]
 @end display
 
-The /RUNS subcommand tests whether a data sequence is randomly ordered.
+The @subcmd{/RUNS} subcommand tests whether a data sequence is randomly ordered.
 
 It works by examining the number of times a variable's value crosses a given threshold. 
 The desired threshold must be specified within parentheses.
-It may either be specified as a number or as one of MEAN, MEDIAN or MODE.
+It may either be specified as a number or as one of @subcmd{MEAN}, @subcmd{MEDIAN} or @subcmd{MODE}.
 Following the threshold specification comes the list of variables whose values are to be
 tested.
 
@@ -986,7 +1189,7 @@ length of the data.
      [ /SIGN varlist [ WITH varlist [ (PAIRED) ]]]
 @end display
 
-The /SIGN subcommand tests for differences between medians of the 
+The @subcmd{/SIGN} subcommand tests for differences between medians of the 
 variables listed.
 The test does not make any assumptions about the
 distribution of the data.
@@ -1013,7 +1216,7 @@ of variable preceding @code{WITH} against variable following
      [ /WILCOXON varlist [ WITH varlist [ (PAIRED) ]]]
 @end display
 
-The /WILCOXON subcommand tests for differences between medians of the 
+The @subcmd{/WILCOXON} subcommand tests for differences between medians of the 
 variables listed.
 The test does not make any assumptions about the variances of the samples.
 It does however assume that the distribution is symetrical.
@@ -1071,7 +1274,7 @@ It operates in one of three modes:
 Each of these modes are described in more detail below.
 There are two optional subcommands which are common to all modes.
 
-The @cmd{/CRITERIA} subcommand tells PSPP the confidence interval used
+The @cmd{/CRITERIA} subcommand tells @pspp{} the confidence interval used
 in the tests.  The default value is 0.95.
 
 
@@ -1091,7 +1294,7 @@ which they would be needed. This is the default.
 
 
 @menu
-* One Sample Mode::             Testing against a hypothesised mean
+* One Sample Mode::             Testing against a hypothesized mean
 * Independent Samples Mode::    Testing two independent groups for equal mean
 * Paired Samples Mode::         Testing two interdependent groups for equal mean
 @end menu
@@ -1100,25 +1303,25 @@ which they would be needed. This is the default.
 @subsection One Sample Mode
 
 The @cmd{TESTVAL} subcommand invokes the One Sample mode.
-This mode is used to test a population mean against a hypothesised
+This mode is used to test a population mean against a hypothesized
 mean. 
 The value given to the @cmd{TESTVAL} subcommand is the value against
 which you wish to test.
 In this mode, you must also use the @cmd{/VARIABLES} subcommand to
-tell PSPP which variables you wish to test.
+tell @pspp{} which variables you wish to test.
 
 @node Independent Samples Mode
 @comment  node-name,  next,  previous,  up
 @subsection Independent Samples Mode
 
-The @cmd{GROUPS} subcommand invokes Independent Samples mode or
+The @subcmd{GROUPS} subcommand invokes Independent Samples mode or
 `Groups' mode. 
 This mode is used to test whether two groups of values have the
 same population mean.
-In this mode, you must also use the @cmd{/VARIABLES} subcommand to
-tell PSPP the dependent variables you wish to test.
+In this mode, you must also use the @subcmd{/VARIABLES} subcommand to
+tell @pspp{} the dependent variables you wish to test.
 
-The variable given in the @cmd{GROUPS} subcommand is the independent
+The variable given in the @subcmd{GROUPS} subcommand is the independent
 variable which determines to which group the samples belong.
 The values in parentheses are the specific values of the independent
 variable for each group.
@@ -1130,9 +1333,9 @@ it is acceptable to specify only one value inside the parentheses.
 If you do this, cases where the independent variable is
 greater than or equal to this value belong to the first group, and cases
 less than this value belong to the second group.
-When using this form of the @cmd{GROUPS} subcommand, missing values in
+When using this form of the @subcmd{GROUPS} subcommand, missing values in
 the independent variable are excluded on a listwise basis, regardless
-of whether @cmd{/MISSING=LISTWISE} was specified.
+of whether @subcmd{/MISSING=LISTWISE} was specified.
 
 
 @node Paired Samples Mode
@@ -1183,7 +1386,7 @@ subcommand.
 The list of variables must be followed by the @code{BY} keyword and
 the name of the independent (or factor) variable.
 
-You can use the @code{STATISTICS} subcommand to tell PSPP to display
+You can use the @code{STATISTICS} subcommand to tell @pspp{} to display
 ancilliary information.  The options accepted are:
 @itemize
 @item DESCRIPTIVES
@@ -1200,14 +1403,14 @@ The subcommand must be followed by a list of numerals which are the
 coefficients of the groups to be tested.
 The number of coefficients must correspond to the number of distinct
 groups (or values of the independent variable).
-If the total sum of the coefficients are not zero, then PSPP will
+If the total sum of the coefficients are not zero, then @pspp{} will
 display a warning, but will proceed with the analysis.
 The @code{CONTRAST} subcommand may be given up to 10 times in order
 to specify different contrast tests.
-The @code{MISSING} subcommand defines how missing values are handled.
-If LISTWISE is specified then cases which have missing values for 
+The @subcmd{MISSING} subcommand defines how missing values are handled.
+If @subcmd{LISTWISE} is specified then cases which have missing values for 
 the independent variable or any dependent variable will be ignored.
-If ANALYSIS is specified, then cases will be ignored if the independent
+If @subcmd{ANALYSIS} is specified, then cases will be ignored if the independent
 variable is missing or if the dependent variable currently being 
 analysed is missing.  The default is ANALYSIS.
 A setting of EXCLUDE means that variables whose values are
@@ -1306,7 +1509,7 @@ RANK
 The @cmd{RANK} command ranks variables and stores the results into new
 variables. 
 
-The VARIABLES subcommand, which is mandatory, specifies one or
+The @subcmd{VARIABLES} subcommand, which is mandatory, specifies one or
 more variables whose values are to be ranked.  
 After each variable, @samp{A} or @samp{D} may appear, indicating that
 the variable is to be ranked in ascending or descending order.
@@ -1316,28 +1519,28 @@ which are to serve as group variables.
 In this case, the cases are gathered into groups, and ranks calculated
 for each group.
 
-The TIES subcommand specifies how tied values are to be treated.  The
+The @subcmd{TIES} subcommand specifies how tied values are to be treated.  The
 default is to take the mean value of all the tied cases.
 
-The FRACTION subcommand specifies how proportional ranks are to be
+The @subcmd{FRACTION} subcommand specifies how proportional ranks are to be
 calculated.  This only has any effect if NORMAL or PROPORTIONAL rank
 functions are requested.
 
-The PRINT subcommand may be used to specify that a summary of the rank
+The @subcmd{PRINT} subcommand may be used to specify that a summary of the rank
 variables created should appear in the output.
 
 The function subcommands are RANK, NTILES, NORMAL, PERCENT, RFRACTION,
 PROPORTION and SAVAGE.  Any number of function subcommands may appear.
 If none are given, then the default is RANK.
-The NTILES subcommand must take an integer specifying the number of
+The @subcmd{NTILES} subcommand must take an integer specifying the number of
 partitions into which values should be ranked.
 Each subcommand may be followed by the INTO keyword and a list of
 variables which are the variables to be created and receive the rank
 scores.  There may be as many variables specified as there are
-variables named on the VARIABLES subcommand.  If fewer are specified,
+variables named on the @subcmd{VARIABLES} subcommand.  If fewer are specified,
 then the variable names are automatically created.
 
-The MISSING subcommand determines how user missing values are to be
+The @subcmd{MISSING} subcommand determines how user missing values are to be
 treated. A setting of EXCLUDE means that variables whose values are
 user-missing are to be excluded from the rank scores. A setting of
 INCLUDE means they are to be included.  The default is EXCLUDE.
@@ -1359,18 +1562,18 @@ RELIABILITY
 @end display
 
 @cindex Cronbach's Alpha
-The @cmd{RELIABILTY} command performs reliablity analysis on the data.
+The @cmd{RELIABILTY} command performs reliability analysis on the data.
 
-The VARIABLES subcommand is required. It determines the set of variables 
+The @subcmd{VARIABLES} subcommand is required. It determines the set of variables 
 upon which analysis is to be performed.
 
-The SCALE subcommand determines which variables reliability is to be 
+The @subcmd{SCALE} subcommand determines which variables reliability is to be 
 calculated for.  If it is omitted, then analysis for all variables named
-in the VARIABLES subcommand will be used.
+in the @subcmd{VARIABLES} subcommand will be used.
 Optionally, the @var{name} parameter may be specified to set a string name 
 for the scale.
 
-The MODEL subcommand determines the type of analysis. If ALPHA is specified, 
+The @subcmd{MODEL} subcommand determines the type of analysis. If ALPHA is specified, 
 then Cronbach's Alpha is calculated for the scale.  If the model is SPLIT, 
 then the variables  are divided into 2 subsets.  An optional parameter 
 @var{N} may be given, to specify how many variables to be in the first subset.
@@ -1380,11 +1583,11 @@ The default model is ALPHA.
 
 By default, any cases with user missing, or system missing values for 
 any variables given 
-in the VARIABLES subcommand will be omitted from analysis.
-The MISSING subcommand determines whether user missing values are to 
+in the @subcmd{VARIABLES} subcommand will be omitted from analysis.
+The @subcmd{MISSING} subcommand determines whether user missing values are to 
 be included or excluded in the analysis.
 
-The SUMMARY subcommand determines the type of summary analysis to be performed.
+The @subcmd{SUMMARY} subcommand determines the type of summary analysis to be performed.
 Currently there is only one type: SUMMARY=TOTAL, which displays per-item
 analysis tested against the totals.
 
@@ -1394,7 +1597,7 @@ analysis tested against the totals.
 @section ROC
 
 @vindex ROC
-@cindex Receiver Operating Characterstic
+@cindex Receiver Operating Characteristic
 @cindex Area under curve
 
 @display
@@ -1431,14 +1634,14 @@ In addition, a p-value under the null hypothesis that the area under the curve e
 printed.
 The COORDINATES keyword says that a table of coordinates of the ROC curve should be printed.
 
-The CRITERIA subcommand has four optional parameters:
+The @subcmd{CRITERIA} subcommand has four optional parameters:
 @itemize @bullet
 @item The TESTPOS parameter may be LARGE or SMALL.
 LARGE is the default, and says that larger values in the predictor variables are to be 
 considered positive.  SMALL indicates that smaller values should be considered positive.
 
 @item The CI parameter specifies the confidence interval that should be printed.
-It has no effect if the SE keyword in the PRINT subcommand has not been given.
+It has no effect if the SE keyword in the @subcmd{PRINT} subcommand has not been given.
 
 @item The DISTRIBUTION parameter determines the method to be used when estimating the area
 under the curve.  
@@ -1452,11 +1655,9 @@ The default is FREE.
 @item The CUTOFF parameter is for compatibility and is ignored.
 @end itemize
 
-The MISSING subcommand determines whether user missing values are to 
+The @subcmd{MISSING} subcommand determines whether user missing values are to 
 be included or excluded in the analysis.  The default behaviour is to
 exclude them.
 Cases are excluded on a listwise basis; if any of the variables in @var{var_list} 
 or if the variable @var{state_var} is missing, then the entire case will be 
 excluded.
-
-