Fixed the handling of MISSING values in t-test
[pspp-builds.git] / doc / pspp.texi
index 531c4933be263109e25230b4c7c7e3af93f0ff13..cda0308fd0aa9c87012c6f88796098ab9325337e 100644 (file)
@@ -5806,6 +5806,11 @@ columns that the identifier will occupy, followed by an equals sign
 (@samp{=}) and the identifier variable name.  The variable must already
 have been declared with @cmd{NUMERIC} or another command.
 
+@cmd{REPEATING DATA} should be the last command given within an
+@cmd{INPUT PROGRAM}.  It should not be enclosed within a @cmd{LOOP}
+structure (@pxref{LOOP}).  Use @cmd{DATA LIST} before, not after,
+@cmd{REPEATING DATA}.
+
 @node WRITE,  , REPEATING DATA, Data Input and Output
 @section WRITE
 @vindex WRITE
@@ -6571,39 +6576,38 @@ Cases are divided into groups that have the same values for one or more
 variables called @dfn{break variables}.  Several functions are available
 for summarizing case contents.
 
-BREAK is the only required subcommand (in addition, at least one
-aggregation variable must be specified).  Specify a list of variable
-names.  The values of these variables are used to divide the active file
-into groups to be summarized.
+At least one break variable must be specified on BREAK, the only
+required subcommand.  The values of these variables are used to divide
+the active file into groups to be summarized.  In addition, at least
+one @var{dest_var} must be specified.
 
 By default, the active file is sorted based on the break variables
-before aggregation takes place.  If the active file is already sorted,
-specify PRESORTED to save time.
+before aggregation takes place.  If the active file is already sorted
+or otherwise grouped in terms of the break variables, specify
+PRESORTED to save time.
 
 The OUTFILE subcommand specifies a system file by file name string or
-file handle (@pxref{FILE HANDLE}).  The aggregated cases are sent to
+file handle (@pxref{FILE HANDLE}).  The aggregated cases are written to
 this file.  If OUTFILE is not specified, or if @samp{*} is specified,
 then the aggregated cases replace the active file.
 
-Normally the aggregate file does not receive the documents from the
-active file, even if the aggregate file replaces the active file.
-Specify DOCUMENT to have the documents from the active file copied to
-the aggregate file.
-
-At least one aggregation variable must be specified.  Specify a list of
-aggregation variables, an equals sign (@samp{=}), an aggregation
-function name (see the list below), and a list of source variables in
-parentheses.  In addition, some aggregation functions expect additional
-arguments in the parentheses following the source variable names.
+Specify DOCUMENT to copy the documents from the active file into the
+aggregate file (@pxref{DOCUMENT}).  Otherwise, the aggregate file will
+not contain any documents, even if the aggregate file replaces the
+active file.
 
-There must be exactly as many source variables as aggregation variables.
-Each aggregation variable receives the results of applying the specified
-aggregation function to the corresponding source variable.  Most
-aggregation functions may be applied to numeric and short and long
-string variables.  Others are restricted to numeric values; these are
-marked as such in this list below.
+One or more sets of aggregation variables must be specified.  Each set
+comprises a list of aggregation variables, an equals sign (@samp{=}),
+the name of an aggregation function (see the list below), and a list
+of source variables in parentheses.  Some aggregation functions expect
+additional arguments following the source variable names.
 
-Any number of sets of aggregation variables may be specified.
+Each set must have exactly as many source variables as aggregation
+variables.  Each aggregation variable receives the results of applying
+the specified aggregation function to the corresponding source
+variable.  Most aggregation functions may be applied to numeric and
+short and long string variables.  Others, marked below, are restricted
+to numeric values.
 
 The available aggregation functions are as follows:
 
@@ -6656,26 +6660,22 @@ First value in this group.
 Last value in this group.
 @end table
 
-When string values are compared by aggregation functions, they are done
-in terms of internal character codes.  On most modern computers, this is
-a form of ASCII.
+Aggregation functions compare string values in terms of internal
+character codes.  On most modern computers, this is a form of ASCII.
 
-In addition, there is a parallel set of aggregation functions having the
-same names as those above, but with a dot after the last character (for
-instance, @samp{SUM.}).  These functions are the same as the above,
-except that they cause user-missing values, which are normally excluded
-from calculations, to be included.
+The aggregation functions listed above exclude all user-missing values
+from calculations.  To include user-missing values, insert a period
+(@samp{.}) between the function name and left parenthesis
+(e.g.~@samp{SUM.}).
 
 Normally, only a single case (for SD and SD., two cases) need be
-non-missing in
-each group in order for the aggregate variable to be non-missing.  If
-/MISSING=COLUMNWISE is specified, the behavior reverses: that is, a
-single missing value is enough to make the aggregate variable become a
-missing value.
+non-missing in each group for the aggregate variable to be
+non-missing.  Specifying /MISSING=COLUMNWISE inverts this behavior, so
+that the aggregate variable becomes missing if any aggregated value is
+missing.
 
-@cmd{AGGREGATE} ignores the current @cmd{SPLIT FILE} settings and causes
-them to be
-canceled (@pxref{SPLIT FILE}).  
+@cmd{AGGREGATE} both ignores and cancels the current @cmd{SPLIT FILE}
+settings (@pxref{SPLIT FILE}).
 
 @node AUTORECODE, COMPUTE, AGGREGATE, Data Manipulation
 @section AUTORECODE
@@ -6858,6 +6858,9 @@ FLIP /VARIABLES=var_list /NEWNAMES=var_name.
 @cmd{FLIP} transposes rows and columns in the active file.  It
 causes cases to be swapped with variables, and vice versa.
 
+All variables in the transposed active file are numeric.  String
+variables take on the system-missing value in the transposed file.
+
 No subcommands are required.  The VARIABLES subcommand specifies
 variables that will be transformed into cases.  Variables not specified
 are discarded.  By default, all variables are selected for
@@ -7475,11 +7478,13 @@ far.
 * DESCRIPTIVES::                Descriptive statistics.
 * FREQUENCIES::                 Frequency tables.
 * CROSSTABS::                   Crosstabulation tables.
+* T-TEST::                      Test Hypotheses about means.
 @end menu
 
 @node DESCRIPTIVES, FREQUENCIES, Statistics, Statistics
 @section DESCRIPTIVES
 
+@vindex DESCRIPTIVES
 @display
 DESCRIPTIVES
         /VARIABLES=var_list
@@ -7569,6 +7574,7 @@ respectively.
 @node FREQUENCIES, CROSSTABS, DESCRIPTIVES, Statistics
 @section FREQUENCIES
 
+@vindex FREQUENCIES
 @display
 FREQUENCIES
         /VARIABLES=var_list
@@ -7668,9 +7674,10 @@ NTILES causes the specified quartiles to be reported.  For instance,
 @code{/NTILES=4} would cause quartiles to be reported.  In addition,
 particular percentiles can be requested with the PERCENTILES subcommand.
 
-@node CROSSTABS,  , FREQUENCIES, Statistics
+@node CROSSTABS, T-TEST, FREQUENCIES, Statistics
 @section CROSSTABS
 
+@vindex CROSSTABS
 @display
 CROSSTABS
         /TABLES=var_list BY var_list [BY var_list]@dots{}
@@ -7700,17 +7707,23 @@ The 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
 times as needed.  This is the only required subcommand in @dfn{general
-mode}.
+mode}.  
 
 Occasionally, one may want to invoke a special mode called @dfn{integer
-mode}.  Normally, in general mode, PSPP will automatically determine
+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
 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 subcommand.
+is present, the VARIABLES subcommand must precede the TABLES
+subcommand.
+
+In general mode, numeric and string variables may be specified on
+TABLES.  Although long string variables are allowed, only their
+initial short-string parts are used.  In integer mode, only numeric
+variables are allowed.
 
 The MISSING subcommand determines the handling of user-missing values.
 When set to TABLE, the default, missing values are dropped on a table by
@@ -7720,7 +7733,7 @@ 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 not used.
+Currently the WRITE subcommand is ignored.
 
 The FORMAT subcommand controls the characteristics of the
 crosstabulation tables to be displayed.  It has a number of possible
@@ -7847,6 +7860,133 @@ Approximate T of uncertainty coefficient is wrong.
 
 Fixes for any of these deficiencies would be welcomed.
 
+@node T-TEST, , CROSSTABS, Statistics
+@comment  node-name,  next,  previous,  up
+@section T-TEST
+
+@vindex T-TEST
+@display
+T-TEST
+        /MISSING=@{ANALYSIS,LISTWISE@} @{EXCLUDE,INCLUDE@}
+        /CRITERIA=CIN(confidence)
+
+
+(One Sample mode.)
+        TESTVAL=test_value
+        /VARIABLES=var_list
+
+
+(Independent Samples mode.)
+        GROUPS=var(value1 [, value2])
+        /VARIABLES=var_list
+
+
+(Paired Samples mode.)
+        PAIRS=var_list [WITH var_list [(PAIRED)] ]
+
+@end display
+
+
+The @cmd{T-TEST} procedure outputs tables used in testing hypotheses about 
+means.  
+It operates in one of three modes:
+@itemize
+@item One Sample mode.
+@item Independent Groups mode.
+@item Paired mode.
+@end itemize
+
+@noindent
+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
+in the tests.  The default value is 0.95.
+
+
+The @cmd{MISSING} subcommand determines the handling of missing
+variables.  
+If INCLUDE is set, then user-missing values are included in the
+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
+whenever any variable  specified in the @cmd{/VARIABLES}, @cmd{/PAIRS} or 
+@cmd{/GROUPS} subcommands contains a missing value.   
+If ANALYSIS is set, then missing values are excluded only in the analysis for
+which they would be needed. This is the default.
+
+
+@menu
+* One Sample Mode::              Testing against a hypothesised mean
+* Independent Samples Mode::     Testing two independent groups for the same mean
+* Paired Samples Mode::          Testing two interdependet groups for the same mean
+@end menu
+
+@node One Sample Mode, Independent Samples Mode, T-TEST, T-TEST
+@comment  node-name,  next,  previous,  up
+
+@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
+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.
+
+@node Independent Samples Mode, Paired Samples Mode, One Sample Mode, T-TEST
+@comment  node-name,  next,  previous,  up
+@subsection Independent Samples Mode
+
+The @cmd{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.
+
+The variable given in the @cmd{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.
+If the parentheses are omitted and no values are given, the default values 
+of 1.0 and 2.0 are assumed.
+
+If the independent variable is numeric, 
+it is acceptable to specify only one value inside the parentheses.
+If you do this, cases where the independent variable is
+less than  or equal to this value belong to the first group, and cases
+greater than this value belong to the second group.
+When using this form of the @cmd{GROUPS} subcommand, missing values in
+the independent variable are excluded on a listwise basis, regardless
+of whether @cmd{/MISSING=LISTWISE} was specified.
+
+
+@node Paired Samples Mode, , Independent Samples Mode, T-TEST
+@comment  node-name,  next,  previous,  up
+@subsection Paired Samples Mode
+
+The @cmd{PAIRS} subcommand introduces Paired Samples mode.
+Use this mode when repeated measures have been taken from the same
+samples.
+If the the @code{WITH} keyword is omitted, then tables for all
+combinations of variables given in the @cmd{PAIRS} subcommand are
+generated. 
+If the @code{WITH} keyword is given, and the @code{(PAIRED)} keyword
+is also given, then the number of variables preceding @code{WITH}
+must be the same as the number following it.
+In this case, tables for each respective pair of variables are
+generated.
+In the event that the @code{WITH} keyword is given, but the
+@code{(PAIRED)} keyword is omitted, then tables for each combination
+of variable preceding @code{WITH} against variable following
+@code{WITH} are generated.
+
+
 @node Utilities, Not Implemented, Statistics, Top
 @chapter Utilities
 
@@ -7863,9 +8003,11 @@ encountered in the input.
 * DISPLAY DOCUMENTS::           Display active file documents.
 * DISPLAY FILE LABEL::          Display the active file label.
 * DROP DOCUMENTS::              Remove documents from the active file.
+* ERASE::                       Erase a file.
 * EXECUTE::                     Execute pending transformations.
 * FILE LABEL::                  Set the active file's label.
 * FINISH::                      Terminate the PSPP session.
+* HOST::                        Temporarily return to the operating system.
 * INCLUDE::                     Include a file within the current one.
 * QUIT::                        Terminate the PSPP session.
 * SET::                         Adjust PSPP runtime parameters.
@@ -7933,7 +8075,7 @@ DISPLAY FILE LABEL.
 active file,
 if any.  @xref{FILE LABEL}.
 
-@node DROP DOCUMENTS, EXECUTE, DISPLAY FILE LABEL, Utilities
+@node DROP DOCUMENTS, ERASE, DISPLAY FILE LABEL, Utilities
 @section DROP DOCUMENTS
 @vindex DROP DOCUMENTS
 
@@ -7947,7 +8089,22 @@ New documents can be added with @cmd{DOCUMENT} (@pxref{DOCUMENT}).
 @cmd{DROP DOCUMENTS} changes only the active file.  It does not modify any
 system files stored on disk.
 
-@node EXECUTE, FILE LABEL, DROP DOCUMENTS, Utilities
+
+@node ERASE, EXECUTE, DROP DOCUMENTS, Utilities
+@comment  node-name,  next,  previous,  up
+@section ERASE
+@vindex ERASE
+
+@display
+ERASE FILE file_name.
+@end display
+
+@cmd{ERASE FILE} deletes a file from the local filesystem.
+file_name must be quoted.
+This command cannot be used if the SAFER setting is active.
+
+
+@node EXECUTE, FILE LABEL, ERASE, Utilities
 @section EXECUTE
 @vindex EXECUTE
 
@@ -7973,7 +8130,7 @@ created during this PSPP run.
 file_label need not be quoted.  If quotes are
 included, they become part of the file label.
 
-@node FINISH, INCLUDE, FILE LABEL, Utilities
+@node FINISH, HOST, FILE LABEL, Utilities
 @section FINISH
 @vindex FINISH
 
@@ -7986,7 +8143,21 @@ control to the operating system.
 
 This command is not valid in interactive mode.
 
-@node INCLUDE, QUIT, FINISH, Utilities
+@node HOST, INCLUDE, FINISH, Utilities
+@comment  node-name,  next,  previous,  up
+@section HOST
+@vindex HOST
+
+@display
+HOST.
+@end display
+
+@cmd{HOST} suspends the current PSPP session and temporarily returns control 
+to the operating system.
+This command cannot be used if the SAFER setting is active.
+
+
+@node INCLUDE, QUIT, HOST, Utilities
 @section INCLUDE
 @vindex INCLUDE
 @vindex @@