Implemented the SHOW command and massaged the SET command to fit
[pspp-builds.git] / doc / pspp.texi
index c0efc83f13d846c81565d74518366d43a81dee65..31ad84b75c03ef6a7f76ae0c5fa1ae1d25faee0b 100644 (file)
@@ -4757,6 +4757,7 @@ results.
 @cindex cross-case function
 @cindex function, cross-case
 @deftypefn {Function} {} LAG (@var{variable})
+@anchor{LAG}
 @var{variable} must be a numeric or string variable name.  @code{LAG}
 results in the value of that variable for the case before the current
 one.  In case-selection procedures, @code{LAG} results in the value of
@@ -5806,6 +5807,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
@@ -6016,7 +6022,7 @@ including the active file.  Records with the same values for BY
 variables are combined into a single record.  Records with different
 values are output in order.  Thus, multiple sorted system files are
 combined into a single sorted system file based on the value of the BY
-variables.
+variables.  The results of the merge become the new active file.
 
 The BY subcommand specifies a list of variables that are used to match
 records from each of the system files.  Variables specified must exist
@@ -6049,6 +6055,9 @@ string variables.
 
 IN, FIRST, LAST, and MAP are currently not used.
 
+@cmd{MATCH FILES} may not be specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}) if the active file is used as an input source.
+
 @node SAVE, SYSFILE INFO, MATCH FILES, System and Portable Files
 @section SAVE
 @vindex SAVE
@@ -6377,6 +6386,9 @@ MAP is currently ignored.
 If either DROP or KEEP is specified, the data is read; otherwise it is
 not.
 
+@cmd{MODIFY VARS} may not be specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}).
+
 @node NUMERIC, PRINT FORMATS, MODIFY VARS, Variable Attributes
 @section NUMERIC
 @vindex NUMERIC
@@ -6428,6 +6440,9 @@ name.  Multiple parenthesized groups of variables may be specified.
 @cmd{RENAME VARIABLES} takes effect immediately.  It does not cause the data
 to be read.
 
+@cmd{RENAME VARIABLES} may not be specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}).
+
 @node VALUE LABELS, STRING, RENAME VARIABLES, Variable Attributes
 @section VALUE LABELS
 @vindex VALUE LABELS
@@ -6735,9 +6750,13 @@ Using @cmd{COMPUTE} to assign to a variable specified on @cmd{LEAVE}
 (@pxref{LEAVE}) resets the variable's left state.  Therefore,
 @code{LEAVE} should be specified following @cmd{COMPUTE}, not before.
 
-COMPUTE is a transformation.  It does not cause the active file to be
+@cmd{COMPUTE} is a transformation.  It does not cause the active file to be
 read.
 
+When @cmd{COMPUTE} is specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}), the @cmd{LAG} function may not be used
+(@pxref{LAG}).
+
 @node COUNT, FLIP, COMPUTE, Data Manipulation
 @section COUNT
 @vindex COUNT
@@ -6853,6 +6872,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
@@ -6879,6 +6901,9 @@ the active file is subsequently transposed using @cmd{FLIP}, this
 variable can
 be used to recreate the original variable names.
 
+FLIP honors N OF CASES.  It ignores TEMPORARY, so that ``temporary''
+transformations become permanent.
+
 @node IF, RECODE, FLIP, Data Manipulation
 @section IF
 @vindex IF
@@ -6913,6 +6938,10 @@ Using @cmd{IF} to assign to a variable specified on @cmd{LEAVE}
 (@pxref{LEAVE}) resets the variable's left state.  Therefore,
 @code{LEAVE} should be specified following @cmd{IF}, not before.
 
+When @cmd{IF} is specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}), the @cmd{LAG} function may not be used
+(@pxref{LAG}).
+
 @node RECODE, SORT CASES, IF, Data Manipulation
 @section RECODE
 @vindex RECODE
@@ -7002,13 +7031,9 @@ preceding them.
 
 @cmd{SORT CASES} attempts to sort the entire active file in main memory.
 If main memory is exhausted, it falls back to a merge sort algorithm that
-involves writing and reading numerous temporary files.  Environment
-variables determine the temporary files' location.  The first of
-SPSSTMPDIR, SPSSXTMPDIR, or TMPDIR that is set determines the location.
-Otherwise, if the compiler environment defined P_tmpdir, that is used.
-Otherwise, under Unix-like OSes /tmp is used; under MS-DOS, the first of
-TEMP, TMP, or root on the current drive is used; under other OSes, the
-current directory.
+involves writing and reading numerous temporary files.
+
+@cmd{SORT CASES} may not be specified following TEMPORARY.  
 
 @node Data Selection, Conditionals and Looping, Data Manipulation, Top
 @chapter Selecting data for analysis
@@ -7043,14 +7068,18 @@ To set up filtering, specify BY and a variable name.  Keyword
 BY is optional but recommended.  Cases which have a zero or system- or
 user-missing value are excluded from analysis, but not deleted from the
 data stream.  Cases with other values are analyzed.
+To filter based on a different condition, use
+transformations such as @cmd{COMPUTE} or @cmd{RECODE} to compute a
+filter variable of the required form, then specify that variable on
+@cmd{FILTER}.
 
 @code{FILTER OFF} turns off case filtering.
 
 Filtering takes place immediately before cases pass to a procedure for
 analysis.  Only one filter variable may be active at a time.  Normally,
 case filtering continues until it is explicitly turned off with @code{FILTER
-OFF}.  However, if @cmd{FILTER} is placed after TEMPORARY, filtering stops
-after execution of the next procedure or procedure-like command.
+OFF}.  However, if @cmd{FILTER} is placed after TEMPORARY, it filters only
+the next procedure or procedure-like command.
 
 @node N OF CASES, PROCESS IF, FILTER, Data Selection
 @section N OF CASES
@@ -7103,6 +7132,9 @@ read in data.  @code{ESTIMATED} never limits the number of cases
 processed by procedures.  PSPP currently does not make use of
 case count estimates.
 
+When @cmd{N} is specified after @cmd{TEMPORARY}, it affects only
+the next procedure (@pxref{TEMPORARY}).
+
 @node PROCESS IF, SAMPLE, N OF CASES, Data Selection
 @section PROCESS IF
 @vindex PROCESS IF
@@ -7128,6 +7160,11 @@ The effects of @cmd{PROCESS IF} are similar, but not identical, to the
 effects of executing @cmd{TEMPORARY}, then @cmd{SELECT IF}
 (@pxref{SELECT IF}).
 
+The filtering performed by @cmd{PROCESS IF} takes place immediately
+before cases pass to a procedure for analysis.  Because @cmd{PROCESS
+IF} affects only a single procedure, its placement relative to
+@cmd{TEMPORARY} is unimportant.
+
 @cmd{PROCESS IF} is deprecated.  It is included for compatibility with
 old command files.  New syntax files should use @cmd{SELECT IF} or
 @cmd{FILTER} instead.
@@ -7140,10 +7177,9 @@ old command files.  New syntax files should use @cmd{SELECT IF} or
 SAMPLE num1 [FROM num2].
 @end display
 
-@cmd{SAMPLE} is used to randomly sample a proportion of the cases in
-the active file.  @cmd{SAMPLE} is temporary, affecting only the next
-procedure, unless that is a data transformation, such as @cmd{SELECT IF}
-or @cmd{RECODE}.
+@cmd{SAMPLE} randomly samples a proportion of the cases in the active
+file.  Unless it follows @cmd{TEMPORARY}, it operates as a
+transformation, permanently removing cases from the active file.
 
 The proportion to sample can be expressed as a single number between 0
 and 1.  If @code{k} is the number specified, and @code{N} is the number
@@ -7169,13 +7205,11 @@ active, exactly @var{m} cases will be selected @emph{from the first
 @var{N} cases in the active file.}
 @end enumerate
 
-@cmd{SAMPLE}, @cmd{SELECT IF}, and @code{PROCESS IF} are performed in
+@cmd{SAMPLE} and @cmd{SELECT IF} are performed in
 the order specified by the syntax file.
 
-@cmd{SAMPLE} is ignored before @code{SORT CASES}.
-
 @cmd{SAMPLE} is always performed before @code{N OF CASES}, regardless
-of ordering in the syntax file.  @xref{N OF CASES}.
+of ordering in the syntax file (@pxref{N OF CASES}).
 
 The same values for @cmd{SAMPLE} may result in different samples.  To
 obtain the same sample, use the @code{SET} command to set the random
@@ -7206,6 +7240,10 @@ Place @cmd{SELECT IF} as early in the command file as
 possible.  Cases that are deleted early can be processed more
 efficiently in time and space.
 
+When @cmd{SELECT IF} is specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}), the @cmd{LAG} function may not be used
+(@pxref{LAG}).
+
 @node SPLIT FILE, TEMPORARY, SELECT IF, Data Selection
 @section SPLIT FILE
 @vindex SPLIT FILE
@@ -7229,6 +7267,9 @@ variable values for the group are printed along with the analysis.
 Specify OFF to disable @cmd{SPLIT FILE} and resume analysis of the
 entire active file as a single group of data.
 
+When @cmd{SPLIT FILE} is specified after @cmd{TEMPORARY}, it affects only
+the next procedure (@pxref{TEMPORARY}).
+
 @node TEMPORARY, WEIGHT, SPLIT FILE, Data Selection
 @section TEMPORARY
 @vindex TEMPORARY
@@ -7242,11 +7283,13 @@ following its execution temporary.  These transformations will
 affect only the execution of the next procedure or procedure-like
 command.  Their effects will not be saved to the active file.
 
-The only specification is the command name.
+The only specification on @cmd{TEMPORARY} is the command name.
 
 @cmd{TEMPORARY} may not appear within a @cmd{DO IF} or @cmd{LOOP}
-construct.  It may
-appear only once between procedures and procedure-like commands.
+construct.  It may appear only once between procedures and
+procedure-like commands.
+
+Scratch variables cannot be used following @cmd{TEMPORARY}.
 
 An example may help to clarify:
 
@@ -7301,6 +7344,9 @@ integers, but negative and system-missing values for the weighting
 variable are interpreted as weighting factors of 0.  User-missing
 values are not treated specially.
 
+When @cmd{WEIGHT} is specified after @cmd{TEMPORARY}, it affects only
+the next procedure (@pxref{TEMPORARY}).
+
 @cmd{WEIGHT} does not cause cases in the active file to be replicated in
 memory.
 
@@ -7361,6 +7407,10 @@ the boolean expression on the first @cmd{ELSE IF}, if present, is tested in
 turn, with the same rules applied.  If all expressions evaluate to
 false, then the @cmd{ELSE} code block is executed, if it is present.
 
+When @cmd{DO IF} or @cmd{ELSE IF} is specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}), the @cmd{LAG} function may not be used
+(@pxref{LAG}).
+
 @node DO REPEAT, LOOP, DO IF, Conditionals and Looping
 @section DO REPEAT
 @vindex DO REPEAT
@@ -7460,6 +7510,10 @@ loop is executed MXLOOPS (@pxref{SET}) times.
 
 @cmd{BREAK} also terminates @cmd{LOOP} execution (@pxref{BREAK}).
 
+When @cmd{LOOP} or @cmd{END LOOP} is specified following @cmd{TEMPORARY}
+(@pxref{TEMPORARY}), the @cmd{LAG} function may not be used
+(@pxref{LAG}).
+
 @node Statistics, Utilities, Conditionals and Looping, Top
 @chapter Statistics
 
@@ -7470,11 +7524,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
@@ -7564,6 +7620,7 @@ respectively.
 @node FREQUENCIES, CROSSTABS, DESCRIPTIVES, Statistics
 @section FREQUENCIES
 
+@vindex FREQUENCIES
 @display
 FREQUENCIES
         /VARIABLES=var_list
@@ -7663,9 +7720,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{}
@@ -7695,17 +7753,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
@@ -7715,7 +7779,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
@@ -7842,6 +7906,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
 
@@ -7866,6 +8057,7 @@ encountered in the input.
 * INCLUDE::                     Include a file within the current one.
 * QUIT::                        Terminate the PSPP session.
 * SET::                         Adjust PSPP runtime parameters.
+* SHOW::                        Display runtime parameters.
 * SUBTITLE::                    Provide a document subtitle.
 * TITLE::                       Provide a document title.
 @end menu
@@ -8045,7 +8237,7 @@ to the operating system.
 
 This command is not valid within a command file.
 
-@node SET, SUBTITLE, QUIT, Utilities
+@node SET, SHOW, QUIT, Utilities
 @section SET
 @vindex SET
 
@@ -8360,7 +8552,33 @@ Be aware that this setting does not guarantee safety (commands can still
 overwrite files, for instance) but it is an improvement.
 @end table
 
-@node SUBTITLE, TITLE, SET, Utilities
+@node SHOW, SUBTITLE, SET, Utilities
+@comment  node-name,  next,  previous,  up
+@section SHOW
+@vindex SHOW
+
+@display
+SHOW
+        /@var{subcommand}
+        
+@end display
+
+@cmd{SHOW} can be used to display the current state of PSPP's
+execution parameters.  All of the parameters which can be changed 
+using  @code{SET} @xref{SET}, can be examined using @cmd{SHOW}, by
+using a subcommand with the same name.
+In addition, @code{SHOW} supports the following subcommands:
+
+@table @code
+@item WARRANTY
+Show details of the lack of warranty for PSPP.
+@item COPYING
+Display the terms of PSPP's copyright licence @ref{License}.
+@end table
+
+
+
+@node SUBTITLE, TITLE, SHOW, Utilities
 @section SUBTITLE
 @vindex SUBTITLE