From: Ben Pfaff Date: Tue, 12 Oct 2021 06:03:06 +0000 (-0700) Subject: Document more matrix stuff. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5f518d843511dfcb5e034afb165d246fd6598cd6;hp=9368f08bd0297dbe60b505e806ba4be5428e0782;p=pspp Document more matrix stuff. --- diff --git a/NEWS b/NEWS index 811c4d9de2..aa3b8620ed 100644 --- a/NEWS +++ b/NEWS @@ -6,9 +6,8 @@ Please send PSPP bug reports to bug-gnu-pspp@gnu.org. Changes from 1.4.1 to 1.5.3: - * The DEFINE and MCONVERT commands are now implemented. - - * The MATRIX DATA command is now fully implemented. + * The DEFINE, MATRIX, MCONVERT, and MATRIX DATA commands are now + implemented. * An error in the displayed signficance of oneway anova contrasts tests has been corrected. diff --git a/doc/flow-control.texi b/doc/flow-control.texi index 866e8a1054..72d7a052cd 100644 --- a/doc/flow-control.texi +++ b/doc/flow-control.texi @@ -1008,11 +1008,9 @@ code block is executed. The condition is evaluated at the end of the loop, not at the beginning, so that the body of a loop with only a condition on @cmd{END LOOP} will always execute at least once. -If the index clause is not -present, then the loop is executed at most @var{max_loops} (@pxref{SET}) times -(but possibly fewer, if a condition clause evaluates to false or if -@cmd{BREAK} executes). -The default value of @var{max_loops} is 40. +If the index clause is not present, then the global @code{MXLOOPS} +setting, which defaults to 40, limits the number of iterations +(@pxref{SET MXLOOPS}). @cmd{BREAK} also terminates @cmd{LOOP} execution (@pxref{BREAK}). diff --git a/doc/matrices.texi b/doc/matrices.texi index 03448eea30..af055c71b5 100644 --- a/doc/matrices.texi +++ b/doc/matrices.texi @@ -613,9 +613,6 @@ Use @cmd{MATRIX DATA} to convert text input into matrix file format. @vindex MATRIX @vindex END MATRIX -@node Matrix Overview -@subsection Overview - @display @t{MATRIX.} @dots{}@i{matrix commands}@dots{} @@ -626,86 +623,83 @@ Use @cmd{MATRIX DATA} to convert text input into matrix file format. The following basic matrix commands are supported: @display -@t{COMPUTE} @i{variable}[(@i{index}[,@i{index}])]=@i{expression}. -@t{CALL} @i{procedure}(@i{argument}, @dots{}). +@t{COMPUTE} @i{variable}[@t{(}@i{index}[@t{,}@i{index}]@t{)}]@t{=}@i{expression}@t{.} +@t{CALL} @i{procedure}@t{(}@i{argument}@t{,} @dots{}). @t{PRINT} [@i{expression}] - [/@t{FORMAT}=@i{format}] - [/@t{TITLE}=@i{title}] - [/@t{SPACE}=@{@t{NEWPAGE} @math{|} @i{n}@}] - [@{/@t{RLABELS}=@i{string}@dots{} @math{|} /@t{RNAMES}=@i{expression}@}] - [@{/@t{CLABELS}=@i{string}@dots{} @math{|} /@t{CNAMES}=@i{expression}@}]. + [@t{/FORMAT}@t{=}@i{format}] + [@t{/TITLE}@t{=}@i{title}] + [@t{/SPACE}@t{=}@{@t{NEWPAGE} @math{|} @i{n}@}] + [@{@t{/RLABELS}@t{=}@i{string}@dots{} @math{|} @t{/RNAMES}@t{=}@i{expression}@}] + [@{@t{/CLABELS}@t{=}@i{string}@dots{} @math{|} @t{/CNAMES}@t{=}@i{expression}@}]@t{.} @end display @noindent The following matrix commands offer support for flow control: @display -@t{DO IF} @i{expression}. +@t{DO IF} @i{expression}@t{.} @dots{}@i{matrix commands}@dots{} -[@t{ELSE IF} @i{expression}. +[@t{ELSE IF} @i{expression}@t{.} @dots{}@i{matrix commands}@dots{}]@dots{} [@t{ELSE} @dots{}@i{matrix commands}@dots{}] -@t{END IF}. +@t{END IF}@t{.} -@t{LOOP} [@i{var}=@i{first} @t{TO} @i{last} [@t{BY} @i{step}]] [@t{IF} @i{expression}]. +@t{LOOP} [@i{var}@t{=}@i{first} @t{TO} @i{last} [@t{BY} @i{step}]] [@t{IF} @i{expression}]@t{.} @dots{}@i{matrix commands}@dots{} -@t{END LOOP} [@t{IF} @i{expression}]. +@t{END LOOP} [@t{IF} @i{expression}]@t{.} -@t{BREAK}. +@t{BREAK}@t{.} @end display @noindent The following matrix commands support matrix input and output: @display -@t{READ} @i{variable}[(@i{index}[,@i{index}])] - [/@t{FILE}=@i{file}] - /@t{FIELD}=@i{first} @t{TO} @i{last} [@t{BY} @i{width}] - [/@t{SIZE}=@i{expression}] - [/@t{MODE}=@{@t{RECTANGULAR} @math{|} @t{SYMMETRIC}@}] - [/@t{REREAD}] - [/@t{FORMAT}=@i{format}]. +@t{READ} @i{variable}[@t{(}@i{index}[@t{,}@i{index}]@t{)}] + [@t{/FILE}@t{=}@i{file}] + @t{/FIELD}@t{=}@i{first} @t{TO} @i{last} [@t{BY} @i{width}] + [@t{/SIZE}@t{=}@i{expression}] + [@t{/MODE}@t{=}@{@t{RECTANGULAR} @math{|} @t{SYMMETRIC}@}] + [@t{/REREAD}] + [@t{/FORMAT}@t{=}@i{format}]@t{.} @t{WRITE} @i{expression} - [/@t{OUTFILE}=@i{file}] - /@t{FIELD}=@i{first} @t{TO} @i{last} [@t{BY} @i{width}] - [/@t{MODE}=@{@t{RECTANGULAR} @math{|} @t{TRIANGULAR}@}] - [/@t{HOLD}] - [/@t{FORMAT}=@i{format}]. -@t{GET} @i{variable}[(@i{index}[,@i{index}])] - [/@t{FILE}=@{@i{file} @math{|} @t{*}@}] - [/@t{VARIABLES}=@i{variable}@dots{}] - [/@t{NAMES}=@i{expression}] - [/@t{MISSING}=@{@t{ACCEPT} @math{|} @t{OMIT} @math{|} @i{number}@}] - [/@t{SYSMIS}=@{@t{OMIT} @math{|} @i{number}@}]. + [@t{/OUTFILE}@t{=}@i{file}] + @t{/FIELD}@t{=}@i{first} @t{TO} @i{last} [@t{BY} @i{width}] + [@t{/MODE}@t{=}@{@t{RECTANGULAR} @math{|} @t{TRIANGULAR}@}] + [@t{/HOLD}] + [@t{/FORMAT}@t{=}@i{format}]@t{.} +@t{GET} @i{variable}[@t{(}@i{index}[@t{,}@i{index}]@t{)}] + [@t{/FILE}@t{=}@{@i{file} @math{|} @t{*}@}] + [@t{/VARIABLES}@t{=}@i{variable}@dots{}] + [@t{/NAMES}@t{=}@i{expression}] + [@t{/MISSING}@t{=}@{@t{ACCEPT} @math{|} @t{OMIT} @math{|} @i{number}@}] + [@t{/SYSMIS}@t{=}@{@t{OMIT} @math{|} @i{number}@}]@t{.} @t{SAVE} @i{expression} - [/@t{OUTFILE}=@{@i{file} @math{|} @t{*}@}] - [/@t{VARIABLES}=@i{variable}@dots{}] - [/@t{NAMES}=@i{expression}] - [/@t{STRINGS}=@i{variable}@dots{}]. -@t{MGET} [/@t{FILE}=@i{file}] - [/@t{TYPE}=@{@t{COV} @math{|} @t{CORR} @math{|} @t{MEAN} @math{|} @t{STDDEV} @math{|} @t{N} @math{|} @t{COUNT}@}]. + [@t{/OUTFILE}@t{=}@{@i{file} @math{|} @t{*}@}] + [@t{/VARIABLES}@t{=}@i{variable}@dots{}] + [@t{/NAMES}@t{=}@i{expression}] + [@t{/STRINGS}@t{=}@i{variable}@dots{}]@t{.} +@t{MGET} [@t{/FILE}@t{=}@i{file}] + [@t{/TYPE}@t{=}@{@t{COV} @math{|} @t{CORR} @math{|} @t{MEAN} @math{|} @t{STDDEV} @math{|} @t{N} @math{|} @t{COUNT}@}]@t{.} @t{MSAVE} @i{expression} - /@t{TYPE}=@{@t{COV} @math{|} @t{CORR} @math{|} @t{MEAN} @math{|} @t{STDDEV} @math{|} @t{N} @math{|} @t{COUNT}@} - [/@t{OUTFILE}=@i{file}] - [/@t{VARIABLES}=@i{variable}@dots{}] - [/@t{SNAMES}=@i{variable}@dots{}] - [/@t{SPLIT}=@i{expression}] - [/@t{FNAMES}=@i{variable}@dots{}] - [/@t{FACTOR}=@i{expression}]. + @t{/TYPE}@t{=}@{@t{COV} @math{|} @t{CORR} @math{|} @t{MEAN} @math{|} @t{STDDEV} @math{|} @t{N} @math{|} @t{COUNT}@} + [@t{/OUTFILE}@t{=}@i{file}] + [@t{/VARIABLES}@t{=}@i{variable}@dots{}] + [@t{/SNAMES}@t{=}@i{variable}@dots{}] + [@t{/SPLIT}@t{=}@i{expression}] + [@t{/FNAMES}@t{=}@i{variable}@dots{}] + [@t{/FACTOR}@t{=}@i{expression}]@t{.} @end display @noindent The following matrix commands provide additional support: @display -@t{DISPLAY} [@{@t{DICTIONARY} @math{|} @t{STATUS}@}]. -@t{RELEASE} @i{variable}@dots{}. +@t{DISPLAY} [@{@t{DICTIONARY} @math{|} @t{STATUS}@}]@t{.} +@t{RELEASE} @i{variable}@dots{}@t{.} @end display -@node Matrix Introduction -@subsection Introduction - @code{MATRIX} and @code{END MATRIX} enclose a special @pspp{} sub-language, called the matrix language. The matrix language does not require an active dataset to be defined and only a few of the @@ -734,6 +728,19 @@ matrix language represents a single matrix. The matrix language does not support missing values. +@code{MATRIX} is a procedure, so it cannot be enclosed inside @code{DO +IF}, @code{LOOP}, etc. + +Macros may be used within a matrix program, and macros may expand to +include entire matrix programs. The @code{DEFINE} command may not +appear within a matrix program. @xref{DEFINE}, for more information +about macros. + +The following sections describe the details of the matrix language: +first, the syntax of matrix expressions, then each of the supported +commands. The @code{COMMENT} command (@pxref{COMMENT}) is also +supported. + @node Matrix Operators @subsection Matrix Operators @@ -1238,8 +1245,12 @@ all @var{s}. @end deffn @deffn {Matrix Function} MDIAG (@var{V}) -Returns a @math{|@var{V}|@times{}|@var{V}|} matrix whose main diagonal -comes from @var{V} and whose other elements are zero. +@anchor{MDIAG} Given @var{n}-element vector @var{V}, returns a +@math{@var{n}@times{}@var{n}} matrix whose main diagonal is copied +from @var{V}. The other elements in the returned vector are zero. + +Use @code{CALL SETDIAG} (@pxref{CALL SETDIAG}) to replace the main +diagonal of a matrix in-place. @end deffn @deffn {Matrix Function} RESHAPE (@var{M}, @var{nr}, @var{nc}) @@ -1380,6 +1391,7 @@ Returns the determinant of square matrix @var{M}. @end deffn @deffn {Matrix Function} EVAL (@var{M}) +@anchor{EVAL} Returns a column vector containing the eigenvalues of symmetric matrix @var{M}, sorted in ascending order. @@ -1437,9 +1449,14 @@ equivalently, by its rows. @end deffn @deffn {Matrix Function} SVAL (@var{M}) +@anchor{SVAL} + Given @math{@var{n}@times{}@var{k}} matrix @var{M}, returns a @math{\min(@var{n},@var{k})}-element column vector containing the singular values of @var{M} in descending order. + +Use @code{CALL SVD} (@pxref{CALL SVD}) to compute the full singular +value decomposition of a matrix. @end deffn @deffn {Matrix Function} SWEEP (@var{M}, @var{nk}) @@ -1469,9 +1486,316 @@ If @math{@var{M}_{kk} = 0}, then: @subsubsection I/O @deffn {Matrix Function} EOF (@var{file}) +Given a file handle or file name @var{file}, returns an integer scalar +that indicates whether the last record in the file has been read. +Determining this requires attempting reading past the current record, +which means that @code{REREAD} on the next @code{READ} command +following @code{EOF} on the same file will be ineffective. @end deffn +@node Matrix COMPUTE Command +@subsection The @code{COMPUTE} Command + +@display +@t{COMPUTE} @i{variable}[@t{(}@i{index}[@t{,}@i{index}]@t{)}]@t{=}@i{expression}@t{.} +@end display + +The @code{COMPUTE} command evaluates an expression and assigns the +result to a variable or a submatrix of a variable. Assigning to a +submatrix uses the same syntax as the index operator (@pxref{Matrix +Index Operator}). + @node Matrix CALL command @subsection The @code{CALL} Command +A matrix function returns a single result. The @code{CALL} command +implements procedures, which take a similar syntactic form to +functions but yield results by modifying their arguments rather than +returning a value. + +Output arguments to a @code{CALL} procedure must be a single variable +name. + +The following procedures are implemented via @code{CALL} to allow them +to return multiple results. For these procedures, the output +arguments need not name existing variables; if they do, then their +previous values are replaced: + +@table @asis +@item @t{CALL EIGEN(@var{M}, @var{evec}, @var{eval})} @anchor{CALL EIGEN} + +Computes the eigenvalues and eigenvector of symmetric +@math{@var{n}@times{}@var{n}} matrix @var{M}. Assigns the +eigenvectors of @var{M} to the columns of +@math{@var{n}@times{}@var{n}} matrix @var{evec} and the eigenvalues in +descending order to @var{n}-element column vector @var{eval}. + +Use the @code{EVAL} function (@pxref{EVAL}) to compute just the +eigenvalues of a symmetric matrix. + +@item @t{CALL SVD(@var{M}, @var{U}, @var{S}, @var{V})} +@anchor{CALL SVD} + +Computes the singular value decomposition of +@math{@var{n}@times{}@var{k}} matrix @var{M}, assigning @var{S} a +@math{@var{n}@times{}@var{k}} diagonal matrix and to @var{U} and +@var{V} unitary @math{@var{k}@times{}@var{k}} matrices such that +@math{@var{M} = @var{U}@times{}@var{S}@times{}@var{V}^T}. The main +diagonal of @var{Q} contains the singular values of @var{M}. + +Use the @code{SVAL} function (@pxref{SVAL}) to compute just the +singular values of a matrix. +@end table + +The final procedure is implemented via @code{CALL} to allow it to +modify a matrix instead of returning a modified version. For this +procedure, the output argument must name an existing variable. + +@table @asis +@item @t{CALL SETDIAG(@var{M}, @var{V})} +@anchor{CALL SETDIAG} + +Replaces the main diagonal of @math{@var{n}@times{}@var{p}} matrix +@var{M} by the contents of @var{k}-element vector @var{V}. If +@math{@var{k} = 1}, so that @var{V} is a scalar, replaces all of the +diagonal elements of @var{M} by @var{V}. If @math{@var{k} < +\min(@var{n},@var{p})}, only the upper @var{k} diagonal elements are +replaced; if @math{@var{k} > \min(@var{n},@var{p})}, then the +extra elements of @var{V} are ignored. + +Use the @code{MDIAG} function (@pxref{MDIAG}) to construct a new +matrix with a specified main diagonal. +@end table + +@node Matrix PRINT Command +@subsection The @code{PRINT} Command + +@display +@t{PRINT} [@i{expression}] + [@t{/FORMAT}@t{=}@i{format}] + [@t{/TITLE}@t{=}@i{title}] + [@t{/SPACE}@t{=}@{@t{NEWPAGE} @math{|} @i{n}@}] + [@{@t{/RLABELS}@t{=}@i{string}@dots{} @math{|} @t{/RNAMES}@t{=}@i{expression}@}] + [@{@t{/CLABELS}@t{=}@i{string}@dots{} @math{|} @t{/CNAMES}@t{=}@i{expression}@}]@t{.} +@end display + +The @code{PRINT} command is commonly used to display a matrix. It +evaluates the @i{expression}, if present, and outputs it either as +text or a pivot table, depending on the setting of @code{MDISPLAY} +(@pxref{SET MDISPLAY}). + +Any matrix expression is allowed as @var{expression}, but an +expression with operators with lower precedence than exponentiation +(@pxref{Matrix Operators}) must be parenthesized. (This avoids +ambiguity between @t{/} as an operator and @t{/} to separate +subcommands.) + +Use the @code{FORMAT} subcommand to specify a format, such as +@code{F8.2}, for displaying the matrix elements. @code{FORMAT} is +optional for numerical matrices. When it is omitted, @pspp{} chooses +how to format entries automatically using @var{m}, the magnitude of +the largest-magnitude element in the matrix to be displayed: + +@enumerate +@item +If the matrix's elements are all integers, then, if possible, @pspp{} +chooses the narrowest @code{F} format with width 12 or less that fits +@var{m} plus a sign. + +@item +Otherwise, if @math{@var{m} @geq{} 10^9} or @math{@var{m} @leq{} +10^{-4}}, @pspp{} scales all of the numbers in the matrix by +@math{10^x}, where @var{x} is the exponent used when @var{m} is +displayed in scientific notation, and displays the scaled value in +format @code{F13.10}. @pspp{} adds a note to the output to indicate +the scale factor. + +@item +Otherwise, @pspp{} displays the value, without scaling, in format +@code{F13.10}. +@end enumerate + +The optional @code{TITLE} subcommand specifies a title for the output +text or table, as a quoted string. When it is omitted, the syntax of +the matrix expression is used as the title. + +Use the @code{SPACE} subcommand to request extra space above the +matrix output. With a numerical argument, it adds the specified +number of lines of blank space above the matrix. With @code{NEWPAGE} +as an argument, it prints the matrix at the top of a new page. The +@code{SPACE} subcommand has no effect when a matrix is output as a +pivot table. + +The @code{RLABELS} and @code{RNAMES} subcommands, which are mutually +exclusive, can supply a label to accompany each row in the output. +With @code{RLABELS}, specify the labels as comma-separated strings or +other tokens. With @code{RNAMES}, specify a single expression that +evaluates to a vector of strings. Either way, if there are more +labels than rows, the extra labels are ignored, and if there are more +rows than labels, the extra rows are unlabeled. For output to a pivot +table with @code{RLABELS}, the labels can be any length; otherwise, +the labels are truncated to 8 bytes. + +The @code{CLABELS} and @code{CNAMES} subcommands work for labeling +columns as @code{RLABELS} and @code{RNAMES} do for labeling rows. + +@subsubheading Text Output + +When the @var{expression} is omitted, @code{PRINT} does not output a +matrix. Instead, it outputs only the text specified on @code{TITLE}, +if any, preceded by any space specified on the @code{SPACE} +subcommand, if any. Any other subcommands are ignored, and the +command acts as if @code{MDISPLAY} is set to @code{TEXT} regardless of +its actual setting. + +@node Matrix DO IF Command +@subsection The @code{DO IF} Command + +@display +@t{DO IF} @i{expression}@t{.} + @dots{}@i{matrix commands}@dots{} +[@t{ELSE IF} @i{expression}@t{.} + @dots{}@i{matrix commands}@dots{}]@dots{} +[@t{ELSE} + @dots{}@i{matrix commands}@dots{}] +@t{END IF}@t{.} +@end display + +A @code{DO IF} command evaluates its expression argument. If the +@code{DO IF} expression evaluates to true, then @pspp{} executes the +associated commands. Otherwise, @pspp{} evaluates the expression on +each @code{ELSE IF} clause (if any) in order, and executes the +commands associated with the first one that yields a true value. +Finally, if the @code{DO IF} and all the @code{ELSE IF} expressions +all evaluate to false, @pspp{} executes the commands following the +@code{ELSE} clause (if any). + +Each expression on @code{DO IF} and @code{ELSE IF} must evaluate to a +scalar. Positive scalars are considered to be true, and scalars that +are zero or negative are considered to be false. + +@node Matrix LOOP and BREAK Commands +@subsection The @code{LOOP} and @code{BREAK} Commands + +@display +@t{LOOP} [@i{var}@t{=}@i{first} @t{TO} @i{last} [@t{BY} @i{step}]] [@t{IF} @i{expression}]@t{.} + @dots{}@i{matrix commands}@dots{} +@t{END LOOP} [@t{IF} @i{expression}]@t{.} + +@t{BREAK}@t{.} +@end display + +The @code{LOOP} command executes a nested group of matrix commands, +called the loop's @dfn{body}, repeatedly. It has three optional +clauses that control how many times the loop body executes. +Regardless of these clauses, the global @code{MXLOOPS} setting, which +defaults to 40, also limits the number of iterations of a loop. To +iterate more times, raise the maximum with @code{SET MXLOOPS} outside +of the @code{MATRIX} command (@pxref{SET MXLOOPS}). + +The optional index clause causes @var{var} to be assigned successive +values on each trip through the loop: first @var{first}, then +@math{@var{first} + @var{step}}, then @math{@var{first} + 2 @times{} +@var{step}}, and so on. The loop ends when @math{@var{var} > +@var{last}}, for positive @var{step}, or @math{@var{var} < +@var{last}}, for negative @var{step}. If @var{step} is not specified, +it defaults to 1. All the index clause expressions must evaluate to +scalars, and non-integers are rounded toward zero. If @var{step} +evaluates as zero (or rounds to zero), then the loop body never +executes. + +The optional @code{IF} on @code{LOOP} is evaluated before each +iteration through the loop body. If its expression, which must +evaluate to a scalar, is zero or negative, then the loop terminates +without executing the loop body. + +The optional @code{IF} on @code{END LOOP} is evaluated after each +iteration through the loop body. If its expression, which must +evaluate to a scalar, is zero or negative, then the loop terminates. + +The @code{BREAK} command may be used inside a loop body, ordinarily +within a @code{DO IF} command. If it is executed, then the loop +terminates immediately, jumping to the command just following +@code{END LOOP}. When multiple @code{LOOP} commands nest, +@code{BREAK} terminates the innermost loop. + +@node Matrix READ Command +@subsection The @code{READ} Command + +@display +@t{READ} @i{variable}[@t{(}@i{index}[@t{,}@i{index}]@t{)}] + [@t{/FILE}@t{=}@i{file}] + @t{/FIELD}@t{=}@i{first} @t{TO} @i{last} [@t{BY} @i{width}] + [@t{/SIZE}@t{=}@i{expression}] + [@t{/MODE}@t{=}@{@t{RECTANGULAR} @math{|} @t{SYMMETRIC}@}] + [@t{/REREAD}] + [@t{/FORMAT}@t{=}@i{format}]@t{.} +@end display + +@node Matrix WRITE Command +@subsection The @code{WRITE} Command + +@display +@t{WRITE} @i{expression} + [@t{/OUTFILE}@t{=}@i{file}] + @t{/FIELD}@t{=}@i{first} @t{TO} @i{last} [@t{BY} @i{width}] + [@t{/MODE}@t{=}@{@t{RECTANGULAR} @math{|} @t{TRIANGULAR}@}] + [@t{/HOLD}] + [@t{/FORMAT}@t{=}@i{format}]@t{.} +@end display + +@node Matrix GET Command +@subsection The @code{GET} Command + +@display +@t{GET} @i{variable}[@t{(}@i{index}[@t{,}@i{index}]@t{)}] + [@t{/FILE}@t{=}@{@i{file} @math{|} @t{*}@}] + [@t{/VARIABLES}@t{=}@i{variable}@dots{}] + [@t{/NAMES}@t{=}@i{expression}] + [@t{/MISSING}@t{=}@{@t{ACCEPT} @math{|} @t{OMIT} @math{|} @i{number}@}] + [@t{/SYSMIS}@t{=}@{@t{OMIT} @math{|} @i{number}@}]@t{.} +@end display + +@node Matrix SAVE Command +@subsection The @code{SAVE} Command + +@display +@t{SAVE} @i{expression} + [@t{/OUTFILE}@t{=}@{@i{file} @math{|} @t{*}@}] + [@t{/VARIABLES}@t{=}@i{variable}@dots{}] + [@t{/NAMES}@t{=}@i{expression}] + [@t{/STRINGS}@t{=}@i{variable}@dots{}]@t{.} +@end display +@display +@t{MGET} [@t{/FILE}@t{=}@i{file}] + [@t{/TYPE}@t{=}@{@t{COV} @math{|} @t{CORR} @math{|} @t{MEAN} @math{|} @t{STDDEV} @math{|} @t{N} @math{|} @t{COUNT}@}]@t{.} +@end display + +@node Matrix MSAVE Command +@subsection The @code{MSAVE} Command + +@display +@t{MSAVE} @i{expression} + @t{/TYPE}@t{=}@{@t{COV} @math{|} @t{CORR} @math{|} @t{MEAN} @math{|} @t{STDDEV} @math{|} @t{N} @math{|} @t{COUNT}@} + [@t{/OUTFILE}@t{=}@i{file}] + [@t{/VARIABLES}@t{=}@i{variable}@dots{}] + [@t{/SNAMES}@t{=}@i{variable}@dots{}] + [@t{/SPLIT}@t{=}@i{expression}] + [@t{/FNAMES}@t{=}@i{variable}@dots{}] + [@t{/FACTOR}@t{=}@i{expression}]@t{.} +@end display + +@node Matrix DISPLAY Command +@subsection The @code{DISPLAY} Command + +@display +@t{DISPLAY} [@{@t{DICTIONARY} @math{|} @t{STATUS}@}]@t{.} +@end display + +@node Matrix RELEASE Command +@subsection The @code{RELEASE} Command + +@display +@t{RELEASE} @i{variable}@dots{}@t{.} +@end display diff --git a/doc/utilities.texi b/doc/utilities.texi index bd5b10c9e2..f5ec9d5e86 100644 --- a/doc/utilities.texi +++ b/doc/utilities.texi @@ -506,6 +506,7 @@ SET /CC@{A,B,C,D,E@}=@{'@var{npre},@var{pre},@var{suf},@var{nsuf}','@var{npre}.@var{pre}.@var{suf}.@var{nsuf}'@} /DECIMAL=@{DOT,COMMA@} /FORMAT=@var{fmt_spec} + /MDISPLAY=@{TEXT,TABLES@} /SMALL=@var{number} /WIB=@{NATIVE,MSBFIRST,LSBFIRST,VAX@} /WRB=@{NATIVE,ISL,ISB,IDL,IDB,VF,VD,VG,ZS,ZL@} @@ -690,8 +691,11 @@ spoken in the United States) and @code{ja_JP.EUC-JP} (EUC-JP encoded Japanese as spoken in Japan). @item MXLOOPS -The maximum number of iterations for an uncontrolled loop (@pxref{LOOP}). -The default @var{max_loops} is 40. +@anchor{SET MXLOOPS} + +The maximum number of iterations for an uncontrolled loop +(@pxref{LOOP}), and for any loop in the matrix language (@pxref{Matrix +LOOP and BREAK Commands}). The default @var{max_loops} is 40. @item SEED The initial pseudo-random number seed. Set it to a real number or to @@ -742,6 +746,15 @@ The default @subcmd{DOT} setting causes the decimal point character to be Allows the default numeric input/output format to be specified. The default is F8.2. @xref{Input and Output Formats}. +@item MDISPLAY +@anchor{SET MDISPLAY} + +Controls how the @code{PRINT} command within +@code{MATRIX}@dots{}@code{END MATRIX} outputs matrices. With the +default @subcmd{TEXT}, @code{PRINT} outputs matrices as text. Change +this setting to @code{TABLES} to instead output matrices as pivot +tables. @xref{Matrix PRINT Command}, for more information. + @item SMALL This controls how @pspp{} formats small numbers in pivot tables, in cases where @pspp{} does not otherwise have a well-defined format for