This is pspp.info, produced by makeinfo version 4.7 from ../../doc/pspp.texinfo. INFO-DIR-SECTION Math START-INFO-DIR-ENTRY * PSPP: (pspp). Statistical analysis package. END-INFO-DIR-ENTRY This manual is for GNU PSPP version 0.4.0, software for statistical analysis. Copyright (C) 1997, 1998, 2004, 2005 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being "A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled "GNU Free Documentation License." (a) The FSF's Back-Cover Text is: "You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development."  File: pspp.info, Node: Top, Next: Introduction, Up: (dir) GNU PSPP ******** This manual is for GNU PSPP version 0.4.0, software for statistical analysis. Copyright (C) 1997, 1998, 2004, 2005 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.1 or any later version published by the Free Software Foundation; with no Invariant Sections, with the Front-Cover Texts being "A GNU Manual," and with the Back-Cover Texts as in (a) below. A copy of the license is included in the section entitled "GNU Free Documentation License." (a) The FSF's Back-Cover Text is: "You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development." * Menu: * Introduction:: Description of the package. * License:: Your rights and obligations. * Invocation:: Starting and running PSPP. * Language:: Basics of the PSPP command language. * Expressions:: Numeric and string expression syntax. * Data Input and Output:: Reading data from user files. * System and Portable Files:: Dealing with system & portable files. * Variable Attributes:: Adjusting and examining variables. * Data Manipulation:: Simple operations on data. * Data Selection:: Select certain cases for analysis. * Conditionals and Looping:: Doing things many times or not at all. * Statistics:: Basic statistical procedures. * Utilities:: Other commands. * Not Implemented:: What's not here yet * Bugs:: Known problems; submitting bug reports. * Function Index:: Index of PSPP functions for expressions. * Command Index:: Index of PSPP procedures. * Concept Index:: Index of concepts. * Installation:: How to compile and install PSPP. * Configuration:: Configuring PSPP. * Portable File Format:: Format of PSPP portable files. * Data File Format:: Format of PSPP system files. * q2c Input Format:: Format of syntax accepted by q2c. * GNU Free Documentation License:: License for copying this manual.  File: pspp.info, Node: Introduction, Next: License, Prev: Top, Up: Top 1 Introduction ************** PSPP is a tool for statistical analysis of sampled data. It reads a syntax file and a data file, analyzes the data, and writes the results to a listing file or to standard output. The language accepted by PSPP is similar to those accepted by SPSS statistical products. The details of PSPP's language are given later in this manual. PSPP produces output in two forms: tables and charts. Both of these can be written in several formats; currently, ASCII, PostScript, and HTML are supported. In the future, more drivers, such as PCL and X Window System drivers, may be developed. For now, Ghostscript, available from the Free Software Foundation, may be used to convert PostScript chart output to other formats. The current version of PSPP, 0.4.0, is woefully incomplete in terms of its statistical procedure support. PSPP is a work in progress. The author hopes to support fully support all features in the products that PSPP replaces, eventually. The author welcomes questions, comments, donations, and code submissions. *Note Submitting Bug Reports: Bugs, for instructions on contacting the author.  File: pspp.info, Node: License, Next: Invocation, Prev: Introduction, Up: Top 2 Your rights and obligations ***************************** PSPP is not in the public domain; it is copyrighted and there are restrictions on its distribution, but these restrictions are designed to permit everything that a good cooperating citizen would want to do. What is not allowed is to try to prevent others from further sharing any version of this program that they might get from you. Specifically, we want to make sure that you have the right to give away copies of PSPP, that you receive source code or else can get it if you want it, that you can change these programs or use pieces of them in new free programs, and that you know you can do these things. To make sure that everyone has such rights, we have to forbid you to deprive anyone else of these rights. For example, if you distribute copies of PSPP, you must give the recipients all the rights that you have. You must make sure that they, too, receive or can get the source code. And you must tell them their rights. Also, for our own protection, we must make certain that everyone finds out that there is no warranty for PSPP. If these programs are modified by someone else and passed on, we want their recipients to know that what they have is not what we distributed, so that any problems introduced by others will not reflect on our reputation. The precise conditions of the licenses for PSPP are found in the General Public Licenses that accompany them. This manual specifically is covered by the GNU Free Documentation License (*note GNU Free Documentation License::).  File: pspp.info, Node: Invocation, Next: Language, Prev: License, Up: Top 3 Invoking PSPP *************** pspp [ -B DIR | --config-dir=DIR ] [ -o DEVICE | --device=DEVICE ] [ -d VAR[=VALUE] | --define=VAR[=VALUE] ] [-u VAR | --undef=VAR ] [ -f FILE | --out-file=FILE ] [ -p | --pipe ] [ -I- | --no-include ] [ -I DIR | --include=DIR ] [ -i | --interactive ] [ -n | --edit | --dry-run | --just-print | --recon ] [ -r | --no-statrc ] [ -h | --help ] [ -l | --list ] [ -c COMMAND | --command COMMAND ] [ -s | --safer ] [ --testing-mode ] [ -V | --version ] [ -v | --verbose ] [ KEY=VALUE ] FILE.... * Menu: * Non-option Arguments:: Specifying syntax files and output devices. * Configuration Options:: Change the configuration for the current run. * Input and output options:: Controlling input and output files. * Language control options:: Language variants. * Informational options:: Helpful information about PSPP.  File: pspp.info, Node: Non-option Arguments, Next: Configuration Options, Prev: Invocation, Up: Invocation 3.1 Non-option Arguments ======================== Syntax files and output device substitutions can be specified on PSPP's command line: `FILE' A file by itself on the command line will be executed as a syntax file. PSPP terminates after the syntax file runs, unless the `-i' or `--interactive' option is given (*note Language control options::). `FILE1 FILE2' When two or more filenames are given on the command line, the first syntax file is executed, then PSPP's dictionary is cleared, then the second syntax file is executed. `FILE1 + FILE2' If syntax files' names are delimited by a plus sign (`+'), then the dictionary is not cleared between their executions, as if they were concatenated together into a single file. `KEY=VALUE' Defines an output device macro KEY to expand to VALUE, overriding any macro having the same KEY defined in the device configuration file. *Note Macro definitions::. There is one other way to specify a syntax file, if your operating system supports it. If you have a syntax file `foobar.stat', put the notation #! /usr/local/bin/pspp at the top, and mark the file as executable with `chmod +x foobar.stat'. (If PSPP is not installed in `/usr/local/bin', then insert its actual installation directory into the syntax file instead.) Now you should be able to invoke the syntax file just by typing its name. You can include any options on the command line as usual. PSPP entirely ignores any lines beginning with `#!'.  File: pspp.info, Node: Configuration Options, Next: Input and output options, Prev: Non-option Arguments, Up: Invocation 3.2 Configuration Options ========================= Configuration options are used to change PSPP's configuration for the current run. The configuration options are: `-a {compatible|enhanced}' `--algorithm={compatible|enhanced}' If you chose `compatible', then PSPP will use the same algorithms as used by some proprietary statistical analysis packages. This is not recommended, as these algorithms are inferior and in some cases compeletely broken. The default setting is `enhanced'. Certain commands have subcommands which allow you to override this setting on a per command basis. `-B DIR' `--config-dir=DIR' Sets the configuration directory to DIR. *Note File locations::. `-o DEVICE' `--device=DEVICE' Selects the output device with name DEVICE. If this option is given more than once, then all devices mentioned are selected. This option disables all devices besides those mentioned on the command line. `-d VAR[=VALUE]' `--define=VAR[=VALUE]' Defines an `environment variable' named VAR having the optional value VALUE specified. *Note Variable values::. `-u VAR' `--undef=VAR' Undefines the `environment variable' named VAR. *Note Variable values::.  File: pspp.info, Node: Input and output options, Next: Language control options, Prev: Configuration Options, Up: Invocation 3.3 Input and output options ============================ Input and output options affect how PSPP reads input and writes output. These are the input and output options: `-f FILE' `--out-file=FILE' This overrides the output file name for devices designated as listing devices. If a file named FILE already exists, it is overwritten. `-p' `--pipe' Allows PSPP to be used as a filter by causing the syntax file to be read from stdin and output to be written to stdout. Conflicts with the `-f FILE' and `--file=FILE' options. `-I-' `--no-include' Clears all directories from the include path. This includes all directories put in the include path by default. *Note Miscellaneous configuring::. `-I DIR' `--include=DIR' Appends directory DIR to the path that is searched for include files in PSPP syntax files. `-c COMMAND' `--command=COMMAND' Execute literal command COMMAND. The command is executed before startup syntax files, if any. `--testing-mode' Invoke heuristics to assist with testing PSPP. For use by `make check' and similar scripts.  File: pspp.info, Node: Language control options, Next: Informational options, Prev: Input and output options, Up: Invocation 3.4 Language control options ============================ Language control options control how PSPP syntax files are parsed and interpreted. The available language control options are: `-i' `--interactive' When a syntax file is specified on the command line, PSPP normally terminates after processing it. Giving this option will cause PSPP to bring up a command prompt after processing the syntax file. In addition, this forces syntax files to be interpreted in interactive mode, rather than the default batch mode. *Note Tokenizing lines::, for information on the differences between batch mode and interactive mode command interpretation. `-n' `--edit' `--dry-run' `--just-print' `--recon' Only the syntax of any syntax file specified or of commands entered at the command line is checked. Transformations are not performed and procedures are not executed. Not yet implemented. `-r' `--no-statrc' Prevents the execution of the PSPP startup syntax file. Not yet implemented, as startup syntax files aren't, either. `-s' `--safer' Disables certain unsafe operations. This includes the ERASE and HOST commands, as well as use of pipes as input and output files.  File: pspp.info, Node: Informational options, Prev: Language control options, Up: Invocation 3.5 Informational options ========================= Informational options cause information about PSPP to be written to the terminal. Here are the available options: `-h' `--help' Prints a message describing PSPP command-line syntax and the available device driver classes, then terminates. `-l' `--list' Lists the available device driver classes, then terminates. `-x {compatible|enhanced}' `--syntax={compatible|enhanced}' If you chose `compatible', then PSPP will only accept command syntax that is compatible with the proprietary program SPSS. If you choose `enhanced' then additional syntax will be available. The default is `enhanced'. `-V' `--version' Prints a brief message listing PSPP's version, warranties you don't have, copying conditions and copyright, and e-mail address for bug reports, then terminates. `-v' `--verbose' Increments PSPP's verbosity level. Higher verbosity levels cause PSPP to display greater amounts of information about what it is doing. Often useful for debugging PSPP's configuration. This option can be given multiple times to set the verbosity level to that value. The default verbosity level is 0, in which no informational messages will be displayed. Higher verbosity levels cause messages to be displayed when the corresponding events take place. 1 Driver and subsystem initializations. 2 Completion of driver initializations. Beginning of driver closings. 3 Completion of driver closings. 4 Files searched for; success of searches. 5 Individual directories included in file searches. Each verbosity level also includes messages from lower verbosity levels.  File: pspp.info, Node: Language, Next: Expressions, Prev: Invocation, Up: Top 4 The PSPP language ******************* *Please note:* PSPP is not even close to completion. Only a few statistical procedures are implemented. PSPP is a work in progress. This chapter discusses elements common to many PSPP commands. Later chapters will describe individual commands in detail. * Menu: * Tokens:: Characters combine to form tokens. * Commands:: Tokens combine to form commands. * Types of Commands:: Commands come in several flavors. * Order of Commands:: Commands combine to form syntax files. * Missing Observations:: Handling missing observations. * Variables:: The unit of data storage. * Files:: Files used by PSPP. * BNF:: How command syntax is described.  File: pspp.info, Node: Tokens, Next: Commands, Prev: Language, Up: Language 4.1 Tokens ========== PSPP divides most syntax file lines into series of short chunks called "tokens". Tokens are then grouped to form commands, each of which tells PSPP to take some action--read in data, write out data, perform a statistical procedure, etc. Each type of token is described below. *Identifiers* Identifiers are names that typically specify variables, commands, or subcommands. The first character in an identifier must be a letter, `#', or `@'. The remaining characters in the identifier must be letters, digits, or one of the following special characters: . _ $ # @ Identifiers may be any length, but only the first 64 bytes are significant. Identifiers are not case-sensitive: `foobar', `Foobar', `FooBar', `FOOBAR', and `FoObaR' are different representations of the same identifier. Some identifiers are reserved. Reserved identifiers may not be used in any context besides those explicitly described in this manual. The reserved identifiers are: ALL AND BY EQ GE GT LE LT NE NOT OR TO WITH *Keywords* Keywords are a subclass of identifiers that form a fixed part of command syntax. For example, command and subcommand names are keywords. Keywords may be abbreviated to their first 3 characters if this abbreviation is unambiguous. (Unique abbreviations of 3 or more characters are also accepted: `FRE', `FREQ', and `FREQUENCIES' are equivalent when the last is a keyword.) Reserved identifiers are always used as keywords. Other identifiers may be used both as keywords and as user-defined identifiers, such as variable names. *Numbers* Numbers are expressed in decimal. A decimal point is optional. Numbers may be expressed in scientific notation by adding `e' and a base-10 exponent, so that `1.234e3' has the value 1234. Here are some more examples of valid numbers: -5 3.14159265359 1e100 -.707 8945. Negative numbers are expressed with a `-' prefix. However, in situations where a literal `-' token is expected, what appears to be a negative number is treated as `-' followed by a positive number. No white space is allowed within a number token, except for horizontal white space between `-' and the rest of the number. The last example above, `8945.' will be interpreted as two tokens, `8945' and `.', if it is the last token on a line. *Note Forming commands of tokens: Commands. *Strings* Strings are literal sequences of characters enclosed in pairs of single quotes (`'') or double quotes (`"'). To include the character used for quoting in the string, double it, e.g. `'it''s an apostrophe''. White space and case of letters are significant inside strings. Strings can be concatenated using `+', so that `"a" + 'b' + 'c'' is equivalent to `'abc''. Concatenation is useful for splitting a single string across multiple source lines. The maximum length of a string, after concatenation, is 255 characters. Strings may also be expressed as hexadecimal, octal, or binary character values by prefixing the initial quote character by `X', `O', or `B' or their lowercase equivalents. Each pair, triplet, or octet of characters, according to the radix, is transformed into a single character with the given value. If there is an incomplete group of characters, the missing final digits are assumed to be `0'. These forms of strings are nonportable because numeric values are associated with different characters by different operating systems. Therefore, their use should be confined to syntax files that will not be widely distributed. The character with value 00 is reserved for internal use by PSPP. Its use in strings causes an error and replacement by a space character. *Punctuators and Operators* These tokens are the punctuators and operators: , / = ( ) + - * / ** < <= <> > >= ~= & | . Most of these appear within the syntax of commands, but the period (`.') punctuator is used only at the end of a command. It is a punctuator only as the last character on a line (except white space). When it is the last non-space character on a line, a period is not treated as part of another token, even if it would otherwise be part of, e.g., an identifier or a floating-point number. Actually, the character that ends a command can be changed with SET's ENDCMD subcommand (*note SET::), but we do not recommend doing so. Throughout the remainder of this manual we will assume that the default setting is in effect.  File: pspp.info, Node: Commands, Next: Types of Commands, Prev: Tokens, Up: Language 4.2 Forming commands of tokens ============================== Most PSPP commands share a common structure. A command begins with a command name, such as FREQUENCIES, DATA LIST, or N OF CASES. The command name may be abbreviated to its first word, and each word in the command name may be abbreviated to its first three or more characters, where these abbreviations are unambiguous. The command name may be followed by one or more "subcommands". Each subcommand begins with a subcommand name, which may be abbreviated to its first three letters. Some subcommands accept a series of one or more specifications, which follow the subcommand name, optionally separated from it by an equals sign (`='). Specifications may be separated from each other by commas or spaces. Each subcommand must be separated from the next (if any) by a forward slash (`/'). There are multiple ways to mark the end of a command. The most common way is to end the last line of the command with a period (`.') as described in the previous section (*note Tokens::). A blank line, or one that consists only of white space or comments, also ends a command by default, although you can use the NULLINE subcommand of SET to disable this feature (*note SET::). In batch mode only, that is, when reading commands from a file instead of an interactive user, any line that contains a non-space character in the leftmost column begins a new command. Thus, each command consists of a flush-left line followed by any number of lines indented from the left margin. In this mode, a plus sign, minus sign, or period (`+', `-', or `.') as the first character in a line is ignored and causes that line to begin a new command, which allows for visual indentation of a command without that command being considered part of the previous command. Sometimes, one encounters syntax files that are intended to be interpreted in interactive mode rather than batch mode. When this occurs, use the `-i' command line option to force interpretation in interactive mode (*note Language control options::).  File: pspp.info, Node: Types of Commands, Next: Order of Commands, Prev: Commands, Up: Language 4.3 Types of Commands ===================== Commands in PSPP are divided roughly into six categories: *Utility commands* Set or display various global options that affect PSPP operations. May appear anywhere in a syntax file. *Note Utility commands: Utilities. *File definition commands* Give instructions for reading data from text files or from special binary "system files". Most of these commands replace any previous data or variables with new data or variables. At least one file definition command must appear before the first command in any of the categories below. *Note Data Input and Output::. *Input program commands* Though rarely used, these provide tools for reading data files in arbitrary textual or binary formats. *Note INPUT PROGRAM::. *Transformations* Perform operations on data and write data to output files. Transformations are not carried out until a procedure is executed. *Restricted transformations* Transformations that cannot appear in certain contexts. *Note Order of Commands::, for details. *Procedures* Analyze data, writing results of analyses to the listing file. Cause transformations specified earlier in the file to be performed. In a more general sense, a "procedure" is any command that causes the active file (the data) to be read.  File: pspp.info, Node: Order of Commands, Next: Missing Observations, Prev: Types of Commands, Up: Language 4.4 Order of Commands ===================== PSPP does not place many restrictions on ordering of commands. The main restriction is that variables must be defined before they are otherwise referenced. This section describes the details of command ordering, but most users will have no need to refer to them. PSPP possesses five internal states, called initial, INPUT PROGRAM, FILE TYPE, transformation, and procedure states. (Please note the distinction between the INPUT PROGRAM and FILE TYPE _commands_ and the INPUT PROGRAM and FILE TYPE _states_.) PSPP starts in the initial state. Each successful completion of a command may cause a state transition. Each type of command has its own rules for state transitions: *Utility commands* * Valid in any state. * Do not cause state transitions. Exception: when N OF CASES is executed in the procedure state, it causes a transition to the transformation state. *DATA LIST* * Valid in any state. * When executed in the initial or procedure state, causes a transition to the transformation state. * Clears the active file if executed in the procedure or transformation state. *INPUT PROGRAM* * Invalid in INPUT PROGRAM and FILE TYPE states. * Causes a transition to the INPUT PROGRAM state. * Clears the active file. *FILE TYPE* * Invalid in INPUT PROGRAM and FILE TYPE states. * Causes a transition to the FILE TYPE state. * Clears the active file. *Other file definition commands* * Invalid in INPUT PROGRAM and FILE TYPE states. * Cause a transition to the transformation state. * Clear the active file, except for ADD FILES, MATCH FILES, and UPDATE. *Transformations* * Invalid in initial and FILE TYPE states. * Cause a transition to the transformation state. *Restricted transformations* * Invalid in initial, INPUT PROGRAM, and FILE TYPE states. * Cause a transition to the transformation state. *Procedures* * Invalid in initial, INPUT PROGRAM, and FILE TYPE states. * Cause a transition to the procedure state.  File: pspp.info, Node: Missing Observations, Next: Variables, Prev: Order of Commands, Up: Language 4.5 Handling missing observations ================================= PSPP includes special support for unknown numeric data values. Missing observations are assigned a special value, called the "system-missing value". This "value" actually indicates the absence of a value; it means that the actual value is unknown. Procedures automatically exclude from analyses those observations or cases that have missing values. Details of missing value exclusion depend on the procedure and can often be controlled by the user; refer to descriptions of individual procedures for details. The system-missing value exists only for numeric variables. String variables always have a defined value, even if it is only a string of spaces. Variables, whether numeric or string, can have designated "user-missing values". Every user-missing value is an actual value for that variable. However, most of the time user-missing values are treated in the same way as the system-missing value. String variables that are wider than a certain width, usually 8 characters (depending on computer architecture), cannot have user-missing values. For more information on missing values, see the following sections: *Note Variables::, *Note MISSING VALUES::, *Note Expressions::. See also the documentation on individual procedures for information on how they handle missing values.  File: pspp.info, Node: Variables, Next: Files, Prev: Missing Observations, Up: Language 4.6 Variables ============= Variables are the basic unit of data storage in PSPP. All the variables in a file taken together, apart from any associated data, are said to form a "dictionary". Some details of variables are described in the sections below. * Menu: * Attributes:: Attributes of variables. * System Variables:: Variables automatically defined by PSPP. * Sets of Variables:: Lists of variable names. * Input/Output Formats:: Input and output formats. * Scratch Variables:: Variables deleted by procedures.  File: pspp.info, Node: Attributes, Next: System Variables, Prev: Variables, Up: Variables 4.6.1 Attributes of Variables ----------------------------- Each variable has a number of attributes, including: *Name* An identifier, up to 64 bytes long. Each variable must have a different name. *Note Tokens::. Some system variable names begin with `$', but user-defined variables' names may not begin with `$'. The final character in a variable name should not be `.', because such an identifier will be misinterpreted when it is the final token on a line: `FOO.' will be divided into two separate tokens, `FOO' and `.', indicating end-of-command. *Note Tokens::. The final character in a variable name should not be `_', because some such identifiers are used for special purposes by PSPP procedures. As with all PSPP identifiers, variable names are not case-sensitive. PSPP capitalizes variable names on output the same way they were capitalized at their point of definition in the input. *Type* Numeric or string. *Width* (string variables only) String variables with a width of 8 characters or fewer are called "short string variables". Short string variables can be used in many procedures where "long string variables" (those with widths greater than 8) are not allowed. Certain systems may consider strings longer than 8 characters to be short strings. Eight characters represents a minimum figure for the maximum length of a short string. *Position* Variables in the dictionary are arranged in a specific order. DISPLAY can be used to show this order: see *Note DISPLAY::. *Initialization* Either reinitialized to 0 or spaces for each case, or left at its existing value. *Note LEAVE::. *Missing values* Optionally, up to three values, or a range of values, or a specific value plus a range, can be specified as "user-missing values". There is also a "system-missing value" that is assigned to an observation when there is no other obvious value for that observation. Observations with missing values are automatically excluded from analyses. User-missing values are actual data values, while the system-missing value is not a value at all. *Note Missing Observations::. *Variable label* A string that describes the variable. *Note VARIABLE LABELS::. *Value label* Optionally, these associate each possible value of the variable with a string. *Note VALUE LABELS::. *Print format* Display width, format, and (for numeric variables) number of decimal places. This attribute does not affect how data are stored, just how they are displayed. Example: a width of 8, with 2 decimal places. *Note PRINT FORMATS::. *Write format* Similar to print format, but used by certain commands that are designed to write to binary files. *Note WRITE FORMATS::.  File: pspp.info, Node: System Variables, Next: Sets of Variables, Prev: Attributes, Up: Variables 4.6.2 Variables Automatically Defined by PSPP --------------------------------------------- There are seven system variables. These are not like ordinary variables because system variables are not always stored. They can be used only in expressions. These system variables, whose values and output formats cannot be modified, are described below. `$CASENUM' Case number of the case at the moment. This changes as cases are shuffled around. `$DATE' Date the PSPP process was started, in format A9, following the pattern `DD MMM YY'. `$JDATE' Number of days between 15 Oct 1582 and the time the PSPP process was started. `$LENGTH' Page length, in lines, in format F11. `$SYSMIS' System missing value, in format F1. `$TIME' Number of seconds between midnight 14 Oct 1582 and the time the active file was read, in format F20. `$WIDTH' Page width, in characters, in format F3.  File: pspp.info, Node: Sets of Variables, Next: Input/Output Formats, Prev: System Variables, Up: Variables 4.6.3 Lists of variable names ----------------------------- To refer to a set of variables, list their names one after another. Optionally, their names may be separated by commas. To include a range of variables from the dictionary in the list, write the name of the first and last variable in the range, separated by `TO'. For instance, if the dictionary contains six variables with the names `ID', `X1', `X2', `GOAL', `MET', and `NEXTGOAL', in that order, then `X2 TO MET' would include variables `X2', `GOAL', and `MET'. Commands that define variables, such as DATA LIST, give `TO' an alternate meaning. With these commands, `TO' define sequences of variables whose names end in consecutive integers. The syntax is two identifiers that begin with the same root and end with numbers, separated by `TO'. The syntax `X1 TO X5' defines 5 variables, named `X1', `X2', `X3', `X4', and `X5'. The syntax `ITEM0008 TO ITEM0013' defines 6 variables, named `ITEM0008', `ITEM0009', `ITEM0010', `ITEM0011', `ITEM0012', and `ITEM00013'. The syntaxes `QUES001 TO QUES9' and `QUES6 TO QUES3' are invalid. After a set of variables has been defined with DATA LIST or another command with this method, the same set can be referenced on later commands using the same syntax.  File: pspp.info, Node: Input/Output Formats, Next: Scratch Variables, Prev: Sets of Variables, Up: Variables 4.6.4 Input and Output Formats ------------------------------ Data that PSPP inputs and outputs must have one of a number of formats. These formats are described, in general, by a format specification of the form `NAMEw.d', where NAME is the format name and W is a field width. D is the optional desired number of decimal places, if appropriate. If D is not included then it is assumed to be 0. Some formats do not allow D to be specified. When DATA LIST or another command specifies an input format, that format is converted to an output format for the purposes of PRINT and other data output commands. For most purposes, input and output formats are the same; the salient differences are described below. Below are listed the input and output formats supported by PSPP. If an input format is mapped to a different output format by default, then that mapping is indicated with =>. Each format has the listed bounds on input width (iw) and output width (ow). The standard numeric input and output formats are given in the following table: Fw.d: 1 <= iw,ow <= 40 Standard decimal format with D decimal places. If the number is too large to fit within the field width, it is expressed in scientific notation (`1.2+34') if w >= 6, with always at least two digits in the exponent. When used as an input format, scientific notation is allowed but an E or an F must be used to introduce the exponent. The default output format is the same as the input format, except if D > 1. In that case the output W is always made to be at least 2 + D. Ew.d: 1 <= iw <= 40; 6 <= ow <= 40 For input this is equivalent to F format except that no E or F is require to introduce the exponent. For output, produces scientific notation in the form `1.2+34'. There are always at least two digits given in the exponent. The default output W is the largest of the input W, the input D + 7, and 10. The default output D is the input D, but at least 3. COMMAw.d: 1 <= iw,ow <= 40 Equivalent to F format, except that groups of three digits are comma-separated on output. If the number is too large to express in the field width, then first commas are eliminated, then if there is still not enough space the number is expressed in scientific notation given that w >= 6. Commas are allowed and ignored when this is used as an input format. DOTw.d: 1 <= iw,ow <= 40 Equivalent to COMMA format except that the roles of comma and decimal point are interchanged. However: If SET /DECIMAL=DOT is in effect, then COMMA uses `,' for a decimal point and DOT uses `.' for a decimal point. DOLLARw.d: 1 <= iw <= 40; 2 <= ow <= 40 Equivalent to COMMA format, except that the number is prefixed by a dollar sign (`$') if there is room. On input the value is allowed to be prefixed by a dollar sign, which is ignored. The default output W is the input W, but at least 2. PCTw.d: 2 <= iw,ow <= 40 Equivalent to F format, except that the number is suffixed by a percent sign (`%') if there is room. On input the value is allowed to be suffixed by a percent sign, which is ignored. The default output W is the input W, but at least 2. Nw.d: 1 <= iw,ow <= 40 Only digits are allowed within the field width. The decimal point is assumed to be D digits from the right margin. The default output format is F with the same W and D, except if D > 1. In that case the output W is always made to be at least 2 + D. Zw.d => F: 1 <= iw,ow <= 40 Zoned decimal input. If you need to use this then you know how. IBw.d => F: 1 <= iw,ow <= 8 Integer binary format. The field is interpreted as a fixed-point positive or negative binary number in two's-complement notation. The location of the decimal point is implied. Endianness is the same as the host machine. The default output format is F8.2 if D is 0. Otherwise it is F, with output W as 9 + input D and output D as input D. PIB => F: 1 <= iw,ow <= 8 Positive integer binary format. The field is interpreted as a fixed-point positive binary number. The location of the decimal point is implied. Endianness is the same as the host machine. The default output format follows the rules for IB format. Pw.d => F: 1 <= iw,ow <= 16 Binary coded decimal format. Each byte from left to right, except the rightmost, represents two digits. The upper nibble of each byte is more significant. The upper nibble of the final byte is the least significant digit. The lower nibble of the final byte is the sign; a value of D represents a negative sign and all other values are considered positive. The decimal point is implied. The default output format follows the rules for IB format. PKw.d => F: 1 <= iw,ow <= 16 Positive binary code decimal format. Same as P but the last byte is the same as the others. The default output format follows the rules for IB format. RBw => F: 2 <= iw,ow <= 8 Binary C architecture-dependent "double" format. For a standard IEEE754 implementation W should be 8. The default output format follows the rules for IB format. PIBHEXw.d => F: 2 <= iw,ow <= 16 PIB format encoded as textual hex digit pairs. W must be even. The input width is mapped to a default output width as follows: 2=>4, 4=>6, 6=>9, 8=>11, 10=>14, 12=>16, 14=>18, 16=>21. No allowances are made for decimal places. RBHEXw => F: 4 <= iw,ow <= 16 RB format encoded as textual hex digits pairs. W must be even. The default output format is F8.2. CCAw.d: 1 <= ow <= 40 CCBw.d: 1 <= ow <= 40 CCCw.d: 1 <= ow <= 40 CCDw.d: 1 <= ow <= 40 CCEw.d: 1 <= ow <= 40 User-defined custom currency formats. May not be used as an input format. *Note SET::, for more details. The date and time numeric input and output formats accept a number of possible formats. Before describing the formats themselves, some definitions of the elements that make up their formats will be helpful: "leader" All formats accept an optional white space leader. "day" An integer between 1 and 31 representing the day of month. "day-count" An integer representing a number of days. "date-delimiter" One or more characters of white space or the following characters: `- / . ,' "month" A month name in one of the following forms: * An integer between 1 and 12. * Roman numerals representing an integer between 1 and 12. * At least the first three characters of an English month name (January, February, ...). "year" An integer year number between 1582 and 19999, or between 1 and 199. Years between 1 and 199 will have 1900 added. "julian" A single number with a year number in the first 2, 3, or 4 digits (as above) and the day number within the year in the last 3 digits. "quarter" An integer between 1 and 4 representing a quarter. "q-delimiter" The letter `Q' or `q'. "week" An integer between 1 and 53 representing a week within a year. "wk-delimiter" The letters `wk' in any case. "time-delimiter" At least one characters of white space or `:' or `.'. "hour" An integer greater than 0 representing an hour. "minute" An integer between 0 and 59 representing a minute within an hour. "opt-second" Optionally, a time-delimiter followed by a real number representing a number of seconds. "hour24" An integer between 0 and 23 representing an hour within a day. "weekday" At least the first two characters of an English day word. "spaces" Any amount or no amount of white space. "sign" An optional positive or negative sign. "trailer" All formats accept an optional white space trailer. The date input formats are strung together from the above pieces. On output, the date formats are always printed in a single canonical manner, based on field width. The date input and output formats are described below: DATEw: 9 <= iw,ow <= 40 Date format. Input format: leader + day + date-delimiter + month + date-delimiter + year + trailer. Output format: DD-MMM-YY for W < 11, DD-MMM-YYYY otherwise. EDATEw: 8 <= iw,ow <= 40 European date format. Input format same as DATE. Output format: DD.MM.YY for W < 10, DD.MM.YYYY otherwise. SDATEw: 8 <= iw,ow <= 40 Standard date format. Input format: leader + year + date-delimiter + month + date-delimiter + day + trailer. Output format: YY/MM/DD for W < 10, YYYY/MM/DD otherwise. ADATEw: 8 <= iw,ow <= 40 American date format. Input format: leader + month + date-delimiter + day + date-delimiter + year + trailer. Output format: MM/DD/YY for W < 10, MM/DD/YYYY otherwise. JDATEw: 5 <= iw,ow <= 40 Julian date format. Input format: leader + julian + trailer. Output format: YYDDD for W < 7, YYYYDDD otherwise. QYRw: 4 <= iw <= 40, 6 <= ow <= 40 Quarter/year format. Input format: leader + quarter + q-delimiter + year + trailer. Output format: `Q Q YY', where the first `Q' is one of the digits 1, 2, 3, 4, if W < 8, `Q Q YYYY' otherwise. MOYRw: 6 <= iw,ow <= 40 Month/year format. Input format: leader + month + date-delimiter + year + trailer. Output format: `MMM YY' for W < 8, `MMM YYYY' otherwise. WKYRw: 6 <= iw <= 40, 8 <= ow <= 40 Week/year format. Input format: leader + week + wk-delimiter + year + trailer. Output format: `WW WK YY' for W < 10, `WW WK YYYY' otherwise. DATETIMEw.d: 17 <= iw,ow <= 40 Date and time format. Input format: leader + day + date-delimiter + month + date-delimiter + year + time-delimiter + hour24 + time-delimiter + minute + opt-second. Output format: `DD-MMM-YYYY HH:MM'. If W > 19 then seconds `:SS' is added. If W > 22 and D > 0 then fractional seconds `.SS' are added. TIMEw.d: 5 <= iw,ow <= 40 Time format. Input format: leader + sign + spaces + hour + time-delimiter + minute + opt-second. Output format: `HH:MM'. Seconds and fractional seconds are available with W of at least 8 and 10, respectively. DTIMEw.d: 1 <= iw <= 40, 8 <= ow <= 40 Time format with day count. Input format: leader + sign + spaces + day-count + time-delimiter + hour + time-delimiter + minute + opt-second. Output format: `DD HH:MM'. Seconds and fractional seconds are available with W of at least 8 and 10, respectively. WKDAYw: 2 <= iw,ow <= 40 A weekday as a number between 1 and 7, where 1 is Sunday. Input format: leader + weekday + trailer. Output format: as many characters, in all capital letters, of the English name of the weekday as will fit in the field width. MONTHw: 3 <= iw,ow <= 40 A month as a number between 1 and 12, where 1 is January. Input format: leader + month + trailer. Output format: as many character, in all capital letters, of the English name of the month as will fit in the field width. There are only two formats that may be used with string variables: Aw: 1 <= iw <= 255, 1 <= ow <= 254 The entire field is treated as a string value. AHEXw => A: 2 <= iw <= 254; 2 <= ow <= 510 The field is composed of characters in a string encoded as textual hex digit pairs. The default output W is half the input W.  File: pspp.info, Node: Scratch Variables, Prev: Input/Output Formats, Up: Variables 4.6.5 Scratch Variables ----------------------- Most of the time, variables don't retain their values between cases. Instead, either they're being read from a data file or the active file, in which case they assume the value read, or, if created with COMPUTE or another transformation, they're initialized to the system-missing value or to blanks, depending on type. However, sometimes it's useful to have a variable that keeps its value between cases. You can do this with LEAVE (*note LEAVE::), or you can use a "scratch variable". Scratch variables are variables whose names begin with an octothorpe (`#'). Scratch variables have the same properties as variables left with LEAVE: they retain their values between cases, and for the first case they are initialized to 0 or blanks. They have the additional property that they are deleted before the execution of any procedure. For this reason, scratch variables can't be used for analysis. To use a scratch variable in an analysis, use COMPUTE (*note COMPUTE::) to copy its value into an ordinary variable, then use that ordinary variable in the analysis.  File: pspp.info, Node: Files, Next: BNF, Prev: Variables, Up: Language 4.7 Files Used by PSPP ====================== PSPP makes use of many files each time it runs. Some of these it reads, some it writes, some it creates. Here is a table listing the most important of these files: *command file* *syntax file* These names (synonyms) refer to the file that contains instructions that tell PSPP what to do. The syntax file's name is specified on the PSPP command line. Syntax files can also be pulled in with INCLUDE (*note INCLUDE::). *data file* Data files contain raw data in ASCII format suitable for being read in by DATA LIST. Data can be embedded in the syntax file with BEGIN DATA and END DATA: this makes the syntax file a data file too. *listing file* One or more output files are created by PSPP each time it is run. The output files receive the tables and charts produced by statistical procedures. The output files may be in any number of formats, depending on how PSPP is configured. *active file* The active file is the "file" on which all PSPP procedures are performed. The active file contains variable definitions and cases. The active file is not necessarily a disk file: it is stored in memory if there is room.  File: pspp.info, Node: BNF, Prev: Files, Up: Language 4.8 Backus-Naur Form ==================== The syntax of some parts of the PSPP language is presented in this manual using the formalism known as "Backus-Naur Form", or BNF. The following table describes BNF: * Words in all-uppercase are PSPP keyword tokens. In BNF, these are often called "terminals". There are some special terminals, which are written in lowercase for clarity: `number' A real number. `integer' An integer number. `string' A string. `var-name' A single variable name. `=', `/', `+', `-', etc. Operators and punctuators. `.' The end of the command. This is not necessarily an actual dot in the syntax file: *Note Commands::, for more details. * Other words in all lowercase refer to BNF definitions, called "productions". These productions are also known as "nonterminals". Some nonterminals are very common, so they are defined here in English for clarity: `var-list' A list of one or more variable names or the keyword `ALL'. `expression' An expression. *Note Expressions::, for details. * `::=' means "is defined as". The left side of `::=' gives the name of the nonterminal being defined. The right side of `::=' gives the definition of that nonterminal. If the right side is empty, then one possible expansion of that nonterminal is nothing. A BNF definition is called a "production". * So, the key difference between a terminal and a nonterminal is that a terminal cannot be broken into smaller parts--in fact, every terminal is a single token (*note Tokens::). On the other hand, nonterminals are composed of a (possibly empty) sequence of terminals and nonterminals. Thus, terminals indicate the deepest level of syntax description. (In parsing theory, terminals are the leaves of the parse tree; nonterminals form the branches.) * The first nonterminal defined in a set of productions is called the "start symbol". The start symbol defines the entire syntax for that command.  File: pspp.info, Node: Expressions, Next: Data Input and Output, Prev: Language, Up: Top 5 Mathematical Expressions ************************** Expressions share a common syntax each place they appear in PSPP commands. Expressions are made up of "operands", which can be numbers, strings, or variable names, separated by "operators". There are five types of operators: grouping, arithmetic, logical, relational, and functions. Every operator takes one or more operands as input and yields exactly one result as output. Depending on the operator, operands accept strings or numbers as operands. With few exceptions, operands may be full-fledged expressions in themselves. * Menu: * Boolean Values:: Boolean values. * Missing Values in Expressions:: Using missing values in expressions. * Grouping Operators:: parentheses * Arithmetic Operators:: add sub mul div pow * Logical Operators:: AND NOT OR * Relational Operators:: EQ GE GT LE LT NE * Functions:: More-sophisticated operators. * Order of Operations:: Operator precedence.  File: pspp.info, Node: Boolean Values, Next: Missing Values in Expressions, Up: Expressions 5.1 Boolean Values ================== Some PSPP operators and expressions work with Boolean values, which represent true/false conditions. Booleans have only three possible values: 0 (false), 1 (true), and system-missing (unknown). System-missing is neither true nor false and indicates that the true value is unknown. Boolean-typed operands or function arguments must take on one of these three values. Other values are considered false, but provoke a warning when the expression is evaluated. Strings and Booleans are not compatible, and neither may be used in place of the other.  File: pspp.info, Node: Missing Values in Expressions, Next: Grouping Operators, Prev: Boolean Values, Up: Expressions 5.2 Missing Values in Expressions ================================= Most numeric operators yield system-missing when given any system-missing operand. A string operator given any system-missing operand typically results in the empty string. Exceptions are listed under particular operator descriptions. String user-missing values are not treated specially in expressions. User-missing values for numeric variables are always transformed into the system-missing value, except inside the arguments to the `VALUE' and `SYSMIS' functions. The missing-value functions can be used to precisely control how missing values are treated in expressions. *Note Missing Value Functions::, for more details.  File: pspp.info, Node: Grouping Operators, Next: Arithmetic Operators, Prev: Missing Values in Expressions, Up: Expressions 5.3 Grouping Operators ====================== Parentheses (`()') are the grouping operators. Surround an expression with parentheses to force early evaluation. Parentheses also surround the arguments to functions, but in that situation they act as punctuators, not as operators.  File: pspp.info, Node: Arithmetic Operators, Next: Logical Operators, Prev: Grouping Operators, Up: Expressions 5.4 Arithmetic Operators ======================== The arithmetic operators take numeric operands and produce numeric results. `A + B' Yields the sum of A and B. `A - B' Subtracts B from A and yields the difference. `A * B' Yields the product of A and B. If either A or B is 0, then the result is 0, even if the other operand is missing. `A / B' Divides A by B and yields the quotient. If A is 0, then the result is 0, even if B is missing. If B is zero, the result is system-missing. `A ** B' Yields the result of raising A to the power B. If A is negative and B is not an integer, the result is system-missing. The result of `0**0' is system-missing as well. `- A' Reverses the sign of A.  File: pspp.info, Node: Logical Operators, Next: Relational Operators, Prev: Arithmetic Operators, Up: Expressions 5.5 Logical Operators ===================== The logical operators take logical operands and produce logical results, meaning "true or false." Logical operators are not true Boolean operators because they may also result in a system-missing value. *Note Boolean Values::, for more information. `A AND B' `A & B' True if both A and B are true, false otherwise. If one operand is false, the result is false even if the other is missing. If both operands are missing, the result is missing. `A OR B' `A | B' True if at least one of A and B is true. If one operand is true, the result is true even if the other operand is missing. If both operands are missing, the result is missing. `NOT A' `~ A' True if A is false. If the operand is missing, then the result is missing.  File: pspp.info, Node: Relational Operators, Next: Functions, Prev: Logical Operators, Up: Expressions 5.6 Relational Operators ======================== The relational operators take numeric or string operands and produce Boolean results. Strings cannot be compared to numbers. When strings of different lengths are compared, the shorter string is right-padded with spaces to match the length of the longer string. The results of string comparisons, other than tests for equality or inequality, depend on the character set in use. String comparisons are case-sensitive. `A EQ B' `A = B' True if A is equal to B. `A LE B' `A <= B' True if A is less than or equal to B. `A LT B' `A < B' True if A is less than B. `A GE B' `A >= B' True if A is greater than or equal to B. `A GT B' `A > B' True if A is greater than B. `A NE B' `A ~= B' `A <> B' True if A is not equal to B.  File: pspp.info, Node: Functions, Next: Order of Operations, Prev: Relational Operators, Up: Expressions 5.7 Functions ============= PSPP functions provide mathematical abilities above and beyond those possible using simple operators. Functions have a common syntax: each is composed of a function name followed by a left parenthesis, one or more arguments, and a right parenthesis. Function names are not reserved. Their names are specially treated only when followed by a left parenthesis, so that `EXP(10)' refers to the constant value `e' raised to the 10th power, but `EXP' by itself refers to the value of variable EXP. The sections below describe each function in detail. * Menu: * Mathematics:: EXP LG10 LN LNGAMMA SQRT * Miscellaneous Mathematics:: ABS MOD MOD10 RND TRUNC * Trigonometry:: ACOS ARCOS ARSIN ARTAN ASIN ATAN COS SIN TAN * Missing Value Functions:: MISSING NMISS NVALID SYSMIS VALUE * Set Membership:: ANY RANGE * Statistical Functions:: CFVAR MAX MEAN MIN SD SUM VARIANCE * String Functions:: CONCAT INDEX LENGTH LOWER LPAD LTRIM NUMBER RINDEX RPAD RTRIM STRING SUBSTR UPCASE * Time & Date:: CTIME.xxx DATE.xxx TIME.xxx XDATE.xxx * Miscellaneous Functions:: LAG YRMODA * Statistical Distribution Functions:: PDF CDF SIG IDF RV NPDF NCDF  File: pspp.info, Node: Mathematics, Next: Miscellaneous Mathematics, Up: Functions 5.7.1 Mathematical Functions ---------------------------- Advanced mathematical functions take numeric arguments and produce numeric results. -- Function: EXP (EXPONENT) Returns e (approximately 2.71828) raised to power EXPONENT. -- Function: LG10 (NUMBER) Takes the base-10 logarithm of NUMBER. If NUMBER is not positive, the result is system-missing. -- Function: LN (NUMBER) Takes the base-e logarithm of NUMBER. If NUMBER is not positive, the result is system-missing. -- Function: LNGAMMA (NUMBER) Yields the base-e logarithm of the complete gamma of NUMBER. If NUMBER is a negative integer, the result is system-missing. -- Function: SQRT (NUMBER) Takes the square root of NUMBER. If NUMBER is negative, the result is system-missing.  File: pspp.info, Node: Miscellaneous Mathematics, Next: Trigonometry, Prev: Mathematics, Up: Functions 5.7.2 Miscellaneous Mathematical Functions ------------------------------------------ Miscellaneous mathematical functions take numeric arguments and produce numeric results. -- Function: ABS (NUMBER) Results in the absolute value of NUMBER. -- Function: MOD (NUMERATOR, DENOMINATOR) Returns the remainder (modulus) of NUMERATOR divided by DENOMINATOR. If NUMERATOR is 0, then the result is 0, even if DENOMINATOR is missing. If DENOMINATOR is 0, the result is system-missing. -- Function: MOD10 (NUMBER) Returns the remainder when NUMBER is divided by 10. If NUMBER is negative, MOD10(NUMBER) is negative or zero. -- Function: RND (NUMBER) Takes the absolute value of NUMBER and rounds it to an integer. Then, if NUMBER was negative originally, negates the result. -- Function: TRUNC (NUMBER) Discards the fractional part of NUMBER; that is, rounds NUMBER towards zero.  File: pspp.info, Node: Trigonometry, Next: Missing Value Functions, Prev: Miscellaneous Mathematics, Up: Functions 5.7.3 Trigonometric Functions ----------------------------- Trigonometric functions take numeric arguments and produce numeric results. -- Function: ARCOS (NUMBER) -- Function: ACOS (NUMBER) Takes the arccosine, in radians, of NUMBER. Results in system-missing if NUMBER is not between -1 and 1 inclusive. This function is a PSPP extension. -- Function: ARSIN (NUMBER) -- Function: ASIN (NUMBER) Takes the arcsine, in radians, of NUMBER. Results in system-missing if NUMBER is not between -1 and 1 inclusive. -- Function: ARTAN (NUMBER) -- Function: ATAN (NUMBER) Takes the arctangent, in radians, of NUMBER. -- Function: COS (ANGLE) Takes the cosine of ANGLE which should be in radians. -- Function: SIN (ANGLE) Takes the sine of ANGLE which should be in radians. -- Function: TAN (ANGLE) Takes the tangent of ANGLE which should be in radians. Results in system-missing at values of ANGLE that are too close to odd multiples of pi/2. Portability: none.  File: pspp.info, Node: Missing Value Functions, Next: Set Membership, Prev: Trigonometry, Up: Functions 5.7.4 Missing-Value Functions ----------------------------- Missing-value functions take various numeric arguments and yield various types of results. Except where otherwise stated below, the normal rules of evaluation apply within expression arguments to these functions. In particular, user-missing values for numeric variables are converted to system-missing values. -- Function: MISSING (EXPR) Returns 1 if EXPR has the system-missing value, 0 otherwise. -- Function: NMISS (EXPR [, EXPR]...) Each argument must be a numeric expression. Returns the number of system-missing values in the list, which may include variable ranges using the `VAR1 TO VAR2' syntax. -- Function: NVALID (EXPR [, EXPR]...) Each argument must be a numeric expression. Returns the number of values in the list that are not system-missing. The list may include variable ranges using the `VAR1 TO VAR2' syntax. -- Function: SYSMIS (EXPR) When EXPR is simply the name of a numeric variable, returns 1 if the variable has the system-missing value, 0 if it is user-missing or not missing. If given EXPR takes another form, results in 1 if the value is system-missing, 0 otherwise. -- Function: VALUE (VARIABLE) Prevents the user-missing values of VARIABLE from being transformed into system-missing values, and always results in the actual value of VARIABLE, whether it is valid, user-missing, or system-missing.  File: pspp.info, Node: Set Membership, Next: Statistical Functions, Prev: Missing Value Functions, Up: Functions 5.7.5 Set-Membership Functions ------------------------------ Set membership functions determine whether a value is a member of a set. They take a set of numeric arguments or a set of string arguments, and produce Boolean results. String comparisons are performed according to the rules given in *Note Relational Operators::. -- Function: ANY (VALUE, SET [, SET]...) Results in true if VALUE is equal to any of the SET values. Otherwise, results in false. If VALUE is system-missing, returns system-missing. System-missing values in SET do not cause ANY to return system-missing. -- Function: RANGE (VALUE, LOW, HIGH [, LOW, HIGH]...) Results in true if VALUE is in any of the intervals bounded by LOW and HIGH inclusive. Otherwise, results in false. Each LOW must be less than or equal to its corresponding HIGH value. LOW and HIGH must be given in pairs. If VALUE is system-missing, returns system-missing. System-missing values in SET do not cause RANGE to return system-missing.  File: pspp.info, Node: Statistical Functions, Next: String Functions, Prev: Set Membership, Up: Functions 5.7.6 Statistical Functions --------------------------- Statistical functions compute descriptive statistics on a list of values. Some statistics can be computed on numeric or string values; other can only be computed on numeric values. Their results have the same type as their arguments. The current case's weighting factor (*note WEIGHT::) has no effect on statistical functions. These functions' argument lists may include entire ranges of variables using the `VAR1 TO VAR2' syntax. Unlike most functions, statistical functions can return non-missing values even when some of their arguments are missing. Most statistical functions, by default, require only 1 non-missing value to have a non-missing return, but CFVAR, SD, and VARIANCE require 2. These defaults can be increased (but not decreased) by appending a dot and the minimum number of valid arguments to the function name. For example, `MEAN.3(X, Y, Z)' would only return non-missing if all of `X', `Y', and `Z' were valid. -- Function: CFVAR (NUMBER, NUMBER[, ...]) Results in the coefficient of variation of the values of NUMBER. (The coefficient of variation is the standard deviation divided by the mean.) -- Function: MAX (VALUE, VALUE[, ...]) Results in the value of the greatest VALUE. The VALUEs may be numeric or string. -- Function: MEAN (NUMBER, NUMBER[, ...]) Results in the mean of the values of NUMBER. -- Function: MIN (NUMBER, NUMBER[, ...]) Results in the value of the least VALUE. The VALUEs may be numeric or string. -- Function: SD (NUMBER, NUMBER[, ...]) Results in the standard deviation of the values of NUMBER. -- Function: SUM (NUMBER, NUMBER[, ...]) Results in the sum of the values of NUMBER. -- Function: VARIANCE (NUMBER, NUMBER[, ...]) Results in the variance of the values of NUMBER.  File: pspp.info, Node: String Functions, Next: Time & Date, Prev: Statistical Functions, Up: Functions 5.7.7 String Functions ---------------------- String functions take various arguments and return various results. -- Function: CONCAT (STRING, STRING[, ...]) Returns a string consisting of each STRING in sequence. `CONCAT("abc", "def", "ghi")' has a value of `"abcdefghi"'. The resultant string is truncated to a maximum of 255 characters. -- Function: INDEX (HAYSTACK, NEEDLE) Returns a positive integer indicating the position of the first occurrence of NEEDLE in HAYSTACK. Returns 0 if HAYSTACK does not contain NEEDLE. Returns system-missing if NEEDLE is an empty string. -- Function: INDEX (HAYSTACK, NEEDLES, NEEDLE_LEN) Divides NEEDLES into one or more needles, each with length NEEDLE_LEN. Searches HAYSTACK for the first occurrence of each needle, and returns the smallest value. Returns 0 if HAYSTACK does not contain any part in NEEDLE. It is an error if NEEDLE_LEN does not evenly divide the length of NEEDLES. Returns system-missing if NEEDLES is an empty string. -- Function: LENGTH (STRING) Returns the number of characters in STRING. -- Function: LOWER (STRING) Returns a string identical to STRING except that all uppercase letters are changed to lowercase letters. The definitions of "uppercase" and "lowercase" are system-dependent. -- Function: LPAD (STRING, LENGTH) If STRING is at least LENGTH characters in length, returns STRING unchanged. Otherwise, returns STRING padded with spaces on the left side to length LENGTH. Returns an empty string if LENGTH is system-missing, negative, or greater than 255. -- Function: LPAD (STRING, LENGTH, PADDING) If STRING is at least LENGTH characters in length, returns STRING unchanged. Otherwise, returns STRING padded with PADDING on the left side to length LENGTH. Returns an empty string if LENGTH is system-missing, negative, or greater than 255, or if PADDING does not contain exactly one character. -- Function: LTRIM (STRING) Returns STRING, after removing leading spaces. Other white space, such as tabs, carriage returns, line feeds, and vertical tabs, is not removed. -- Function: LTRIM (STRING, PADDING) Returns STRING, after removing leading PADDING characters. If PADDING does not contain exactly one character, returns an empty string. -- Function: NUMBER (STRING, FORMAT) Returns the number produced when STRING is interpreted according to format specifier FORMAT. If the format width W is less than the length of STRING, then only the first W characters in STRING are used, e.g. `NUMBER("123", F3.0)' and `NUMBER("1234", F3.0)' both have value 123. If W is greater than STRING's length, then it is treated as if it were right-padded with spaces. If STRING is not in the correct format for FORMAT, system-missing is returned. -- Function: RINDEX (STRING, FORMAT) Returns a positive integer indicating the position of the last occurrence of NEEDLE in HAYSTACK. Returns 0 if HAYSTACK does not contain NEEDLE. Returns system-missing if NEEDLE is an empty string. -- Function: RINDEX (HAYSTACK, NEEDLE, NEEDLE_LEN) Divides NEEDLE into parts, each with length NEEDLE_LEN. Searches HAYSTACK for the last occurrence of each part, and returns the largest value. Returns 0 if HAYSTACK does not contain any part in NEEDLE. It is an error if NEEDLE_LEN does not evenly divide the length of NEEDLE. Returns system-missing if NEEDLE is an empty string. -- Function: RPAD (STRING, LENGTH) If STRING is at least LENGTH characters in length, returns STRING unchanged. Otherwise, returns STRING padded with spaces on the right to length LENGTH. Returns an empty string if LENGTH is system-missing, negative, or greater than 255. -- Function: RPAD (STRING, LENGTH, PADDING) If STRING is at least LENGTH characters in length, returns STRING unchanged. Otherwise, returns STRING padded with PADDING on the right to length LENGTH. Returns an empty string if LENGTH is system-missing, negative, or greater than 255, or if PADDING does not contain exactly one character. -- Function: RTRIM (STRING) Returns STRING, after removing trailing spaces. Other types of white space are not removed. -- Function: RTRIM (STRING, PADDING) Returns STRING, after removing trailing PADDING characters. If PADDING does not contain exactly one character, returns an empty string. -- Function: STRING (NUMBER, FORMAT) Returns a string corresponding to NUMBER in the format given by format specifier FORMAT. For example, `STRING(123.56, F5.1)' has the value `"123.6"'. -- Function: SUBSTR (STRING, START) Returns a string consisting of the value of STRING from position START onward. Returns an empty string if START is system-missing, less than 1, or greater than the length of STRING. -- Function: SUBSTR (STRING, START, COUNT) Returns a string consisting of the first COUNT characters from STRING beginning at position START. Returns an empty string if START or COUNT is system-missing, if START is less than 1 or greater than the number of characters in STRING, or if COUNT is less than 1. Returns a string shorter than COUNT characters if START + COUNT - 1 is greater than the number of characters in STRING. Examples: `SUBSTR("abcdefg", 3, 2)' has value `"cd"'; `SUBSTR("nonsense", 4, 10)' has the value `"sense"'. -- Function: UPCASE (STRING) Returns STRING, changing lowercase letters to uppercase letters.  File: pspp.info, Node: Time & Date, Next: Miscellaneous Functions, Prev: String Functions, Up: Functions 5.7.8 Time & Date Functions --------------------------- For compatibility, PSPP considers dates before 15 Oct 1582 invalid. Most time and date functions will not accept earlier dates. * Menu: * Time & Date Concepts:: How times & dates are defined and represented * Time Construction:: TIME.{DAYS HMS} * Time Extraction:: CTIME.{DAYS HOURS MINUTES SECONDS} * Date Construction:: DATE.{DMY MDY MOYR QYR WKYR YRDAY} * Date Extraction:: XDATE.{DATE HOUR JDAY MDAY MINUTE MONTH QUARTER SECOND TDAY TIME WEEK WKDAY YEAR}  File: pspp.info, Node: Time & Date Concepts, Next: Time Construction, Up: Time & Date 5.7.8.1 How times & dates are defined and represented ..................................................... Times and dates are handled by PSPP as single numbers. A "time" is an interval. PSPP measures times in seconds. Thus, the following intervals correspond with the numeric values given: 10 minutes 600 1 hour 3,600 1 day, 3 hours, 10 seconds 97,210 40 days 3,456,000 A "date", on the other hand, is a particular instant in the past or the future. PSPP represents a date as a number of seconds since midnight preceding 14 Oct 1582. Because midnight preceding the dates given below correspond with the numeric PSPP dates given: 15 Oct 1582 86,400 4 Jul 1776 6,113,318,400 1 Jan 1900 10,010,390,400 1 Oct 1978 12,495,427,200 24 Aug 1995 13,028,601,600 Ordinary arithmetic operations on dates and times often produce sensible results. Adding a time to, or subtracting one from, a date produces a new date that much earlier or later. The difference of two dates yields the time between those dates. Adding two times produces the combined time. Multiplying a time by a scalar produces a time that many times longer. Since times and dates are just numbers, the ordinary addition and subtraction operators are employed for these purposes. Adding two dates does not produce a useful result. As the table shows, dates and times may have very large values. Thus, it is not a good idea to take powers of these values; also, the accuracy of some procedures may be affected. If necessary, convert times or dates in seconds to some other unit, like days or years, before performing analysis.  File: pspp.info, Node: Time Construction, Next: Time Extraction, Prev: Time & Date Concepts, Up: Time & Date 5.7.8.2 Functions that Produce Times .................................... These functions take numeric arguments and return numeric values that represent times. -- Function: TIME.DAYS (NDAYS) Returns a time corresponding to NDAYS days. -- Function: TIME.HMS (NHOURS, NMINS, NSECS) Returns a time corresponding to NHOURS hours, NMINS minutes, and NSECS seconds. The arguments may not have mixed signs: if any of them are positive, then none may be negative, and vice versa.  File: pspp.info, Node: Time Extraction, Next: Date Construction, Prev: Time Construction, Up: Time & Date 5.7.8.3 Functions that Examine Times .................................... These functions take numeric arguments in PSPP time format and give numeric results. -- Function: CTIME.DAYS (TIME) Results in the number of days and fractional days in TIME. -- Function: CTIME.HOURS (TIME) Results in the number of hours and fractional hours in TIME. -- Function: CTIME.MINUTES (TIME) Results in the number of minutes and fractional minutes in TIME. -- Function: CTIME.SECONDS (TIME) Results in the number of seconds and fractional seconds in TIME. (`CTIME.SECONDS' does nothing; `CTIME.SECONDS(X)' is equivalent to `X'.)  File: pspp.info, Node: Date Construction, Next: Date Extraction, Prev: Time Extraction, Up: Time & Date 5.7.8.4 Functions that Produce Dates .................................... These functions take numeric arguments and give numeric results that represent dates. Arguments taken by these functions are: DAY Refers to a day of the month between 1 and 31. Day 0 is also accepted and refers to the final day of the previous month. Days 29, 30, and 31 are accepted even in months that have fewer days and refer to a day near the beginning of the following month. MONTH Refers to a month of the year between 1 and 12. Months 0 and 13 are also accepted and refer to the last month of the preceding year and the first month of the following year, respectively. QUARTER Refers to a quarter of the year between 1 and 4. The quarters of the year begin on the first day of months 1, 4, 7, and 10. WEEK Refers to a week of the year between 1 and 53. YDAY Refers to a day of the year between 1 and 366. YEAR Refers to a year, 1582 or greater. Years between 0 and 99 are treated according to the epoch set on SET EPOCH, by default beginning 69 years before the current date (*note SET EPOCH::). If these functions' arguments are out-of-range, they are correctly normalized before conversion to date format. Non-integers are rounded toward zero. -- Function: DATE.DMY (DAY, MONTH, YEAR) -- Function: DATE.MDY (MONTH, DAY, YEAR) Results in a date value corresponding to the midnight before day DAY of month MONTH of year YEAR. -- Function: DATE.MOYR (MONTH, YEAR) Results in a date value corresponding to the midnight before the first day of month MONTH of year YEAR. -- Function: DATE.QYR (QUARTER, YEAR) Results in a date value corresponding to the midnight before the first day of quarter QUARTER of year YEAR. -- Function: DATE.WKYR (WEEK, YEAR) Results in a date value corresponding to the midnight before the first day of week WEEK of year YEAR. -- Function: DATE.YRDAY (YEAR, YDAY) Results in a date value corresponding to the day YDAY of year YEAR.  File: pspp.info, Node: Date Extraction, Prev: Date Construction, Up: Time & Date 5.7.8.5 Functions that Examine Dates .................................... These functions take numeric arguments in PSPP date or time format and give numeric results. These names are used for arguments: DATE A numeric value in PSPP date format. TIME A numeric value in PSPP time format. TIME-OR-DATE A numeric value in PSPP time or date format. -- Function: XDATE.DATE (TIME-OR-DATE) For a time, results in the time corresponding to the number of whole days DATE-OR-TIME includes. For a date, results in the date corresponding to the latest midnight at or before DATE-OR-TIME; that is, gives the date that DATE-OR-TIME is in. -- Function: XDATE.HOUR (TIME-OR-DATE) For a time, results in the number of whole hours beyond the number of whole days represented by DATE-OR-TIME. For a date, results in the hour (as an integer between 0 and 23) corresponding to DATE-OR-TIME. -- Function: XDATE.JDAY (DATE) Results in the day of the year (as an integer between 1 and 366) corresponding to DATE. -- Function: XDATE.MDAY (DATE) Results in the day of the month (as an integer between 1 and 31) corresponding to DATE. -- Function: XDATE.MINUTE (TIME-OR-DATE) Results in the number of minutes (as an integer between 0 and 59) after the last hour in TIME-OR-DATE. -- Function: XDATE.MONTH (DATE) Results in the month of the year (as an integer between 1 and 12) corresponding to DATE. -- Function: XDATE.QUARTER (DATE) Results in the quarter of the year (as an integer between 1 and 4) corresponding to DATE. -- Function: XDATE.SECOND (TIME-OR-DATE) Results in the number of whole seconds after the last whole minute (as an integer between 0 and 59) in TIME-OR-DATE. -- Function: XDATE.TDAY (DATE) Results in the number of whole days from 14 Oct 1582 to DATE. -- Function: XDATE.TIME (DATE) Results in the time of day at the instant corresponding to DATE, as a time value. This is the number of seconds since midnight on the day corresponding to DATE. -- Function: XDATE.WEEK (DATE) Results in the week of the year (as an integer between 1 and 53) corresponding to DATE. -- Function: XDATE.WKDAY (DATE) Results in the day of week (as an integer between 1 and 7) corresponding to DATE, where 1 represents Sunday. -- Function: XDATE.YEAR (DATE) Returns the year (as an integer 1582 or greater) corresponding to DATE.  File: pspp.info, Node: Miscellaneous Functions, Next: Statistical Distribution Functions, Prev: Time & Date, Up: Functions 5.7.9 Miscellaneous Functions ----------------------------- Miscellaneous functions take various arguments and produce various results. -- Function: LAG (VARIABLE[, NCASES]) VARIABLE must be a numeric or string variable name. `LAG' results in the value of that variable for the case NCASES before the current one. In case-selection procedures, `LAG' results in the value of the variable for the last case selected. Results in system-missing (for numeric variables) or blanks (for string variables) for the first case or before any cases are selected. If omitted, NCASES defaults to 1. Otherwise, NCASES must be a small positive constant integer. There is no explicit limit, but use of a large value will increase memory consumption. -- Function: YRMODA (YEAR, MONTH, DAY) YEAR is a year, either between 0 and 99 or at least 1582. Unlike other PSPP date functions, years between 0 and 99 always correspond to 1900 through 1999. MONTH is a month between 1 and 13. DAY is a day between 0 and 31. A DAY of 0 refers to the last day of the previous month, and a MONTH of 13 refers to the first month of the next year. YEAR must be in range. YEAR, MONTH, and DAY must all be integers. `YRMODA' results in the number of days between 15 Oct 1582 and the date specified, plus one. The date passed to `YRMODA' must be on or after 15 Oct 1582. 15 Oct 1582 has a value of 1.  File: pspp.info, Node: Statistical Distribution Functions, Prev: Miscellaneous Functions, Up: Functions 5.7.10 Statistical Distribution Functions ----------------------------------------- PSPP can calculate several functions of standard statistical distributions. These functions are named systematically based on the function and the distribution. The table below describes the statistical distribution functions in general: PDF.DIST (X[, PARAM...]) Probability density function for DIST. The domain of X depends on DIST. For continuous distributions, the result is the density of the probability function at X, and the range is nonnegative real numbers. For discrete distributions, the result is the probability of X. CDF.DIST (X[, PARAM...]) Cumulative distribution function for DIST, that is, the probability that a random variate drawn from the distribution is less than X. The domain of X depends DIST. The result is a probability. SIG.DIST (X[, PARAM...) Tail probability function for DIST, that is, the probability that a random variate drawn from the distribution is greater than X. The domain of X depends DIST. The result is a probability. Only a few distributions include an SIG function. IDF.DIST (P[, PARAM...]) Inverse distribution function for DIST, the value of X for which the CDF would yield P. The value of P is a probability. The range depends on DIST and is identical to the domain for the corresponding CDF. RV.DIST ([PARAM...]) Random variate function for DIST. The range depends on the distribution. NPDF.DIST (X[, PARAM...]) Noncentral probability density function. The result is the density of the given noncentral distribution at X. The domain of X depends on DIST. The range is nonnegative real numbers. Only a few distributions include an NPDF function. NCDF.DIST (X[, PARAM...]) Noncentral cumulative distribution function for DIST, that is, the probability that a random variate drawn from the given noncentral distribution is less than X. The domain of X depends DIST. The result is a probability. Only a few distributions include an NCDF function. The individual distributions are described individually below. * Menu: * Continuous Distributions:: * Discrete Distributions::  File: pspp.info, Node: Continuous Distributions, Next: Discrete Distributions, Up: Statistical Distribution Functions 5.7.10.1 Continuous Distributions ................................. The following continuous distributions are available: -- Function: PDF.BETA (X) -- Function: CDF.BETA (X, A, B) -- Function: IDF.BETA (P, A, B) -- Function: RV.BETA (A, B) -- Function: NPDF.BETA (X, A, B, LAMBDA) -- Function: NCDF.BETA (X, A, B, LAMBDA) Beta distribution with shape parameters A and B. The noncentral distribution takes an additional parameter LAMBDA. Constraints: A > 0, B > 0, LAMBDA >= 0, 0 <= X <= 1, 0 <= P <= 1. -- Function: PDF.BVNOR (X0, X1, RHO) -- Function: CDF.VBNOR (X0, X1, RHO) Bivariate normal distribution of two standard normal variables with correlation coefficient RHO. Two variates X0 and X1 must be provided. Constraints: 0 <= RHO <= 1, 0 <= P <= 1. -- Function: PDF.CAUCHY (X, A, B) -- Function: CDF.CAUCHY (X, A, B) -- Function: IDF.CAUCHY (P, A, B) -- Function: RV.CAUCHY (A, B) Cauchy distribution with location parameter A and scale parameter B. Constraints: B > 0, 0 < P < 1. -- Function: PDF.CHISQ (X, DF) -- Function: CDF.CHISQ (X, DF) -- Function: SIG.CHISQ (X, DF) -- Function: IDF.CHISQ (P, DF) -- Function: RV.CHISQ (DF) -- Function: NPDF.CHISQ (X, DF, LAMBDA) -- Function: NCDF.CHISQ (X, DF, LAMBDA) Chi-squared distribution with DF degrees of freedom. The noncentral distribution takes an additional parameter LAMBDA. Constraints: DF > 0, LAMBDA > 0, X >= 0, 0 <= P < 1. -- Function: PDF.EXP (X, A) -- Function: CDF.EXP (X, A) -- Function: IDF.EXP (P, A) -- Function: RV.EXP (A) Exponential distribution with scale parameter A. The inverse of A represents the rate of decay. Constraints: A > 0, X >= 0, 0 <= P < 1. -- Function: PDF.XPOWER (X, A, B) -- Function: RV.XPOWER (A, B) Exponential power distribution with positive scale parameter A and nonnegative power parameter B. Constraints: A > 0, B >= 0, X >= 0, 0 <= P <= 1. This distribution is a PSPP extension. -- Function: PDF.F (X, DF1, DF2) -- Function: CDF.F (X, DF1, DF2) -- Function: SIG.F (X, DF1, DF2) -- Function: IDF.F (P, DF1, DF2) -- Function: RV.F (DF1, DF2) -- Function: NPDF.F (X, DF1, DF2, LAMBDA) -- Function: NCDF.F (X, DF1, DF2, LAMBDA) F-distribution of two chi-squared deviates with DF1 and DF2 degrees of freedom. The noncentral distribution takes an additional parameter LAMBDA. Constraints: DF1 > 0, DF2 > 0, LAMBDA >= 0, X >= 0, 0 <= P < 1. -- Function: PDF.GAMMA (X, A, B) -- Function: CDF.GAMMA (X, A, B) -- Function: IDF.GAMMA (P, A, B) -- Function: RV.GAMMA (A, B) Gamma distribution with shape parameter A and scale parameter B. Constraints: A > 0, B > 0, X >= 0, 0 <= P < 1. -- Function: PDF.HALFNRM (X, A, B) -- Function: CDF.HALFNRM (X, A, B) -- Function: IDF.HALFNRM (P, A, B) -- Function: RV.HALFNRM (A, B) Half-normal distribution with location parameter A and shape parameter B. Constraints: B > 0, 0 < P < 1. -- Function: PDF.IGAUSS (X, A, B) -- Function: CDF.IGAUSS (X, A, B) -- Function: IDF.IGAUSS (P, A, B) -- Function: RV.IGAUSS (A, B) Inverse Gaussian distribution with parameters A and B. Constraints: A > 0, B > 0, X > 0, 0 <= P < 1. -- Function: PDF.LANDAU (X) -- Function: RV.LANDAU () Landau distribution. -- Function: PDF.LAPLACE (X, A, B) -- Function: CDF.LAPLACE (X, A, B) -- Function: IDF.LAPLACE (P, A, B) -- Function: RV.LAPLACE (A, B) Laplace distribution with location parameter A and scale parameter B. Constraints: B > 0, 0 < P < 1. -- Function: RV.LEVY (C, ALPHA) Levy symmetric alpha-stable distribution with scale C and exponent ALPHA. Constraints: 0 < ALPHA <= 2. -- Function: RV.LVSKEW (C, ALPHA, BETA) Levy skew alpha-stable distribution with scale C, exponent ALPHA, and skewness parameter BETA. Constraints: 0 < ALPHA <= 2, -1 <= BETA <= 1. -- Function: PDF.LOGISTIC (X, A, B) -- Function: CDF.LOGISTIC (X, A, B) -- Function: IDF.LOGISTIC (P, A, B) -- Function: RV.LOGISTIC (A, B) Logistic distribution with location parameter A and scale parameter B. Constraints: B > 0, 0 < P < 1. -- Function: PDF.LNORMAL (X, A, B) -- Function: CDF.LNORMAL (X, A, B) -- Function: IDF.LNORMAL (P, A, B) -- Function: RV.LNORMAL (A, B) Lognormal distribution with parameters A and B. Constraints: A > 0, B > 0, X >= 0, 0 <= P < 1. -- Function: PDF.NORMAL (X, MU, SIGMA) -- Function: CDF.NORMAL (X, MU, SIGMA) -- Function: IDF.NORMAL (P, MU, SIGMA) -- Function: RV.NORMAL (MU, SIGMA) Normal distribution with mean MU and standard deviation SIGMA. Constraints: B > 0, 0 < P < 1. Three additional functions are available as shorthand: -- Function: CDFNORM (X) Equivalent to CDF.NORMAL(X, 0, 1). -- Function: PROBIT (P) Equivalent to IDF.NORMAL(P, 0, 1). -- Function: NORMAL (SIGMA) Equivalent to RV.NORMAL(0, SIGMA). -- Function: PDF.NTAIL (X, A, SIGMA) -- Function: RV.NTAIL (A, SIGMA) Normal tail distribution with lower limit A and standard deviation SIGMA. This distribution is a PSPP extension. Constraints: A > 0, X > A, 0 < P < 1. -- Function: PDF.PARETO (X, A, B) -- Function: CDF.PARETO (X, A, B) -- Function: IDF.PARETO (P, A, B) -- Function: RV.PARETO (A, B) Pareto distribution with threshold parameter A and shape parameter B. Constraints: A > 0, B > 0, X >= A, 0 <= P < 1. -- Function: PDF.RAYLEIGH (X, SIGMA) -- Function: CDF.RAYLEIGH (X, SIGMA) -- Function: IDF.RAYLEIGH (P, SIGMA) -- Function: RV.RAYLEIGH (SIGMA) Rayleigh distribution with scale parameter SIGMA. This distribution is a PSPP extension. Constraints: SIGMA > 0, X > 0. -- Function: PDF.RTAIL (X, A, SIGMA) -- Function: RV.RTAIL (A, SIGMA) Rayleigh tail distribution with lower limit A and scale parameter SIGMA. This distribution is a PSPP extension. Constraints: A > 0, SIGMA > 0, X > A. -- Function: CDF.SMOD (X, A, B) -- Function: IDF.SMOD (P, A, B) Studentized maximum modulus distribution with parameters A and B. Constraints: A > 0, B > 0, X > 0, 0 <= P < 1. -- Function: CDF.SRANGE (X, A, B) -- Function: IDF.SRANGE (P, A, B) Studentized range distribution with parameters A and B. Constraints: A >= 1, B >= 1, X > 0, 0 <= P < 1. -- Function: PDF.T (X, DF) -- Function: CDF.T (X, DF) -- Function: IDF.T (P, DF) -- Function: RV.T (DF) -- Function: NPDF.T (X, DF, LAMBDA) -- Function: NCDF.T (X, DF, LAMBDA) T-distribution with DF degrees of freedom. The noncentral distribution takes an additional parameter LAMBDA. Constraints: DF > 0, 0 < P < 1. -- Function: PDF.T1G (X, A, B) -- Function: CDF.T1G (X, A, B) -- Function: IDF.T1G (P, A, B) Type-1 Gumbel distribution with parameters A and B. This distribution is a PSPP extension. Constraints: 0 < P < 1. -- Function: PDF.T2G (X, A, B) -- Function: CDF.T2G (X, A, B) -- Function: IDF.T2G (P, A, B) Type-2 Gumbel distribution with parameters A and B. This distribution is a PSPP extension. Constraints: X > 0, 0 < P < 1. -- Function: PDF.UNIFORM (X, A, B) -- Function: CDF.UNIFORM (X, A, B) -- Function: IDF.UNIFORM (P, A, B) -- Function: RV.UNIFORM (A, B) Uniform distribution with parameters A and B. Constraints: A <= X <= B, 0 <= P <= 1. An additional function is available as shorthand: -- Function: UNIFORM (B) Equivalent to RV.UNIFORM(0, B). -- Function: PDF.WEIBULL (X, A, B) -- Function: CDF.WEIBULL (X, A, B) -- Function: IDF.WEIBULL (P, A, B) -- Function: RV.WEIBULL (A, B) Weibull distribution with parameters A and B. Constraints: A > 0, B > 0, X >= 0, 0 <= P < 1.  File: pspp.info, Node: Discrete Distributions, Prev: Continuous Distributions, Up: Statistical Distribution Functions 5.7.10.2 Discrete Distributions ............................... The following discrete distributions are available: -- Function: PDF.BERNOULLI (X) -- Function: CDF.BERNOULLI (X, P) -- Function: RV.BERNOULLI (P) Bernoulli distribution with probability of success P. Constraints: X = 0 or 1, 0 <= P <= 1. -- Function: PDF.BINOMIAL (X, N, P) -- Function: CDF.BINOMIAL (X, N, P) -- Function: RV.BINOMIAL (N, P) Binomial distribution with N trials and probability of success P. Constraints: integer N > 0, 0 <= P <= 1, integer X <= N. -- Function: PDF.GEOM (X, N, P) -- Function: CDF.GEOM (X, N, P) -- Function: RV.GEOM (N, P) Geometric distribution with probability of success P. Constraints: 0 <= P <= 1, integer X > 0. -- Function: PDF.HYPER (X, A, B, C) -- Function: CDF.HYPER (X, A, B, C) -- Function: RV.HYPER (A, B, C) Hypergeometric distribution when B objects out of A are drawn and C of the available objects are distinctive. Constraints: integer A > 0, integer B <= A, integer C <= A, integer X >= 0. -- Function: PDF.LOG (X, P) -- Function: RV.LOG (P) Logarithmic distribution with probability parameter P. Constraints: 0 <= P < 1, X >= 1. -- Function: PDF.NEGBIN (X, N, P) -- Function: CDF.NEGBIN (X, N, P) -- Function: RV.NEGBIN (N, P) Negative binomial distribution with number of successes paramter N and probability of success parameter P. Constraints: integer N >= 0, 0 < P <= 1, integer X >= 1. -- Function: PDF.POISSON (X, MU) -- Function: CDF.POISSON (X, MU) -- Function: RV.POISSON (MU) Poisson distribution with mean MU. Constraints: MU > 0, integer X >= 0.  File: pspp.info, Node: Order of Operations, Prev: Functions, Up: Expressions 5.8 Operator Precedence ======================= The following table describes operator precedence. Smaller-numbered levels in the table have higher precedence. Within a level, operations are always performed from left to right. The first occurrence of `-' represents unary negation, the second binary subtraction. 1. `( )' 2. `**' 3. `-' 4. `* /' 5. `+ -' 6. `EQ GE GT LE LT NE' 7. `AND NOT OR'  File: pspp.info, Node: Data Input and Output, Next: System and Portable Files, Prev: Expressions, Up: Top 6 Data Input and Output *********************** Data are the focus of the PSPP language. Each datum belongs to a "case" (also called an "observation"). Each case represents an individual or `experimental unit'. For example, in the results of a survey, the names of the respondents, their sex, age etc. and their responses are all data and the data pertaining to single respondent is a case. This chapter examines the PSPP commands for defining variables and reading and writing data. *Please note:* Data is not actually read until a procedure is executed. These commands tell PSPP how to read data, but they do not _cause_ PSPP to read data. * Menu: * BEGIN DATA:: Embed data within a syntax file. * CLEAR TRANSFORMATIONS:: Clear pending transformations. * DATA LIST:: Fundamental data reading command. * END CASE:: Output the current case. * END FILE:: Terminate the current input program. * FILE HANDLE:: Support for fixed-length records. * INPUT PROGRAM:: Support for complex input programs. * LIST:: List cases in the active file. * MATRIX DATA:: Read matrices in text format. * NEW FILE:: Clear the active file and dictionary. * PRINT:: Display values in print formats. * PRINT EJECT:: Eject the current page then print. * PRINT SPACE:: Print blank lines. * REREAD:: Take another look at the previous input line. * REPEATING DATA:: Multiple cases on a single line. * WRITE:: Display values in write formats.  File: pspp.info, Node: BEGIN DATA, Next: CLEAR TRANSFORMATIONS, Prev: Data Input and Output, Up: Data Input and Output 6.1 BEGIN DATA ============== BEGIN DATA. ... END DATA. BEGIN DATA and END DATA can be used to embed raw ASCII data in a PSPP syntax file. DATA LIST or another input procedure must be used before BEGIN DATA (*note DATA LIST::). BEGIN DATA and END DATA must be used together. END DATA must appear by itself on a single line, with no leading white space and exactly one space between the words `END' and `DATA', like this: END DATA.  File: pspp.info, Node: CLEAR TRANSFORMATIONS, Next: DATA LIST, Prev: BEGIN DATA, Up: Data Input and Output 6.2 CLEAR TRANSFORMATIONS ========================= CLEAR TRANSFORMATIONS. CLEAR TRANSFORMATIONS clears out all pending transformations. It does not cancel the current input program. It is valid only when PSPP is interactive, not in syntax files.  File: pspp.info, Node: DATA LIST, Next: END CASE, Prev: CLEAR TRANSFORMATIONS, Up: Data Input and Output 6.3 DATA LIST ============= Used to read text or binary data, DATA LIST is the most fundamental data-reading command. Even the more sophisticated input methods use DATA LIST commands as a building block. Understanding DATA LIST is important to understanding how to use PSPP to read your data files. There are two major variants of DATA LIST, which are fixed format and free format. In addition, free format has a minor variant, list format, which is discussed in terms of its differences from vanilla free format. Each form of DATA LIST is described in detail below. * Menu: * DATA LIST FIXED:: Fixed columnar locations for data. * DATA LIST FREE:: Any spacing you like. * DATA LIST LIST:: Each case must be on a single line.  File: pspp.info, Node: DATA LIST FIXED, Next: DATA LIST FREE, Prev: DATA LIST, Up: DATA LIST 6.3.1 DATA LIST FIXED --------------------- DATA LIST [FIXED] {TABLE,NOTABLE} FILE='filename' RECORDS=record_count END=end_var /[line_no] var_spec... where each var_spec takes one of the forms var_list start-end [type_spec] var_list (fortran_spec) DATA LIST FIXED is used to read data files that have values at fixed positions on each line of single-line or multiline records. The keyword FIXED is optional. The FILE subcommand must be used if input is to be taken from an external file. It may be used to specify a filename as a string or a file handle (*note FILE HANDLE::). If the FILE subcommand is not used, then input is assumed to be specified within the command file using BEGIN DATA...END DATA (*note BEGIN DATA::). The optional RECORDS subcommand, which takes a single integer as an argument, is used to specify the number of lines per record. If RECORDS is not specified, then the number of lines per record is calculated from the list of variable specifications later in DATA LIST. The END subcommand is only useful in conjunction with INPUT PROGRAM. *Note INPUT PROGRAM::, for details. DATA LIST can optionally output a table describing how the data file will be read. The TABLE subcommand enables this output, and NOTABLE disables it. The default is to output the table. The list of variables to be read from the data list must come last. Each line in the data record is introduced by a slash (`/'). Optionally, a line number may follow the slash. Following, any number of variable specifications may be present. Each variable specification consists of a list of variable names followed by a description of their location on the input line. Sets of variables may specified using the `DATA LIST' TO convention (*note Sets of Variables::). There are two ways to specify the location of the variable on the line: columnar style and FORTRAN style. In columnar style, the starting column and ending column for the field are specified after the variable name, separated by a dash (`-'). For instance, the third through fifth columns on a line would be specified `3-5'. By default, variables are considered to be in `F' format (*note Input/Output Formats::). (This default can be changed; see *Note SET:: for more information.) In columnar style, to use a variable format other than the default, specify the format type in parentheses after the column numbers. For instance, for alphanumeric `A' format, use `(A)'. In addition, implied decimal places can be specified in parentheses after the column numbers. As an example, suppose that a data file has a field in which the characters `1234' should be interpreted as having the value 12.34. Then this field has two implied decimal places, and the corresponding specification would be `(2)'. If a field that has implied decimal places contains a decimal point, then the implied decimal places are not applied. Changing the variable format and adding implied decimal places can be done together; for instance, `(N,5)'. When using columnar style, the input and output width of each variable is computed from the field width. The field width must be evenly divisible into the number of variables specified. FORTRAN style is an altogether different approach to specifying field locations. With this approach, a list of variable input format specifications, separated by commas, are placed after the variable names inside parentheses. Each format specifier advances as many characters into the input line as it uses. Implied decimal places also exist in FORTRAN style. A format specification with D decimal places also has D implied decimal places. In addition to the standard format specifiers (*note Input/Output Formats::), FORTRAN style defines some extensions: `X' Advance the current column on this line by one character position. `T'X Set the current column on this line to column X, with column numbers considered to begin with 1 at the left margin. `NEWREC'X Skip forward X lines in the current record, resetting the active column to the left margin. Repeat count Any format specifier may be preceded by a number. This causes the action of that format specifier to be repeated the specified number of times. (SPEC1, ..., SPECN) Group the given specifiers together. This is most useful when preceded by a repeat count. Groups may be nested arbitrarily. FORTRAN and columnar styles may be freely intermixed. Columnar style leaves the active column immediately after the ending column specified. Record motion using `NEWREC' in FORTRAN style also applies to later FORTRAN and columnar specifiers. * Menu: * DATA LIST FIXED Examples:: Examples of DATA LIST FIXED.  File: pspp.info, Node: DATA LIST FIXED Examples, Prev: DATA LIST FIXED, Up: DATA LIST FIXED Examples ........ 1. DATA LIST TABLE /NAME 1-10 (A) INFO1 TO INFO3 12-17 (1). BEGIN DATA. John Smith 102311 Bob Arnold 122015 Bill Yates 918 6 END DATA. Defines the following variables: * `NAME', a 10-character-wide long string variable, in columns 1 through 10. * `INFO1', a numeric variable, in columns 12 through 13. * `INFO2', a numeric variable, in columns 14 through 15. * `INFO3', a numeric variable, in columns 16 through 17. The `BEGIN DATA'/`END DATA' commands cause three cases to be defined: Case NAME INFO1 INFO2 INFO3 1 John Smith 10 23 11 2 Bob Arnold 12 20 15 3 Bill Yates 9 18 6 The `TABLE' keyword causes PSPP to print out a table describing the four variables defined. 2. DAT LIS FIL="survey.dat" /ID 1-5 NAME 7-36 (A) SURNAME 38-67 (A) MINITIAL 69 (A) /Q01 TO Q50 7-56 /. Defines the following variables: * `ID', a numeric variable, in columns 1-5 of the first record. * `NAME', a 30-character long string variable, in columns 7-36 of the first record. * `SURNAME', a 30-character long string variable, in columns 38-67 of the first record. * `MINITIAL', a 1-character short string variable, in column 69 of the first record. * Fifty variables `Q01', `Q02', `Q03', ..., `Q49', `Q50', all numeric, `Q01' in column 7, `Q02' in column 8, ..., `Q49' in column 55, `Q50' in column 56, all in the second record. Cases are separated by a blank record. Data is read from file `survey.dat' in the current directory. This example shows keywords abbreviated to their first 3 letters.  File: pspp.info, Node: DATA LIST FREE, Next: DATA LIST LIST, Prev: DATA LIST FIXED, Up: DATA LIST 6.3.2 DATA LIST FREE -------------------- DATA LIST FREE [({TAB,'c'}, ...)] [{NOTABLE,TABLE}] FILE='filename' END=end_var /var_spec... where each var_spec takes one of the forms var_list [(type_spec)] var_list * In free format, the input data is, by default, structured as a series of fields separated by spaces, tabs, commas, or line breaks. Each field's content may be unquoted, or it may be quoted with a pairs of apostrophes (`'') or double quotes (`"'). Unquoted white space separates fields but is not part of any field. Any mix of spaces, tabs, and line breaks is equivalent to a single space for the purpose of separating fields, but consecutive commas will skip a field. Alternatively, delimiters can be specified explicitly, as a parenthesized, comma-separated list of single-character strings immediately following FREE. The word TAB may also be used to specify a tab character as a delimiter. When delimiters are specified explicitly, only the given characters, plus line breaks, separate fields. Furthermore, leading spaces at the beginnings of fields are not trimmed, consecutive delimiters define empty fields, and no form of quoting is allowed. The NOTABLE and TABLE subcommands are as in DATA LIST FIXED above. NOTABLE is the default. The FILE and END subcommands are as in DATA LIST FIXED above. The variables to be parsed are given as a single list of variable names. This list must be introduced by a single slash (`/'). The set of variable names may contain format specifications in parentheses (*note Input/Output Formats::). Format specifications apply to all variables back to the previous parenthesized format specification. In addition, an asterisk may be used to indicate that all variables preceding it are to have input/output format `F8.0'. Specified field widths are ignored on input, although all normal limits on field width apply, but they are honored on output.  File: pspp.info, Node: DATA LIST LIST, Prev: DATA LIST FREE, Up: DATA LIST 6.3.3 DATA LIST LIST -------------------- DATA LIST LIST [({TAB,'c'}, ...)] [{NOTABLE,TABLE}] FILE='filename' END=end_var /var_spec... where each var_spec takes one of the forms var_list [(type_spec)] var_list * With one exception, DATA LIST LIST is syntactically and semantically equivalent to DATA LIST FREE. The exception is that each input line is expected to correspond to exactly one input record. If more or fewer fields are found on an input line than expected, an appropriate diagnostic is issued.  File: pspp.info, Node: END CASE, Next: END FILE, Prev: DATA LIST, Up: Data Input and Output 6.4 END CASE ============ END CASE. END CASE is used only within INPUT PROGRAM to output the current case. *Note INPUT PROGRAM::, for details.  File: pspp.info, Node: END FILE, Next: FILE HANDLE, Prev: END CASE, Up: Data Input and Output 6.5 END FILE ============ END FILE. END FILE is used only within INPUT PROGRAM to terminate the current input program. *Note INPUT PROGRAM::.  File: pspp.info, Node: FILE HANDLE, Next: INPUT PROGRAM, Prev: END FILE, Up: Data Input and Output 6.6 FILE HANDLE =============== FILE HANDLE handle_name /NAME='filename' /MODE={CHARACTER,IMAGE} /LRECL=rec_len /TABWIDTH=tab_width Use FILE HANDLE to associate a file handle name with a file and its attributes, so that later commands can refer to the file by its handle name. Because names of text files can be specified directly on commands that access files, FILE HANDLE is only needed when a file is not an ordinary file containing lines of text. However, FILE HANDLE may be used even for text files, and it may be easier to specify a file's name once and later refer to it by an abstract handle. Specify the file handle name as an identifier. Any given identifier may only appear once in a PSPP run. File handles may not be reassigned to a different file. The file handle name must immediately follow the FILE HANDLE command name. The NAME subcommand specifies the name of the file associated with the handle. It is the only required subcommand. MODE specifies a file mode. In CHARACTER mode, the default, the data file is opened in ANSI C text mode, so that local end of line conventions are followed, and each text line is read as one record. In CHARACTER mode, most input programs will expand tabs to spaces (DATA LIST FREE with explicitly specified delimiters is an exception). By default, each tab is 4 characters wide, but an alternate width may be specified on TABWIDTH. A tab width of 0 suppresses tab expansion entirely. By contrast, in BINARY mode, the data file is opened in ANSI C binary mode and records are a fixed length. In BINARY mode, LRECL specifies the record length in bytes, with a default of 1024. Tab characters are never expanded to spaces in binary mode.  File: pspp.info, Node: INPUT PROGRAM, Next: LIST, Prev: FILE HANDLE, Up: Data Input and Output 6.7 INPUT PROGRAM ================= INPUT PROGRAM. ... input commands ... END INPUT PROGRAM. INPUT PROGRAM...END INPUT PROGRAM specifies a complex input program. By placing data input commands within INPUT PROGRAM, PSPP programs can take advantage of more complex file structures than available with only DATA LIST. The first sort of extended input program is to simply put multiple DATA LIST commands within the INPUT PROGRAM. This will cause all of the data files to be read in parallel. Input will stop when end of file is reached on any of the data files. Transformations, such as conditional and looping constructs, can also be included within INPUT PROGRAM. These can be used to combine input from several data files in more complex ways. However, input will still stop when end of file is reached on any of the data files. To prevent INPUT PROGRAM from terminating at the first end of file, use the END subcommand on DATA LIST. This subcommand takes a variable name, which should be a numeric scratch variable (*note Scratch Variables::). (It need not be a scratch variable but otherwise the results can be surprising.) The value of this variable is set to 0 when reading the data file, or 1 when end of file is encountered. Two additional commands are useful in conjunction with INPUT PROGRAM. END CASE is the first. Normally each loop through the INPUT PROGRAM structure produces one case. END CASE controls exactly when cases are output. When END CASE is used, looping from the end of INPUT PROGRAM to the beginning does not cause a case to be output. END FILE is the second. When the END subcommand is used on DATA LIST, there is no way for the INPUT PROGRAM construct to stop looping, so an infinite loop results. END FILE, when executed, stops the flow of input data and passes out of the INPUT PROGRAM structure. All this is very confusing. A few examples should help to clarify. INPUT PROGRAM. DATA LIST NOTABLE FILE='a.data'/X 1-10. DATA LIST NOTABLE FILE='b.data'/Y 1-10. END INPUT PROGRAM. LIST. The example above reads variable X from file `a.data' and variable Y from file `b.data'. If one file is shorter than the other then the extra data in the longer file is ignored. INPUT PROGRAM. NUMERIC #A #B. DO IF NOT #A. DATA LIST NOTABLE END=#A FILE='a.data'/X 1-10. END IF. DO IF NOT #B. DATA LIST NOTABLE END=#B FILE='b.data'/Y 1-10. END IF. DO IF #A AND #B. END FILE. END IF. END CASE. END INPUT PROGRAM. LIST. The above example reads variable X from `a.data' and variable Y from `b.data'. If one file is shorter than the other then the missing field is set to the system-missing value alongside the present value for the remaining length of the longer file. INPUT PROGRAM. NUMERIC #A #B. DO IF #A. DATA LIST NOTABLE END=#B FILE='b.data'/X 1-10. DO IF #B. END FILE. ELSE. END CASE. END IF. ELSE. DATA LIST NOTABLE END=#A FILE='a.data'/X 1-10. DO IF NOT #A. END CASE. END IF. END IF. END INPUT PROGRAM. LIST. The above example reads data from file `a.data', then from `b.data', and concatenates them into a single active file. INPUT PROGRAM. NUMERIC #EOF. LOOP IF NOT #EOF. DATA LIST NOTABLE END=#EOF FILE='a.data'/X 1-10. DO IF NOT #EOF. END CASE. END IF. END LOOP. COMPUTE #EOF = 0. LOOP IF NOT #EOF. DATA LIST NOTABLE END=#EOF FILE='b.data'/X 1-10. DO IF NOT #EOF. END CASE. END IF. END LOOP. END FILE. END INPUT PROGRAM. LIST. The above example does the same thing as the previous example, in a different way. INPUT PROGRAM. LOOP #I=1 TO 50. COMPUTE X=UNIFORM(10). END CASE. END LOOP. END FILE. END INPUT PROGRAM. LIST/FORMAT=NUMBERED. The above example causes an active file to be created consisting of 50 random variates between 0 and 10.  File: pspp.info, Node: LIST, Next: MATRIX DATA, Prev: INPUT PROGRAM, Up: Data Input and Output 6.8 LIST ======== LIST /VARIABLES=var_list /CASES=FROM start_index TO end_index BY incr_index /FORMAT={UNNUMBERED,NUMBERED} {WRAP,SINGLE} {NOWEIGHT,WEIGHT} The LIST procedure prints the values of specified variables to the listing file. The VARIABLES subcommand specifies the variables whose values are to be printed. Keyword VARIABLES is optional. If VARIABLES subcommand is not specified then all variables in the active file are printed. The CASES subcommand can be used to specify a subset of cases to be printed. Specify FROM and the case number of the first case to print, TO and the case number of the last case to print, and BY and the number of cases to advance between printing cases, or any subset of those settings. If CASES is not specified then all cases are printed. The FORMAT subcommand can be used to change the output format. NUMBERED will print case numbers along with each case; UNNUMBERED, the default, causes the case numbers to be omitted. The WRAP and SINGLE settings are currently not used. WEIGHT will cause case weights to be printed along with variable values; NOWEIGHT, the default, causes case weights to be omitted from the output. Case numbers start from 1. They are counted after all transformations have been considered. LIST attempts to fit all the values on a single line. If needed to make them fit, variable names are displayed vertically. If values cannot fit on a single line, then a multi-line format will be used. LIST is a procedure. It causes the data to be read.  File: pspp.info, Node: MATRIX DATA, Next: NEW FILE, Prev: LIST, Up: Data Input and Output 6.9 MATRIX DATA =============== MATRIX DATA /VARIABLES=var_list /FILE='filename' /FORMAT={LIST,FREE} {LOWER,UPPER,FULL} {DIAGONAL,NODIAGONAL} /SPLIT={new_var,var_list} /FACTORS=var_list /CELLS=n_cells /N=n /CONTENTS={N_VECTOR,N_SCALAR,N_MATRIX,MEAN,STDDEV,COUNT,MSE, DFE,MAT,COV,CORR,PROX} MATRIX DATA command reads square matrices in one of several textual formats. MATRIX DATA clears the dictionary and replaces it and reads a data file. Use VARIABLES to specify the variables that form the rows and columns of the matrices. You may not specify a variable named `VARNAME_'. You should specify VARIABLES first. Specify the file to read on FILE, either as a file name string or a file handle (*note FILE HANDLE::). If FILE is not specified then matrix data must immediately follow MATRIX DATA with a BEGIN DATA...END DATA construct (*note BEGIN DATA::). The FORMAT subcommand specifies how the matrices are formatted. LIST, the default, indicates that there is one line per row of matrix data; FREE allows single matrix rows to be broken across multiple lines. This is analogous to the difference between DATA LIST FREE and DATA LIST LIST (*note DATA LIST::). LOWER, the default, indicates that the lower triangle of the matrix is given; UPPER indicates the upper triangle; and FULL indicates that the entire matrix is given. DIAGONAL, the default, indicates that the diagonal is part of the data; NODIAGONAL indicates that it is omitted. DIAGONAL/NODIAGONAL have no effect when FULL is specified. The SPLIT subcommand is used to specify SPLIT FILE variables for the input matrices (*note SPLIT FILE::). Specify either a single variable not specified on VARIABLES, or one or more variables that are specified on VARIABLES. In the former case, the SPLIT values are not present in the data and ROWTYPE_ may not be specified on VARIABLES. In the latter case, the SPLIT values are present in the data. Specify a list of factor variables on FACTORS. Factor variables must also be listed on VARIABLES. Factor variables are used when there are some variables where, for each possible combination of their values, statistics on the matrix variables are included in the data. If FACTORS is specified and ROWTYPE_ is not specified on VARIABLES, the CELLS subcommand is required. Specify the number of factor variable combinations that are given. For instance, if factor variable A has 2 values and factor variable B has 3 values, specify 6. The N subcommand specifies a population number of observations. When N is specified, one N record is output for each SPLIT FILE. Use CONTENTS to specify what sort of information the matrices include. Each possible option is described in more detail below. When ROWTYPE_ is specified on VARIABLES, CONTENTS is optional; otherwise, if CONTENTS is not specified then /CONTENTS=CORR is assumed. N N_VECTOR Number of observations as a vector, one value for each variable. N_SCALAR Number of observations as a single value. N_MATRIX Matrix of counts. MEAN Vector of means. STDDEV Vector of standard deviations. COUNT Vector of counts. MSE Vector of mean squared errors. DFE Vector of degrees of freedom. MAT Generic matrix. COV Covariance matrix. CORR Correlation matrix. PROX Proximities matrix. The exact semantics of the matrices read by MATRIX DATA are complex. Right now MATRIX DATA isn't too useful due to a lack of procedures accepting or producing related data, so these semantics aren't documented. Later, they'll be described here in detail.  File: pspp.info, Node: NEW FILE, Next: PRINT, Prev: MATRIX DATA, Up: Data Input and Output 6.10 NEW FILE ============= NEW FILE. NEW FILE command clears the current active file.  File: pspp.info, Node: PRINT, Next: PRINT EJECT, Prev: NEW FILE, Up: Data Input and Output 6.11 PRINT ========== PRINT OUTFILE='filename' RECORDS=n_lines {NOTABLE,TABLE} /[line_no] arg... arg takes one of the following forms: 'string' [start-end] var_list start-end [type_spec] var_list (fortran_spec) var_list * The PRINT transformation writes variable data to an output file. PRINT is executed when a procedure causes the data to be read. Follow PRINT by EXECUTE to print variable data without invoking a procedure (*note EXECUTE::). All PRINT subcommands are optional. The OUTFILE subcommand specifies the file to receive the output. The file may be a file name as a string or a file handle (*note FILE HANDLE::). If OUTFILE is not present then output will be sent to PSPP's output listing file. The RECORDS subcommand specifies the number of lines to be output. The number of lines may optionally be surrounded by parentheses. TABLE will cause the PRINT command to output a table to the listing file that describes what it will print to the output file. NOTABLE, the default, suppresses this output table. Introduce the strings and variables to be printed with a slash (`/'). Optionally, the slash may be followed by a number indicating which output line will be specified. In the absence of this line number, the next line number will be specified. Multiple lines may be specified using multiple slashes with the intended output for a line following its respective slash. Literal strings may be printed. Specify the string itself. Optionally the string may be followed by a column number or range of column numbers, specifying the location on the line for the string to be printed. Otherwise, the string will be printed at the current position on the line. Variables to be printed can be specified in the same ways as available for DATA LIST FIXED (*note DATA LIST FIXED::). In addition, a variable list may be followed by an asterisk (`*'), which indicates that the variables should be printed in their dictionary print formats, separated by spaces. A variable list followed by a slash or the end of command will be interpreted the same way. If a FORTRAN type specification is used to move backwards on the current line, then text is written at that point on the line, the line will be truncated to that length, although additional text being added will again extend the line to that length.  File: pspp.info, Node: PRINT EJECT, Next: PRINT SPACE, Prev: PRINT, Up: Data Input and Output 6.12 PRINT EJECT ================ PRINT EJECT OUTFILE='filename' RECORDS=n_lines {NOTABLE,TABLE} /[line_no] arg... arg takes one of the following forms: 'string' [start-end] var_list start-end [type_spec] var_list (fortran_spec) var_list * PRINT EJECT writes data to an output file. Before the data is written, the current page in the listing file is ejected. *Note PRINT::, for more information on syntax and usage.  File: pspp.info, Node: PRINT SPACE, Next: REREAD, Prev: PRINT EJECT, Up: Data Input and Output 6.13 PRINT SPACE ================ PRINT SPACE OUTFILE='filename' n_lines. PRINT SPACE prints one or more blank lines to an output file. The OUTFILE subcommand is optional. It may be used to direct output to a file specified by file name as a string or file handle (*note FILE HANDLE::). If OUTFILE is not specified then output will be directed to the listing file. n_lines is also optional. If present, it is an expression (*note Expressions::) specifying the number of blank lines to be printed. The expression must evaluate to a nonnegative value.  File: pspp.info, Node: REREAD, Next: REPEATING DATA, Prev: PRINT SPACE, Up: Data Input and Output 6.14 REREAD =========== REREAD FILE=handle COLUMN=column. The REREAD transformation allows the previous input line in a data file already processed by DATA LIST or another input command to be re-read for further processing. The FILE subcommand, which is optional, is used to specify the file to have its line re-read. The file must be specified in the form of a file handle (*note FILE HANDLE::). If FILE is not specified then the last file specified on DATA LIST will be assumed (last file specified lexically, not in terms of flow-of-control). By default, the line re-read is re-read in its entirety. With the COLUMN subcommand, a prefix of the line can be exempted from re-reading. Specify an expression (*note Expressions::) evaluating to the first column that should be included in the re-read line. Columns are numbered from 1 at the left margin. Issuing `REREAD' multiple times will not back up in the data file. Instead, it will re-read the same line multiple times.  File: pspp.info, Node: REPEATING DATA, Next: WRITE, Prev: REREAD, Up: Data Input and Output 6.15 REPEATING DATA =================== REPEATING DATA /STARTS=start-end /OCCURS=n_occurs /FILE='filename' /LENGTH=length /CONTINUED[=cont_start-cont_end] /ID=id_start-id_end=id_var /{TABLE,NOTABLE} /DATA=var_spec... where each var_spec takes one of the forms var_list start-end [type_spec] var_list (fortran_spec) REPEATING DATA parses groups of data repeating in a uniform format, possibly with several groups on a single line. Each group of data corresponds with one case. REPEATING DATA may only be used within an INPUT PROGRAM structure (*note INPUT PROGRAM::). When used with DATA LIST, it can be used to parse groups of cases that share a subset of variables but differ in their other data. The STARTS subcommand is required. Specify a range of columns, using literal numbers or numeric variable names. This range specifies the columns on the first line that are used to contain groups of data. The ending column is optional. If it is not specified, then the record width of the input file is used. For the inline file (*note BEGIN DATA::) this is 80 columns; for a file with fixed record widths it is the record width; for other files it is 1024 characters by default. The OCCURS subcommand is required. It must be a number or the name of a numeric variable. Its value is the number of groups present in the current record. The DATA subcommand is required. It must be the last subcommand specified. It is used to specify the data present within each repeating group. Column numbers are specified relative to the beginning of a group at column 1. Data is specified in the same way as with DATA LIST FIXED (*note DATA LIST FIXED::). All other subcommands are optional. FILE specifies the file to read, either a file name as a string or a file handle (*note FILE HANDLE::). If FILE is not present then the default is the last file handle used on DATA LIST (lexically, not in terms of flow of control). By default REPEATING DATA will output a table describing how it will parse the input data. Specifying NOTABLE will disable this behavior; specifying TABLE will explicitly enable it. The LENGTH subcommand specifies the length in characters of each group. If it is not present then length is inferred from the DATA subcommand. LENGTH can be a number or a variable name. Normally all the data groups are expected to be present on a single line. Use the CONTINUED command to indicate that data can be continued onto additional lines. If data on continuation lines starts at the left margin and continues through the entire field width, no column specifications are necessary on CONTINUED. Otherwise, specify the possible range of columns in the same way as on STARTS. When data groups are continued from line to line, it is easy for cases to get out of sync through careless hand editing. The ID subcommand allows a case identifier to be present on each line of repeating data groups. REPEATING DATA will check for the same identifier on each line and report mismatches. Specify the range of columns that the identifier will occupy, followed by an equals sign (`=') and the identifier variable name. The variable must already have been declared with NUMERIC or another command. REPEATING DATA should be the last command given within an INPUT PROGRAM. It should not be enclosed within a LOOP structure (*note LOOP::). Use DATA LIST before, not after, REPEATING DATA.  File: pspp.info, Node: WRITE, Prev: REPEATING DATA, Up: Data Input and Output 6.16 WRITE ========== WRITE OUTFILE='filename' RECORDS=n_lines {NOTABLE,TABLE} /[line_no] arg... arg takes one of the following forms: 'string' [start-end] var_list start-end [type_spec] var_list (fortran_spec) var_list * `WRITE' writes text or binary data to an output file. *Note PRINT::, for more information on syntax and usage. The main difference between `PRINT' and `WRITE' is that WRITE uses write formats by default, where PRINT uses print formats. The sole additional difference is that if WRITE is used to send output to a binary file, carriage control characters will not be output. *Note FILE HANDLE::, for information on how to declare a file as binary.  File: pspp.info, Node: System and Portable Files, Next: Variable Attributes, Prev: Data Input and Output, Up: Top 7 System Files and Portable Files ********************************* The commands in this chapter read, write, and examine system files and portable files. * Menu: * APPLY DICTIONARY:: Apply system file dictionary to active file. * EXPORT:: Write to a portable file. * GET:: Read from a system file. * IMPORT:: Read from a portable file. * MATCH FILES:: Merge system files. * SAVE:: Write to a system file. * SYSFILE INFO:: Display system file dictionary. * XSAVE:: Write to a system file, as a transform.  File: pspp.info, Node: APPLY DICTIONARY, Next: EXPORT, Prev: System and Portable Files, Up: System and Portable Files 7.1 APPLY DICTIONARY ==================== APPLY DICTIONARY FROM='filename'. APPLY DICTIONARY applies the variable labels, value labels, and missing values from variables in a system file to corresponding variables in the active file. In some cases it also updates the weighting variable. Specify a system file with a file name string or as a file handle (*note FILE HANDLE::). The dictionary in the system file will be read, but it will not replace the active file dictionary. The system file's data will not be read. Only variables with names that exist in both the active file and the system file are considered. Variables with the same name but different types (numeric, string) will cause an error message. Otherwise, the system file variables' attributes will replace those in their matching active file variables, as described below. If a system file variable has a variable label, then it will replace the active file variable's variable label. If the system file variable does not have a variable label, then the active file variable's variable label, if any, will be retained. If the active file variable is numeric or short string, then value labels and missing values, if any, will be copied to the active file variable. If the system file variable does not have value labels or missing values, then those in the active file variable, if any, will not be disturbed. Finally, weighting of the active file is updated (*note WEIGHT::). If the active file has a weighting variable, and the system file does not, or if the weighting variable in the system file does not exist in the active file, then the active file weighting variable, if any, is retained. Otherwise, the weighting variable in the system file becomes the active file weighting variable. APPLY DICTIONARY takes effect immediately. It does not read the active file. The system file is not modified.  File: pspp.info, Node: EXPORT, Next: GET, Prev: APPLY DICTIONARY, Up: System and Portable Files 7.2 EXPORT ========== EXPORT /OUTFILE='filename' /DROP=var_list /KEEP=var_list /RENAME=(src_names=target_names)... The EXPORT procedure writes the active file dictionary and data to a specified portable file. The OUTFILE subcommand, which is the only required subcommand, specifies the portable file to be written as a file name string or a file handle (*note FILE HANDLE::). DROP, KEEP, and RENAME follow the same format as the SAVE procedure (*note SAVE::). EXPORT is a procedure. It causes the active file to be read.  File: pspp.info, Node: GET, Next: IMPORT, Prev: EXPORT, Up: System and Portable Files 7.3 GET ======= GET /FILE='filename' /DROP=var_list /KEEP=var_list /RENAME=(src_names=target_names)... GET clears the current dictionary and active file and replaces them with the dictionary and data from a specified system file. The FILE subcommand is the only required subcommand. Specify the system file to be read as a string file name or a file handle (*note FILE HANDLE::). By default, all the variables in a system file are read. The DROP subcommand can be used to specify a list of variables that are not to be read. By contrast, the KEEP subcommand can be used to specify variable that are to be read, with all other variables not read. Normally variables in a system file retain the names that they were saved under. Use the RENAME subcommand to change these names. Specify, within parentheses, a list of variable names followed by an equals sign (`=') and the names that they should be renamed to. Multiple parenthesized groups of variable names can be included on a single RENAME subcommand. Variables' names may be swapped using a RENAME subcommand of the form `/RENAME=(A B=B A)'. Alternate syntax for the RENAME subcommand allows the parentheses to be eliminated. When this is done, only a single variable may be renamed at once. For instance, `/RENAME=A=B'. This alternate syntax is deprecated. DROP, KEEP, and RENAME are performed in left-to-right order. They each may be present any number of times. GET never modifies a system file on disk. Only the active file read from the system file is affected by these subcommands. GET does not cause the data to be read, only the dictionary. The data is read later, when a procedure is executed.  File: pspp.info, Node: IMPORT, Next: MATCH FILES, Prev: GET, Up: System and Portable Files 7.4 IMPORT ========== IMPORT /FILE='filename' /TYPE={COMM,TAPE} /DROP=var_list /KEEP=var_list /RENAME=(src_names=target_names)... The IMPORT transformation clears the active file dictionary and data and replaces them with a dictionary and data from a portable file on disk. The FILE subcommand, which is the only required subcommand, specifies the portable file to be read as a file name string or a file handle (*note FILE HANDLE::). The TYPE subcommand is currently not used. DROP, KEEP, and RENAME follow the syntax used by GET (*note GET::). IMPORT does not cause the data to be read, only the dictionary. The data is read later, when a procedure is executed.  File: pspp.info, Node: MATCH FILES, Next: SAVE, Prev: IMPORT, Up: System and Portable Files 7.5 MATCH FILES =============== MATCH FILES /{FILE,TABLE}={*,'filename'} /DROP=var_list /KEEP=var_list /RENAME=(src_names=target_names)... /IN=var_name /BY var_list /FIRST=var_name /LAST=var_name /MAP MATCH FILES merges one or more system files, optionally 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. 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 in all the files specified on FILE and TABLE. BY should usually be specified. If TABLE or IN is used then BY is required. Specify FILE with a system file as a file name string or file handle (*note FILE HANDLE::), or with an asterisk (`*') to indicate the current active file. The files specified on FILE are merged together based on the BY variables, or combined case-by-case if BY is not specified. Normally at least two FILE subcommands should be specified. Specify TABLE with a system file to use it as a "table lookup file". Records in table lookup files are not used up after they've been used once. This means that data in table lookup files can correspond to any number of records in FILE files. Table lookup files correspond to lookup tables in traditional relational database systems. It is incorrect to have records with duplicate BY values in table lookup files. Any number of FILE and TABLE subcommands may be specified. Each instance of FILE or TABLE can be followed by any sequence of DROP, KEEP, or RENAME subcommands. These have the same form and meaning as the corresponding subcommands of GET (*note GET::), but apply only to variables in the given file. Each FILE or TABLE may optionally be followed by an IN subcommand, which creates a numeric variable with the specified name and format F1.0. The IN variable takes value 1 in a case if the given file contributed a row to the merged file, 0 otherwise. The DROP, KEEP, and RENAME subcommands do not affect IN variables. Variables belonging to files that are not present for the current case are set to the system-missing value for numeric variables or spaces for string variables. FIRST, LAST, and MAP are currently ignored. MATCH FILES may not be specified following TEMPORARY (*note TEMPORARY::) if the active file is used as an input source.  File: pspp.info, Node: SAVE, Next: SYSFILE INFO, Prev: MATCH FILES, Up: System and Portable Files 7.6 SAVE ======== SAVE /OUTFILE='filename' /{COMPRESSED,UNCOMPRESSED} /DROP=var_list /KEEP=var_list /VERSION=version /RENAME=(src_names=target_names)... The SAVE procedure causes the dictionary and data in the active file to be written to a system file. OUTFILE is the only required subcommand. Specify the system file to be written as a string file name or a file handle (*note FILE HANDLE::). The COMPRESS and UNCOMPRESS subcommand determine whether the saved system file is compressed. By default, system files are compressed. This default can be changed with the SET command (*note SET::). By default, all the variables in the active file dictionary are written to the system file. The DROP subcommand can be used to specify a list of variables not to be written. In contrast, KEEP specifies variables to be written, with all variables not specified not written. Normally variables are saved to a system file under the same names they have in the active file. Use the RENAME subcommand to change these names. Specify, within parentheses, a list of variable names followed by an equals sign (`=') and the names that they should be renamed to. Multiple parenthesized groups of variable names can be included on a single RENAME subcommand. Variables' names may be swapped using a RENAME subcommand of the form `/RENAME=(A B=B A)'. Alternate syntax for the RENAME subcommand allows the parentheses to be eliminated. When this is done, only a single variable may be renamed at once. For instance, `/RENAME=A=B'. This alternate syntax is deprecated. DROP, KEEP, and RENAME are performed in left-to-right order. They each may be present any number of times. SAVE never modifies the active file. DROP, KEEP, and RENAME only affect the system file written to disk. The VERSION subcommand specifies the version of the file format. Valid versions are '3' and '3x'. Version 3x system files are identical to version 3 files, except that variable names greater than 8 bytes will be truncated. The default version is 3. The VERSION subcommand is optional. There is no need ever to use it. SAVE causes the data to be read. It is a procedure.  File: pspp.info, Node: SYSFILE INFO, Next: XSAVE, Prev: SAVE, Up: System and Portable Files 7.7 SYSFILE INFO ================ SYSFILE INFO FILE='filename'. SYSFILE INFO reads the dictionary in a system file and displays the information in its dictionary. Specify a file name or file handle. SYSFILE INFO reads that file as a system file and displays information on its dictionary. SYSFILE INFO does not affect the current active file.  File: pspp.info, Node: XSAVE, Prev: SYSFILE INFO, Up: System and Portable Files 7.8 XSAVE ========= XSAVE /OUTFILE='filename' /{COMPRESSED,UNCOMPRESSED} /DROP=var_list /KEEP=var_list /RENAME=(src_names=target_names)... The XSAVE transformation writes the active file dictionary and data to a system file stored on disk. XSAVE is a transformation, not a procedure. It is executed when the data is read by a procedure or procedure-like command. In all other respects, XSAVE is identical to SAVE. *Note SAVE::, for more information on syntax and usage.  File: pspp.info, Node: Variable Attributes, Next: Data Manipulation, Prev: System and Portable Files, Up: Top 8 Manipulating variables ************************ The variables in the active file dictionary are important. There are several utility functions for examining and adjusting them. * Menu: * ADD VALUE LABELS:: Add value labels to variables. * DISPLAY:: Display variable names & descriptions. * DISPLAY VECTORS:: Display a list of vectors. * FORMATS:: Set print and write formats. * LEAVE:: Don't clear variables between cases. * MISSING VALUES:: Set missing values for variables. * MODIFY VARS:: Rename, reorder, and drop variables. * NUMERIC:: Create new numeric variables. * PRINT FORMATS:: Set variable print formats. * RENAME VARIABLES:: Rename variables. * VALUE LABELS:: Set value labels for variables. * STRING:: Create new string variables. * VARIABLE LABELS:: Set variable labels for variables. * VARIABLE ALIGNMENT:: Set the alignment for display. * VARIABLE WIDTH:: Set the display width. * VARIABLE LEVEL:: Set the measurement level. * VECTOR:: Declare an array of variables. * WRITE FORMATS:: Set variable write formats.  File: pspp.info, Node: ADD VALUE LABELS, Next: DISPLAY, Prev: Variable Attributes, Up: Variable Attributes 8.1 ADD VALUE LABELS ==================== ADD VALUE LABELS /var_list value 'label' [value 'label']... ADD VALUE LABELS has the same syntax and purpose as VALUE LABELS (*note VALUE LABELS::), but it does not clear value labels from the variables before adding the ones specified.  File: pspp.info, Node: DISPLAY, Next: DISPLAY VECTORS, Prev: ADD VALUE LABELS, Up: Variable Attributes 8.2 DISPLAY =========== DISPLAY {NAMES,INDEX,LABELS,VARIABLES,DICTIONARY,SCRATCH} [SORTED] [var_list] DISPLAY displays requested information on variables. Variables can optionally be sorted alphabetically. The entire dictionary or just specified variables can be described. One of the following keywords can be present: NAMES The variables' names are displayed. INDEX The variables' names are displayed along with a value describing their position within the active file dictionary. LABELS Variable names, positions, and variable labels are displayed. VARIABLES Variable names, positions, print and write formats, and missing values are displayed. DICTIONARY Variable names, positions, print and write formats, missing values, variable labels, and value labels are displayed. SCRATCH Varible names are displayed, for scratch variables only (*note Scratch Variables::). If SORTED is specified, then the variables are displayed in ascending order based on their names; otherwise, they are displayed in the order that they occur in the active file dictionary.  File: pspp.info, Node: DISPLAY VECTORS, Next: FORMATS, Prev: DISPLAY, Up: Variable Attributes 8.3 DISPLAY VECTORS =================== DISPLAY VECTORS. DISPLAY VECTORS lists all the currently declared vectors.  File: pspp.info, Node: FORMATS, Next: LEAVE, Prev: DISPLAY VECTORS, Up: Variable Attributes 8.4 FORMATS =========== FORMATS var_list (fmt_spec). FORMATS set both print and write formats for the specified numeric variables to the specified format specification. *Note Input/Output Formats::. Specify a list of variables followed by a format specification in parentheses. The print and write formats of the specified variables will be changed. Additional lists of variables and formats may be included if they are delimited by a slash (`/'). FORMATS takes effect immediately. It is not affected by conditional and looping structures such as DO IF or LOOP.  File: pspp.info, Node: LEAVE, Next: MISSING VALUES, Prev: FORMATS, Up: Variable Attributes 8.5 LEAVE ========= LEAVE var_list. LEAVE prevents the specified variables from being reinitialized whenever a new case is processed. Normally, when a data file is processed, every variable in the active file is initialized to the system-missing value or spaces at the beginning of processing for each case. When a variable has been specified on LEAVE, this is not the case. Instead, that variable is initialized to 0 (not system-missing) or spaces for the first case. After that, it retains its value between cases. This becomes useful for counters. For instance, in the example below the variable SUM maintains a running total of the values in the ITEM variable. DATA LIST /ITEM 1-3. COMPUTE SUM=SUM+ITEM. PRINT /ITEM SUM. LEAVE SUM BEGIN DATA. 123 404 555 999 END DATA. Partial output from this example: 123 123.00 404 527.00 555 1082.00 999 2081.00 It is best to use LEAVE command immediately before invoking a procedure command, because the left status of variables is reset by certain transformations--for instance, COMPUTE and IF. Left status is also reset by all procedure invocations.  File: pspp.info, Node: MISSING VALUES, Next: MODIFY VARS, Prev: LEAVE, Up: Variable Attributes 8.6 MISSING VALUES ================== MISSING VALUES var_list (missing_values). missing_values takes one of the following forms: num1 num1, num2 num1, num2, num3 num1 THRU num2 num1 THRU num2, num3 string1 string1, string2 string1, string2, string3 As part of a range, LO or LOWEST may take the place of num1; HI or HIGHEST may take the place of num2. MISSING VALUES sets user-missing values for numeric and short string variables. Long string variables may not have missing values. Specify a list of variables, followed by a list of their user-missing values in parentheses. Up to three discrete values may be given, or, for numeric variables only, a range of values optionally accompanied by a single discrete value. Ranges may be open-ended on one end, indicated through the use of the keyword LO or LOWEST or HI or HIGHEST. The MISSING VALUES command takes effect immediately. It is not affected by conditional and looping constructs such as DO IF or LOOP.  File: pspp.info, Node: MODIFY VARS, Next: NUMERIC, Prev: MISSING VALUES, Up: Variable Attributes 8.7 MODIFY VARS =============== MODIFY VARS /REORDER={FORWARD,BACKWARD} {POSITIONAL,ALPHA} (var_list)... /RENAME=(old_names=new_names)... /{DROP,KEEP}=var_list /MAP MODIFY VARS reorders, renames, and deletes variables in the active file. At least one subcommand must be specified, and no subcommand may be specified more than once. DROP and KEEP may not both be specified. The REORDER subcommand changes the order of variables in the active file. Specify one or more lists of variable names in parentheses. By default, each list of variables is rearranged into the specified order. To put the variables into the reverse of the specified order, put keyword BACKWARD before the parentheses. To put them into alphabetical order in the dictionary, specify keyword ALPHA before the parentheses. BACKWARD and ALPHA may also be combined. To rename variables in the active file, specify RENAME, an equals sign (`='), and lists of the old variable names and new variable names separated by another equals sign within parentheses. There must be the same number of old and new variable names. Each old variable is renamed to the corresponding new variable name. Multiple parenthesized groups of variables may be specified. The DROP subcommand deletes a specified list of variables from the active file. The KEEP subcommand keeps the specified list of variables in the active file. Any unlisted variables are deleted from the active file. MAP is currently ignored. If either DROP or KEEP is specified, the data is read; otherwise it is not. MODIFY VARS may not be specified following TEMPORARY (*note TEMPORARY::).  File: pspp.info, Node: NUMERIC, Next: PRINT FORMATS, Prev: MODIFY VARS, Up: Variable Attributes 8.8 NUMERIC =========== NUMERIC /var_list [(fmt_spec)]. NUMERIC explicitly declares new numeric variables, optionally setting their output formats. Specify a slash (`/'), followed by the names of the new numeric variables. If you wish to set their output formats, follow their names by an output format specification in parentheses (*note Input/Output Formats::); otherwise, the default is F8.2. Variables created with NUMERIC are initialized to the system-missing value.  File: pspp.info, Node: PRINT FORMATS, Next: RENAME VARIABLES, Prev: NUMERIC, Up: Variable Attributes 8.9 PRINT FORMATS ================= PRINT FORMATS var_list (fmt_spec). PRINT FORMATS sets the print formats for the specified numeric variables to the specified format specification. Its syntax is identical to that of FORMATS (*note FORMATS::), but PRINT FORMATS sets only print formats, not write formats.  File: pspp.info, Node: RENAME VARIABLES, Next: VALUE LABELS, Prev: PRINT FORMATS, Up: Variable Attributes 8.10 RENAME VARIABLES ===================== RENAME VARIABLES (old_names=new_names)... . RENAME VARIABLES changes the names of variables in the active file. Specify lists of the old variable names and new variable names, separated by an equals sign (`='), within parentheses. There must be the same number of old and new variable names. Each old variable is renamed to the corresponding new variable name. Multiple parenthesized groups of variables may be specified. RENAME VARIABLES takes effect immediately. It does not cause the data to be read. RENAME VARIABLES may not be specified following TEMPORARY (*note TEMPORARY::).  File: pspp.info, Node: VALUE LABELS, Next: STRING, Prev: RENAME VARIABLES, Up: Variable Attributes 8.11 VALUE LABELS ================= VALUE LABELS /var_list value 'label' [value 'label']... VALUE LABELS allows values of numeric and short string variables to be associated with labels. In this way, a short value can stand for a long value. To set up value labels for a set of variables, specify the variable names after a slash (`/'), followed by a list of values and their associated labels, separated by spaces. Long string variables may not be specified. Before VALUE LABELS is executed, any existing value labels are cleared from the variables specified. Use ADD VALUE LABELS (*note ADD VALUE LABELS::) to add value labels without clearing those already present.  File: pspp.info, Node: STRING, Next: VARIABLE LABELS, Prev: VALUE LABELS, Up: Variable Attributes 8.12 STRING =========== STRING /var_list (fmt_spec). STRING creates new string variables for use in transformations. Specify a slash (`/'), followed by the names of the string variables to create and the desired output format specification in parentheses (*note Input/Output Formats::). Variable widths are implicitly derived from the specified output formats. Created variables are initialized to spaces.  File: pspp.info, Node: VARIABLE LABELS, Next: VARIABLE ALIGNMENT, Prev: STRING, Up: Variable Attributes 8.13 VARIABLE LABELS ==================== VARIABLE LABELS var_list 'var_label' [ /var_list 'var_label'] . . . [ /var_list 'var_label'] VARIABLE LABELS associates explanatory names with variables. This name, called a "variable label", is displayed by statistical procedures. To assign a variable label to a group of variables, specify a list of variable names and the variable label as a string. To assign different labels to different variables in the same command, preceed the subsequent variable list with a slash (`/').  File: pspp.info, Node: VARIABLE ALIGNMENT, Next: VARIABLE WIDTH, Prev: VARIABLE LABELS, Up: Variable Attributes 8.14 VARIABLE ALIGNMENT ======================= VARIABLE ALIGNMENT var_list ( LEFT | RIGHT | CENTER ) [ /var_list ( LEFT | RIGHT | CENTER ) ] . . . [ /var_list ( LEFT | RIGHT | CENTER ) ] VARIABLE ALIGNMENT sets the alignment of variables for display editing purposes. This only has effect for third party software. It does not affect the display of variables in the PSPP output.  File: pspp.info, Node: VARIABLE WIDTH, Next: VARIABLE LEVEL, Prev: VARIABLE ALIGNMENT, Up: Variable Attributes 8.15 VARIABLE WIDTH =================== VARIABLE WIDTH var_list (width) [ /var_list (width) ] . . . [ /var_list (width) ] VARIABLE WIDTH sets the column width of variables for display editing purposes. This only affects third party software. It does not affect the display of variables in the PSPP output.  File: pspp.info, Node: VARIABLE LEVEL, Next: VECTOR, Prev: VARIABLE WIDTH, Up: Variable Attributes 8.16 VARIABLE LEVEL =================== VARIABLE LEVEL var_list ( SCALE | NOMINAL | ORDINAL ) [ /var_list ( SCALE | NOMINAL | ORDINAL ) ] . . . [ /var_list ( SCALE | NOMINAL | ORDINAL ) ] VARIABLE LEVEL sets the measurement level of variables. Currently, this has no effect except for certain third party software.  File: pspp.info, Node: VECTOR, Next: WRITE FORMATS, Prev: VARIABLE LEVEL, Up: Variable Attributes 8.17 VECTOR =========== Two possible syntaxes: VECTOR vec_name=var_list. VECTOR vec_name_list(count). VECTOR allows a group of variables to be accessed as if they were consecutive members of an array with a vector(index) notation. To make a vector out of a set of existing variables, specify a name for the vector followed by an equals sign (`=') and the variables that belong in the vector. To make a vector and create variables at the same time, specify one or more vector names followed by a count in parentheses. This will cause variables named `VEC1' through `VECCOUNT' to be created as numeric variables with print and write format F8.2. Variable names including numeric suffixes may not exceed 64 characters in length, and none of the variables may exist prior to VECTOR. All the variables in a vector must be the same type. Vectors created with VECTOR disappear after any procedure or procedure-like command is executed. The variables contained in the vectors remain, unless they are scratch variables (*note Scratch Variables::). Variables within a vector may be referenced in expressions using `vector(index)' syntax.  File: pspp.info, Node: WRITE FORMATS, Prev: VECTOR, Up: Variable Attributes 8.18 WRITE FORMATS ================== WRITE FORMATS var_list (fmt_spec). WRITE FORMATS sets the write formats for the specified numeric variables to the specified format specification. Its syntax is identical to that of FORMATS (*note FORMATS::), but WRITE FORMATS sets only write formats, not print formats.  File: pspp.info, Node: Data Manipulation, Next: Data Selection, Prev: Variable Attributes, Up: Top 9 Data transformations ********************** The PSPP procedures examined in this chapter manipulate data and prepare the active file for later analyses. They do not produce output, as a rule. * Menu: * AGGREGATE:: Summarize multiple cases into a single case. * AUTORECODE:: Automatic recoding of variables. * COMPUTE:: Assigning a variable a calculated value. * COUNT:: Counting variables with particular values. * FLIP:: Exchange variables with cases. * IF:: Conditionally assigning a calculated value. * RECODE:: Mapping values from one set to another. * SORT CASES:: Sort the active file.  File: pspp.info, Node: AGGREGATE, Next: AUTORECODE, Prev: Data Manipulation, Up: Data Manipulation 9.1 AGGREGATE ============= AGGREGATE OUTFILE={*,'filename'} /PRESORTED /DOCUMENT /MISSING=COLUMNWISE /BREAK=var_list /dest_var['label']...=agr_func(src_vars, args...)... AGGREGATE summarizes groups of cases into single cases. Cases are divided into groups that have the same values for one or more variables called "break variables". Several functions are available for summarizing case contents. The OUTFILE subcommand is required and must appear first. Specify a system file by file name string or file handle (*note FILE HANDLE::). The aggregated cases are written to this file. If `*' is specified, then the aggregated cases replace the active file. By default, the active file will be sorted based on the break variables 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. Specify DOCUMENT to copy the documents from the active file into the aggregate file (*note DOCUMENT::). Otherwise, the aggregate file will not contain any documents, even if the aggregate file replaces the active file. Normally, only a single case (for SD and SD., two cases) need be 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. If PRESORTED, DOCUMENT, or MISSING are specified, they must appear between OUTFILE and BREAK. At least one break variable must be specified on BREAK, a required subcommand. The values of these variables are used to divide the active file into groups to be summarized. In addition, at least one DEST_VAR must be specified. One or more sets of aggregation variables must be specified. Each set comprises a list of aggregation variables, an equals sign (`='), 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. Aggregation variables typically are created with no variable label, value labels, or missing values. Their default print and write formats depend on the aggregation function used, with details given in the table below. A variable label for an aggregation variable may be specified just after the variable's name in the aggregation variable list. 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. The MEAN, SD, and SUM aggregation functions may only be applied to numeric variables. All the rest may be applied to numeric and short and long string variables. The available aggregation functions are as follows: FGT(var_name, value) Fraction of values greater than the specified constant. The default format is F5.3. FIN(var_name, low, high) Fraction of values within the specified inclusive range of constants. The default format is F5.3. FLT(var_name, value) Fraction of values less than the specified constant. The default format is F5.3. FIRST(var_name) First non-missing value in break group. The aggregation variable receives the complete dictionary information from the source variable. The sort performed by AGGREGATE (and by SORT CASES) is stable, so that the first case with particular values for the break variables before sorting will also be the first case in that break group after sorting. FOUT(var_name, low, high) Fraction of values strictly outside the specified range of constants. The default format is F5.3. LAST(var_name) Last non-missing value in break group. The aggregation variable receives the complete dictionary information from the source variable. The sort performed by AGGREGATE (and by SORT CASES) is stable, so that the last case with particular values for the break variables before sorting will also be the last case in that break group after sorting. MAX(var_name) Maximum value. The aggregation variable receives the complete dictionary information from the source variable. MEAN(var_name) Arithmetic mean. Limited to numeric values. The default format is F8.2. MIN(var_name) Minimum value. The aggregation variable receives the complete dictionary information from the source variable. N(var_name) Number of non-missing values. The default format is F7.0 if weighting is not enabled, F8.2 if it is (*note WEIGHT::). N Number of cases aggregated to form this group. The default format is F7.0 if weighting is not enabled, F8.2 if it is (*note WEIGHT::). NMISS(var_name) Number of missing values. The default format is F7.0 if weighting is not enabled, F8.2 if it is (*note WEIGHT::). NU(var_name) Number of non-missing values. Each case is considered to have a weight of 1, regardless of the current weighting variable (*note WEIGHT::). The default format is F7.0. NU Number of cases aggregated to form this group. Each case is considered to have a weight of 1, regardless of the current weighting variable. The default format is F7.0. NUMISS(var_name) Number of missing values. Each case is considered to have a weight of 1, regardless of the current weighting variable. The default format is F7.0. PGT(var_name, value) Percentage between 0 and 100 of values greater than the specified constant. The default format is F5.1. PIN(var_name, low, high) Percentage of values within the specified inclusive range of constants. The default format is F5.1. PLT(var_name, value) Percentage of values less than the specified constant. The default format is F5.1. POUT(var_name, low, high) Percentage of values strictly outside the specified range of constants. The default format is F5.1. SD(var_name) Standard deviation of the mean. Limited to numeric values. The default format is F8.2. SUM(var_name) Sum. Limited to numeric values. The default format is F8.2. Aggregation functions compare string values in terms of internal character codes. On most modern computers, this is a form of ASCII. The aggregation functions listed above exclude all user-missing values from calculations. To include user-missing values, insert a period (`.') at the end of the function name. (e.g. `SUM.'). (Be aware that specifying such a function as the last token on a line will cause the period to be interpreted as the end of the command.) AGGREGATE both ignores and cancels the current SPLIT FILE settings (*note SPLIT FILE::).  File: pspp.info, Node: AUTORECODE, Next: COMPUTE, Prev: AGGREGATE, Up: Data Manipulation 9.2 AUTORECODE ============== AUTORECODE VARIABLES=src_vars INTO dest_vars /DESCENDING /PRINT The AUTORECODE procedure considers the N values that a variable takes on and maps them onto values 1...N on a new numeric variable. Subcommand VARIABLES is the only required subcommand and must come first. Specify VARIABLES, an equals sign (`='), a list of source variables, INTO, and a list of target variables. There must the same number of source and target variables. The target variables must not already exist. By default, increasing values of a source variable (for a string, this is based on character code comparisons) are recoded to increasing values of its target variable. To cause increasing values of a source variable to be recoded to decreasing values of its target variable (N down to 1), specify DESCENDING. PRINT is currently ignored. AUTORECODE is a procedure. It causes the data to be read.  File: pspp.info, Node: COMPUTE, Next: COUNT, Prev: AUTORECODE, Up: Data Manipulation 9.3 COMPUTE =========== COMPUTE variable = expression. or COMPUTE vector(index) = expression. COMPUTE assigns the value of an expression to a target variable. For each case, the expression is evaluated and its value assigned to the target variable. Numeric and short and long string variables may be assigned. When a string expression's width differs from the target variable's width, the string result of the expression is truncated or padded with spaces on the right as necessary. The expression and variable types must match. For numeric variables only, the target variable need not already exist. Numeric variables created by COMPUTE are assigned an `F8.2' output format. String variables must be declared before they can be used as targets for COMPUTE. The target variable may be specified as an element of a vector (*note VECTOR::). In this case, a vector index expression must be specified in parentheses following the vector name. The index expression must evaluate to a numeric value that, after rounding down to the nearest integer, is a valid index for the named vector. Using COMPUTE to assign to a variable specified on LEAVE (*note LEAVE::) resets the variable's left state. Therefore, `LEAVE' should be specified following COMPUTE, not before. COMPUTE is a transformation. It does not cause the active file to be read. When COMPUTE is specified following TEMPORARY (*note TEMPORARY::), the LAG function may not be used (*note LAG::).  File: pspp.info, Node: COUNT, Next: FLIP, Prev: COMPUTE, Up: Data Manipulation 9.4 COUNT ========= COUNT var_name = var... (value...). Each value takes one of the following forms: number string num1 THRU num2 MISSING SYSMIS In addition, num1 and num2 can be LO or LOWEST, or HI or HIGHEST, respectively. COUNT creates or replaces a numeric "target" variable that counts the occurrence of a "criterion" value or set of values over one or more "test" variables for each case. The target variable values are always nonnegative integers. They are never missing. The target variable is assigned an F8.2 output format. *Note Input/Output Formats::. Any variables, including long and short string variables, may be test variables. User-missing values of test variables are treated just like any other values. They are *not* treated as system-missing values. User-missing values that are criterion values or inside ranges of criterion values are counted as any other values. However (for numeric variables), keyword MISSING may be used to refer to all system- and user-missing values. COUNT target variables are assigned values in the order specified. In the command `COUNT A=A B(1) /B=A B(2).', the following actions occur: - The number of occurrences of 1 between `A' and `B' is counted. - `A' is assigned this value. - The number of occurrences of 1 between `B' and the *new* value of `A' is counted. - `B' is assigned this value. Despite this ordering, all COUNT criterion variables must exist before the procedure is executed--they may not be created as target variables earlier in the command! Break such a command into two separate commands. The examples below may help to clarify. A. Assuming `Q0', `Q2', ..., `Q9' are numeric variables, the following commands: 1. Count the number of times the value 1 occurs through these variables for each case and assigns the count to variable `QCOUNT'. 2. Print out the total number of times the value 1 occurs throughout _all_ cases using DESCRIPTIVES. *Note DESCRIPTIVES::, for details. COUNT QCOUNT=Q0 TO Q9(1). DESCRIPTIVES QCOUNT /STATISTICS=SUM. B. Given these same variables, the following commands: 1. Count the number of valid values of these variables for each case and assigns the count to variable `QVALID'. 2. Multiplies each value of `QVALID' by 10 to obtain a percentage of valid values, using COMPUTE. *Note COMPUTE::, for details. 3. Print out the percentage of valid values across all cases, using DESCRIPTIVES. *Note DESCRIPTIVES::, for details. COUNT QVALID=Q0 TO Q9 (LO THRU HI). COMPUTE QVALID=QVALID*10. DESCRIPTIVES QVALID /STATISTICS=MEAN.  File: pspp.info, Node: FLIP, Next: IF, Prev: COUNT, Up: Data Manipulation 9.5 FLIP ======== FLIP /VARIABLES=var_list /NEWNAMES=var_name. 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. If specified, the VARIABLES subcommand selects variables to be transformed into cases, and variables not specified are discarded. If the VARIABLES subcommand is omitted, all variables are selected for transposition. The variables specified by NEWNAMES, which must be a string variable, is used to give names to the variables created by FLIP. Only the first 8 characters of the variable are used. If NEWNAMES is not specified then the default is a variable named CASE_LBL, if it exists. If it does not then the variables created by FLIP are named VAR000 through VAR999, then VAR1000, VAR1001, and so on. When a NEWNAMES variable is available, the names must be canonicalized before becoming variable names. Invalid characters are replaced by letter `V' in the first position, or by `_' in subsequent positions. If the name thus generated is not unique, then numeric extensions are added, starting with 1, until a unique name is found or there are no remaining possibilities. If the latter occurs then the FLIP operation aborts. The resultant dictionary contains a CASE_LBL variable, a string variable of width 8, which stores the names of the variables in the dictionary before the transposition. Variables names longer than 8 characters are truncated. If the active file is subsequently transposed using FLIP, this variable can be used to recreate the original variable names. FLIP honors N OF CASES (*note N OF CASES::). It ignores TEMPORARY (*note TEMPORARY::), so that "temporary" transformations become permanent.  File: pspp.info, Node: IF, Next: RECODE, Prev: FLIP, Up: Data Manipulation 9.6 IF ====== IF condition variable=expression. or IF condition vector(index)=expression. The IF transformation conditionally assigns the value of a target expression to a target variable, based on the truth of a test expression. Specify a boolean-valued expression (*note Expressions::) to be tested following the IF keyword. This expression is evaluated for each case. If the value is true, then the value of the expression is computed and assigned to the specified variable. If the value is false or missing, nothing is done. Numeric and short and long string variables may be assigned. When a string expression's width differs from the target variable's width, the string result of the expression is truncated or padded with spaces on the right as necessary. The expression and variable types must match. The target variable may be specified as an element of a vector (*note VECTOR::). In this case, a vector index expression must be specified in parentheses following the vector name. The index expression must evaluate to a numeric value that, after rounding down to the nearest integer, is a valid index for the named vector. Using IF to assign to a variable specified on LEAVE (*note LEAVE::) resets the variable's left state. Therefore, `LEAVE' should be specified following IF, not before. When IF is specified following TEMPORARY (*note TEMPORARY::), the LAG function may not be used (*note LAG::).  File: pspp.info, Node: RECODE, Next: SORT CASES, Prev: IF, Up: Data Manipulation 9.7 RECODE ========== RECODE var_list (src_value...=dest_value)... [INTO var_list]. src_value may take the following forms: number string num1 THRU num2 MISSING SYSMIS ELSE Open-ended ranges may be specified using LO or LOWEST for num1 or HI or HIGHEST for num2. dest_value may take the following forms: num string SYSMIS COPY RECODE translates data from one range of values to another, via flexible user-specified mappings. Data may be remapped in-place or copied to new variables. Numeric, short string, and long string data can be recoded. Specify the list of source variables, followed by one or more mapping specifications each enclosed in parentheses. If the data is to be copied to new variables, specify INTO, then the list of target variables. String target variables must already have been declared using STRING or another transformation, but numeric target variables can be created on the fly. There must be exactly as many target variables as source variables. Each source variable is remapped into its corresponding target variable. When INTO is not used, the input and output variables must be of the same type. Otherwise, string values can be recoded into numeric values, and vice versa. When this is done and there is no mapping for a particular value, either a value consisting of all spaces or the system-missing value is assigned, depending on variable type. Mappings are considered from left to right. The first src_value that matches the value of the source variable causes the target variable to receive the value indicated by the dest_value. Literal number, string, and range src_value's should be self-explanatory. MISSING as a src_value matches any user- or system-missing value. SYSMIS matches the system missing value only. ELSE is a catch-all that matches anything. It should be the last src_value specified. Numeric and string dest_value's should also be self-explanatory. COPY causes the input values to be copied to the output. This is only value if the source and target variables are of the same type. SYSMIS indicates the system-missing value. If the source variables are strings and the target variables are numeric, then there is one additional mapping available: (CONVERT), which must be the last specified mapping. CONVERT causes a number specified as a string to be converted to a numeric value. If the string cannot be parsed as a number, then the system-missing value is assigned. Multiple recodings can be specified on a single RECODE invocation. Introduce additional recodings with a slash (`/') to separate them from the previous recodings.  File: pspp.info, Node: SORT CASES, Prev: RECODE, Up: Data Manipulation 9.8 SORT CASES ============== SORT CASES BY var_list. SORT CASES sorts the active file by the values of one or more variables. Specify BY and a list of variables to sort by. By default, variables are sorted in ascending order. To override sort order, specify (D) or (DOWN) after a list of variables to get descending order, or (A) or (UP) for ascending order. These apply to the entire list of variables preceding them. The sort algorithms used by SORT CASES are stable. That is, records that have equal values of the sort variables will have the same relative order before and after sorting. As a special case, re-sorting an already sorted file will not affect the ordering of cases. SORT CASES is a procedure. It causes the data to be read. SORT CASES attempts to sort the entire active file in main memory. If workspace is exhausted, it falls back to a merge sort algorithm that involves creates numerous temporary files. SORT CASES may not be specified following TEMPORARY.  File: pspp.info, Node: Data Selection, Next: Conditionals and Looping, Prev: Data Manipulation, Up: Top 10 Selecting data for analysis ****************************** This chapter documents PSPP commands that temporarily or permanently select data records from the active file for analysis. * Menu: * FILTER:: Exclude cases based on a variable. * N OF CASES:: Limit the size of the active file. * PROCESS IF:: Temporarily excluding cases. * SAMPLE:: Select a specified proportion of cases. * SELECT IF:: Permanently delete selected cases. * SPLIT FILE:: Do multiple analyses with one command. * TEMPORARY:: Make transformations' effects temporary. * WEIGHT:: Weight cases by a variable.  File: pspp.info, Node: FILTER, Next: N OF CASES, Prev: Data Selection, Up: Data Selection 10.1 FILTER =========== FILTER BY var_name. FILTER OFF. FILTER allows a boolean-valued variable to be used to select cases from the data stream for processing. 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 COMPUTE or RECODE to compute a filter variable of the required form, then specify that variable on FILTER. `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 `FILTER OFF'. However, if FILTER is placed after TEMPORARY, it filters only the next procedure or procedure-like command.  File: pspp.info, Node: N OF CASES, Next: PROCESS IF, Prev: FILTER, Up: Data Selection 10.2 N OF CASES =============== N [OF CASES] num_of_cases [ESTIMATED]. Sometimes you may want to disregard cases of your input. N can do this. `N 100' tells PSPP to disregard all cases after the first 100. If the value specified for N is greater than the number of cases read in, the value is ignored. N does not discard cases or prevent them from being read. It just causes cases beyond the last one specified to be ignored by data analysis commands. A later N command can increase or decrease the number of cases selected. (To select all the cases without knowing how many there are, specify a very high number: 100000 or whatever you think is large enough.) Transformation procedures performed after N is executed _do_ cause cases to be discarded. SAMPLE, PROCESS IF, and SELECT IF have precedence over N--the same results are obtained by both of the following fragments, given the same random number seeds: ...set up, read in data... N 100. SAMPLE .5. ...analyze data... ...set up, read in data... SAMPLE .5. N 100. ...analyze data... Both fragments above first randomly sample approximately half of the cases, then select the first 100 of those sampled. N with the `ESTIMATED' keyword gives an estimated number of cases before DATA LIST or another command to read in data. `ESTIMATED' never limits the number of cases processed by procedures. PSPP currently does not make use of case count estimates. When N is specified after TEMPORARY, it affects only the next procedure (*note TEMPORARY::).  File: pspp.info, Node: PROCESS IF, Next: SAMPLE, Prev: N OF CASES, Up: Data Selection 10.3 PROCESS IF =============== PROCESS IF expression. PROCESS IF temporarily eliminates cases from the data stream. Its effects are active only through the execution of the next procedure or procedure-like command. Specify a boolean expression (*note Expressions::). If the value of the expression is true for a particular case, the case will be analyzed. If the expression has a false or missing value, then the case will be deleted from the data stream for this procedure only. Regardless of its placement relative to other commands, PROCESS IF always takes effect immediately before data passes to the procedure. Only one PROCESS IF command may be in effect at any given time. The effects of PROCESS IF are similar, but not identical, to the effects of executing TEMPORARY, then SELECT IF (*note SELECT IF::). The filtering performed by PROCESS IF takes place immediately before cases pass to a procedure for analysis. Because PROCESS IF affects only a single procedure, its placement relative to TEMPORARY is unimportant. PROCESS IF is deprecated. It is included for compatibility with old command files. New syntax files should use SELECT IF or FILTER instead.  File: pspp.info, Node: SAMPLE, Next: SELECT IF, Prev: PROCESS IF, Up: Data Selection 10.4 SAMPLE =========== SAMPLE num1 [FROM num2]. SAMPLE randomly samples a proportion of the cases in the active file. Unless it follows 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 `k' is the number specified, and `N' is the number of currently-selected cases in the active file, then after `SAMPLE K.', approximately `k*N' cases will be selected. The proportion to sample can also be specified in the style `SAMPLE M FROM N'. With this style, cases are selected as follows: 1. If N is equal to the number of currently-selected cases in the active file, exactly M cases will be selected. 2. If N is greater than the number of currently-selected cases in the active file, an equivalent proportion of cases will be selected. 3. If N is less than the number of currently-selected cases in the active, exactly M cases will be selected _from the first N cases in the active file._ SAMPLE and SELECT IF are performed in the order specified by the syntax file. SAMPLE is always performed before `N OF CASES', regardless of ordering in the syntax file (*note N OF CASES::). The same values for SAMPLE may result in different samples. To obtain the same sample, use the `SET' command to set the random number seed to the same value before each SAMPLE. Different samples may still result when the file is processed on systems with differing endianness or floating-point formats. By default, the random number seed is based on the system time.  File: pspp.info, Node: SELECT IF, Next: SPLIT FILE, Prev: SAMPLE, Up: Data Selection 10.5 SELECT IF ============== SELECT IF expression. SELECT IF selects cases for analysis based on the value of a boolean expression. Cases not selected are permanently eliminated from the active file, unless TEMPORARY is in effect (*note TEMPORARY::). Specify a boolean expression (*note Expressions::). If the value of the expression is true for a particular case, the case will be analyzed. If the expression has a false or missing value, then the case will be deleted from the data stream. Place 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 SELECT IF is specified following TEMPORARY (*note TEMPORARY::), the LAG function may not be used (*note LAG::).  File: pspp.info, Node: SPLIT FILE, Next: TEMPORARY, Prev: SELECT IF, Up: Data Selection 10.6 SPLIT FILE =============== SPLIT FILE [{LAYERED, SEPARATE}] BY var_list. SPLIT FILE OFF. SPLIT FILE allows multiple sets of data present in one data file to be analyzed separately using single statistical procedure commands. Specify a list of variable names to analyze multiple sets of data separately. Groups of adjacent cases having the same values for these variables are analyzed by statistical procedure commands as one group. An independent analysis is carried out for each group of cases, and the variable values for the group are printed along with the analysis. When a list of variable names is specified, one of the keywords LAYERED or SEPARATE may also be specified. If provided, either keyword are ignored. Groups are formed only by _adjacent_ cases. To create a split using a variable where like values are not adjacent in the working file, you should first sort the data by that variable (*note SORT CASES::). Specify OFF to disable SPLIT FILE and resume analysis of the entire active file as a single group of data. When SPLIT FILE is specified after TEMPORARY, it affects only the next procedure (*note TEMPORARY::).  File: pspp.info, Node: TEMPORARY, Next: WEIGHT, Prev: SPLIT FILE, Up: Data Selection 10.7 TEMPORARY ============== TEMPORARY. TEMPORARY is used to make the effects of transformations 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 on TEMPORARY is the command name. TEMPORARY may not appear within a DO IF or LOOP construct. It may appear only once between procedures and procedure-like commands. Scratch variables cannot be used following TEMPORARY. An example may help to clarify: DATA LIST /X 1-2. BEGIN DATA. 2 4 10 15 20 24 END DATA. COMPUTE X=X/2. TEMPORARY. COMPUTE X=X+3. DESCRIPTIVES X. DESCRIPTIVES X. The data read by the first DESCRIPTIVES are 4, 5, 8, 10.5, 13, 15. The data read by the first DESCRIPTIVES are 1, 2, 5, 7.5, 10, 12.  File: pspp.info, Node: WEIGHT, Prev: TEMPORARY, Up: Data Selection 10.8 WEIGHT =========== WEIGHT BY var_name. WEIGHT OFF. WEIGHT assigns cases varying weights, changing the frequency distribution of the active file. Execution of WEIGHT is delayed until data have been read. If a variable name is specified, WEIGHT causes the values of that variable to be used as weighting factors for subsequent statistical procedures. Use of keyword BY is optional but recommended. Weighting variables must be numeric. Scratch variables may not be used for weighting (*note Scratch Variables::). When OFF is specified, subsequent statistical procedures will weight all cases equally. A positive integer weighting factor W on a case will yield the same statistical output as would replicating the case W times. A weighting factor of 0 is treated for statistical purposes as if the case did not exist in the input. Weighting values need not be 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 WEIGHT is specified after TEMPORARY, it affects only the next procedure (*note TEMPORARY::). WEIGHT does not cause cases in the active file to be replicated in memory.  File: pspp.info, Node: Conditionals and Looping, Next: Statistics, Prev: Data Selection, Up: Top 11 Conditional and Looping Constructs ************************************* This chapter documents PSPP commands used for conditional execution, looping, and flow of control. * Menu: * BREAK:: Exit a loop. * DO IF:: Conditionally execute a block of code. * DO REPEAT:: Textually repeat a code block. * LOOP:: Repeat a block of code.  File: pspp.info, Node: BREAK, Next: DO IF, Prev: Conditionals and Looping, Up: Conditionals and Looping 11.1 BREAK ========== BREAK. BREAK terminates execution of the innermost currently executing LOOP construct. BREAK is allowed only inside LOOP...END LOOP. *Note LOOP::, for more details.  File: pspp.info, Node: DO IF, Next: DO REPEAT, Prev: BREAK, Up: Conditionals and Looping 11.2 DO IF ========== DO IF condition. ... [ELSE IF condition. ... ]... [ELSE. ...] END IF. DO IF allows one of several sets of transformations to be executed, depending on user-specified conditions. If the specified boolean expression evaluates as true, then the block of code following DO IF is executed. If it evaluates as missing, then none of the code blocks is executed. If it is false, then the boolean expression on the first ELSE IF, if present, is tested in turn, with the same rules applied. If all expressions evaluate to false, then the ELSE code block is executed, if it is present. When DO IF or ELSE IF is specified following TEMPORARY (*note TEMPORARY::), the LAG function may not be used (*note LAG::).  File: pspp.info, Node: DO REPEAT, Next: LOOP, Prev: DO IF, Up: Conditionals and Looping 11.3 DO REPEAT ============== DO REPEAT repvar_name=expansion.... ... END REPEAT [PRINT]. expansion takes one of the following forms: var_list num_or_range... 'string'... num_or_range takes one of the following forms: number num1 TO num2 DO REPEAT repeats a block of code, textually substituting different variables, numbers, or strings into the block with each repetition. Specify a repeat variable name followed by an equals sign (`=') and the list of replacements. Replacements can be a list of variables (which may be existing variables or new variables or a combination thereof), of numbers, or of strings. When new variable names are specified, DO REPEAT creates them as numeric variables. When numbers are specified, runs of integers may be indicated with TO notation, for instance `1 TO 5' and `1 2 3 4 5' would be equivalent. There is no equivalent notation for string values. Multiple repeat variables can be specified. When this is done, each variable must have the same number of replacements. The code within DO REPEAT is repeated as many times as there are replacements for each variable. The first time, the first value for each repeat variable is substituted; the second time, the second value for each repeat variable is substituted; and so on. Repeat variable substitutions work like macros. They take place anywhere in a line that the repeat variable name occurs as a token, including command and subcommand names. For this reason it is not a good idea to select words commonly used in command and subcommand names as repeat variable identifiers. If PRINT is specified on END REPEAT, the commands after substitutions are made are printed to the listing file, prefixed by a plus sign (`+').  File: pspp.info, Node: LOOP, Prev: DO REPEAT, Up: Conditionals and Looping 11.4 LOOP ========= LOOP [index_var=start TO end [BY incr]] [IF condition]. ... END LOOP [IF condition]. LOOP iterates a group of commands. A number of termination options are offered. Specify index_var to make that variable count from one value to another by a particular increment. index_var must be a pre-existing numeric variable. start, end, and incr are numeric expressions (*note Expressions::.) During the first iteration, index_var is set to the value of start. During each successive iteration, index_var is increased by the value of incr. If end > start, then the loop terminates when index_var > end; otherwise it terminates when index_var < end. If incr is not specified then it defaults to +1 or -1 as appropriate. If end > start and incr < 0, or if end < start and incr > 0, then the loop is never executed. index_var is nevertheless set to the value of start. Modifying index_var within the loop is allowed, but it has no effect on the value of index_var in the next iteration. Specify a boolean expression for the condition on LOOP to cause the loop to be executed only if the condition is true. If the condition is false or missing before the loop contents are executed the first time, the loop contents are not executed at all. If index and condition clauses are both present on LOOP, the index clause is always evaluated first. Specify a boolean expression for the condition on END LOOP to cause the loop to terminate if the condition is not true after the enclosed code block is executed. The condition is evaluated at the end of the loop, not at the beginning. If the index clause and both condition clauses are not present, then the loop is executed MXLOOPS (*note SET::) times. BREAK also terminates LOOP execution (*note BREAK::). Loop index variables are by default reset to system-missing from one case to another, not left, unless a scratch variable is used as index. When loops are nested, this is usually undesired behavior, which can be corrected with LEAVE (*note LEAVE::) or by using a scratch variable as the loop index. When LOOP or END LOOP is specified following TEMPORARY (*note TEMPORARY::), the LAG function may not be used (*note LAG::).  File: pspp.info, Node: Statistics, Next: Utilities, Prev: Conditionals and Looping, Up: Top 12 Statistics ************* This chapter documents the statistical procedures that PSPP supports so far. * Menu: * DESCRIPTIVES:: Descriptive statistics. * FREQUENCIES:: Frequency tables. * EXAMINE:: Testing data for normality. * CROSSTABS:: Crosstabulation tables. * T-TEST:: Test hypotheses about means. * ONEWAY:: One way analysis of variance.  File: pspp.info, Node: DESCRIPTIVES, Next: FREQUENCIES, Prev: Statistics, Up: Statistics 12.1 DESCRIPTIVES ================= DESCRIPTIVES /VARIABLES=var_list /MISSING={VARIABLE,LISTWISE} {INCLUDE,NOINCLUDE} /FORMAT={LABELS,NOLABELS} {NOINDEX,INDEX} {LINE,SERIAL} /SAVE /STATISTICS={ALL,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS, SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM,DEFAULT, SESKEWNESS,SEKURTOSIS} /SORT={NONE,MEAN,SEMEAN,STDDEV,VARIANCE,KURTOSIS,SKEWNESS, RANGE,MINIMUM,MAXIMUM,SUM,SESKEWNESS,SEKURTOSIS,NAME} {A,D} The DESCRIPTIVES procedure reads the active file and outputs 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. All other subcommands are optional: The 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 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 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 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 names ZSC000 through ZSC999, STDZ00 through STDZ09, ZZZZ00 through 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: `ALL' All of the statistics below. `MEAN' Arithmetic mean. `SEMEAN' Standard error of the mean. `STDDEV' Standard deviation. `VARIANCE' Variance. `KURTOSIS' Kurtosis and standard error of the kurtosis. `SKEWNESS' Skewness and standard error of the skewness. `RANGE' Range. `MINIMUM' Minimum value. `MAXIMUM' Maximum value. `SUM' Sum. `DEFAULT' Mean, standard deviation of the mean, minimum, maximum. `SEKURTOSIS' Standard error of the kurtosis. `SESKEWNESS' Standard error of the skewness. The 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 and D settings request an ascending or descending sort order, respectively.  File: pspp.info, Node: FREQUENCIES, Next: EXAMINE, Prev: DESCRIPTIVES, Up: Statistics 12.2 FREQUENCIES ================ FREQUENCIES /VARIABLES=var_list /FORMAT={TABLE,NOTABLE,LIMIT(limit)} {STANDARD,CONDENSE,ONEPAGE[(onepage_limit)]} {LABELS,NOLABELS} {AVALUE,DVALUE,AFREQ,DFREQ} {SINGLE,DOUBLE} {OLDPAGE,NEWPAGE} /MISSING={EXCLUDE,INCLUDE} /STATISTICS={DEFAULT,MEAN,SEMEAN,MEDIAN,MODE,STDDEV,VARIANCE, KURTOSIS,SKEWNESS,RANGE,MINIMUM,MAXIMUM,SUM, SESKEWNESS,SEKURTOSIS,ALL,NONE} /NTILES=ntiles /PERCENTILES=percent... (These options are not currently implemented.) /BARCHART=... /HISTOGRAM=... /HBAR=... /GROUPED=... (Integer mode.) /VARIABLES=var_list (low,high)... The FREQUENCIES procedure outputs frequency tables for specified variables. FREQUENCIES can also calculate and display descriptive statistics (including median and mode) and percentiles. In the future, FREQUENCIES will also support graphical output in the form of bar charts and histograms. In addition, it will be able to support percentiles for grouped data. The VARIABLES subcommand is the only required subcommand. Specify the variables to be analyzed. In most cases, this is all that is required. This is known as "general mode". Occasionally, one may want to invoke a special mode called "integer mode". Normally, in general mode, PSPP will automatically determine 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 a range of data values in parentheses, separated by a comma. 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. The FORMAT subcommand controls the output format. It has several possible settings: * TABLE, the default, causes a frequency table to be output for every variable specified. NOTABLE prevents them from being output. LIMIT with a numeric argument causes them to be output except when there are more than the specified number of values in the table. * STANDARD frequency tables contain more complete information, but also to take up more space on the printed page. CONDENSE frequency tables are less informative but take up less space. ONEPAGE with a numeric argument will output standard frequency tables if there are the specified number of values or less, condensed tables otherwise. ONEPAGE without an argument defaults to a threshold of 50 values. * LABELS causes value labels to be displayed in STANDARD frequency tables. NOLABLES prevents this. * Normally frequency tables are sorted in ascending order by value. This is AVALUE. DVALUE tables are sorted in descending order by value. AFREQ and DFREQ tables are sorted in ascending and descending order, respectively, by frequency count. * SINGLE spaced frequency tables are closely spaced. DOUBLE spaced frequency tables have wider spacing. * OLDPAGE and NEWPAGE are not currently used. The 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, but are listed in frequency tables. The available STATISTICS are the same as available in DESCRIPTIVES (*note DESCRIPTIVES::), with the addition of MEDIAN, the data's median value, and MODE, the mode. (If there are multiple modes, the smallest value is reported.) By default, the mean, standard deviation of the 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 boundaries of the data set divided into the specified number of ranges. For instance, `/NTILES=4' would cause quartiles to be reported.  File: pspp.info, Node: EXAMINE, Next: CROSSTABS, Prev: FREQUENCIES, Up: Statistics 12.3 EXAMINE ============ EXAMINE VARIABLES=var_list [BY factor_list ] /STATISTICS={DESCRIPTIVES, EXTREME[(n)], ALL, NONE} /PLOT={STEMLEAF, BOXPLOT, NPPLOT, SPREADLEVEL(n), HISTOGRAM, ALL, NONE} /CINTERVAL n /COMPARE={GROUPS,VARIABLES} /ID={case_number, var_name} /{TOTAL,NOTOTAL} /PERCENTILE=[value_list]={HAVERAGE, WAVERAGE, ROUND, AEMPIRICAL, EMPIRICAL } /MISSING={LISTWISE, PAIRWISE} [{EXCLUDE, INCLUDE}] [{NOREPORT,REPORT}] The EXAMINE command is used to test how closely a distribution is to a normal distribution. It also shows you 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 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 var [BY var]. The STATISTICS subcommand specifies the analysis to be done. 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. The PLOT subcommand specifies which plots are to be produced if any. 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 /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 containing one boxplot per dependent variable. If the /COMPARE subcommand is ommitted, then PSPP uses the default value of /COMPARE=GROUPS. The CINTERVAL subcommand specifies the confidence interval to use in calculation of the descriptives command. The default it 95%. The 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, 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. *Warning!* If many dependent variable are given, or factors are given for which there are many distinct values, then EXAMINE will produce a very large quantity of output.  File: pspp.info, Node: CROSSTABS, Next: T-TEST, Prev: EXAMINE, Up: Statistics 12.4 CROSSTABS ============== CROSSTABS /TABLES=var_list BY var_list [BY var_list]... /MISSING={TABLE,INCLUDE,REPORT} /WRITE={NONE,CELLS,ALL} /FORMAT={TABLES,NOTABLES} {LABELS,NOLABELS,NOVALLABS} {PIVOT,NOPIVOT} {AVALUE,DVALUE} {NOINDEX,INDEX} {BOX,NOBOX} /CELLS={COUNT,ROW,COLUMN,TOTAL,EXPECTED,RESIDUAL,SRESIDUAL, ASRESIDUAL,ALL,NONE} /STATISTICS={CHISQ,PHI,CC,LAMBDA,UC,BTAU,CTAU,RISK,GAMMA,D, KAPPA,ETA,CORR,ALL,NONE} (Integer mode.) /VARIABLES=var_list (low,high)... The CROSSTABS procedure displays crosstabulation 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 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 "general mode". Occasionally, one may want to invoke a special mode called "integer 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. 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 table basis. When set to INCLUDE, user-missing values are included in tables and statistics. When set to REPORT, which is allowed only in integer mode, user-missing values are included in tables but marked with an `M' (for "missing") and excluded from statistical calculations. 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 settings: * TABLES, the default, causes crosstabulation tables to be output. NOTABLES suppresses them. * 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. * PIVOT, the default, causes each TABLES subcommand to be displayed in a pivot table format. NOPIVOT causes the old-style crosstabulation format to be used. * AVALUE, the default, causes values to be sorted in ascending order. DVALUE asserts a descending sort order. * INDEX/NOINDEX is currently ignored. * BOX/NOBOX is currently ignored. The CELLS subcommand controls the contents of each cell in the displayed crosstabulation table. The possible settings are: COUNT Frequency count. ROW Row percent. COLUMN Column percent. TOTAL Table percent. EXPECTED Expected value. RESIDUAL Residual. SRESIDUAL Standardized residual. ASRESIDUAL Adjusted standardized residual. ALL All of the above. NONE Suppress cells entirely. `/CELLS' without any settings specified requests COUNT, ROW, COLUMN, and TOTAL. If CELLS is not specified at all then only COUNT will be selected. The STATISTICS subcommand selects statistics for computation: CHISQ Pearson chi-square, likelihood ratio, Fisher's exact test, continuity correction, linear-by-linear association. PHI Phi. CC Contingency coefficient. LAMBDA Lambda. UC Uncertainty coefficient. BTAU Tau-b. CTAU Tau-c. RISK Risk estimate. GAMMA Gamma. D Somers' D. KAPPA Cohen's Kappa. ETA Eta. CORR Spearman correlation, Pearson's r. ALL All of the above. NONE No statistics. Selected statistics are only calculated when appropriate for the statistic. Certain statistics require tables of a particular size, and some statistics are calculated only in integer mode. `/STATISTICS' without any settings selects CHISQ. If the STATISTICS subcommand is not given, no statistics are calculated. *Please note:* Currently the implementation of CROSSTABS has the followings bugs: * Pearson's R (but not Spearman) is off a little. * T values for Spearman's R and Pearson's R are wrong. * Significance of symmetric and directional measures is not calculated. * Asymmetric ASEs and T values for lambda are wrong. * ASE of Goodman and Kruskal's tau is not calculated. * ASE of symmetric somers' d is wrong. * Approximate T of uncertainty coefficient is wrong. Fixes for any of these deficiencies would be welcomed.  File: pspp.info, Node: T-TEST, Next: ONEWAY, Prev: CROSSTABS, Up: Statistics 12.5 T-TEST =========== 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)] ] The T-TEST procedure outputs tables used in testing hypotheses about means. It operates in one of three modes: * One Sample mode. * Independent Groups mode. * Paired mode. Each of these modes are described in more detail below. There are two optional subcommands which are common to all modes. The /CRITERIA subcommand tells PSPP the confidence interval used in the tests. The default value is 0.95. The 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 /VARIABLES, /PAIRS or /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 equal mean * Paired Samples Mode:: Testing two interdependent groups for equal mean  File: pspp.info, Node: One Sample Mode, Next: Independent Samples Mode, Prev: T-TEST, Up: T-TEST 12.5.1 One Sample Mode ---------------------- The 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 TESTVAL subcommand is the value against which you wish to test. In this mode, you must also use the /VARIABLES subcommand to tell PSPP which variables you wish to test.  File: pspp.info, Node: Independent Samples Mode, Next: Paired Samples Mode, Prev: One Sample Mode, Up: T-TEST 12.5.2 Independent Samples Mode ------------------------------- The 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 /VARIABLES subcommand to tell PSPP the dependent variables you wish to test. The variable given in the 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 GROUPS subcommand, missing values in the independent variable are excluded on a listwise basis, regardless of whether /MISSING=LISTWISE was specified.  File: pspp.info, Node: Paired Samples Mode, Prev: Independent Samples Mode, Up: T-TEST 12.5.3 Paired Samples Mode -------------------------- The PAIRS subcommand introduces Paired Samples mode. Use this mode when repeated measures have been taken from the same samples. If the the `WITH' keyword is omitted, then tables for all combinations of variables given in the PAIRS subcommand are generated. If the `WITH' keyword is given, and the `(PAIRED)' keyword is also given, then the number of variables preceding `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 `WITH' keyword is given, but the `(PAIRED)' keyword is omitted, then tables for each combination of variable preceding `WITH' against variable following `WITH' are generated.  File: pspp.info, Node: ONEWAY, Prev: T-TEST, Up: Statistics 12.6 ONEWAY =========== ONEWAY [/VARIABLES = ] var_list BY var /MISSING={ANALYSIS,LISTWISE} {EXCLUDE,INCLUDE} /CONTRASTS= value1 [, value2] ... [,valueN] /STATISTICS={DESCRIPTIVES,HOMOGENEITY} The ONEWAY procedure performs a one-way analysis of variance of variables factored by a single independent variable. It is used to compare the means of a population divided into more than two groups. The variables to be analysed should be given in the `VARIABLES' subcommand. The list of variables must be followed by the `BY' keyword and the name of the independent (or factor) variable. You can use the `STATISTICS' subcommand to tell PSPP to display ancilliary information. The options accepted are: * DESCRIPTIVES Displays descriptive statistics about the groups factored by the independent variable. * HOMOGENEITY Displays the Levene test of Homogeneity of Variance for the variables and their groups. The `CONTRASTS' subcommand is used when you anticipate certain differences between the groups. 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 display a warning, but will proceed with the analysis. The `CONTRASTS' subcommand may be given up to 10 times in order to specify different contrast tests.  File: pspp.info, Node: Utilities, Next: Not Implemented, Prev: Statistics, Up: Top 13 Utilities ************ Commands that don't fit any other category are placed here. Most of these commands are not affected by commands like IF and LOOP: they take effect only once, unconditionally, at the time that they are encountered in the input. * Menu: * COMMENT:: Document your syntax file. * DOCUMENT:: Document the active file. * DISPLAY DOCUMENTS:: Display active file documents. * DISPLAY FILE LABEL:: Display the active file label. * DROP DOCUMENTS:: Remove documents from the active file. * ECHO:: Write a string to the output stream. * 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. * PERMISSIONS:: Change permissions on a file. * QUIT:: Terminate the PSPP session. * SET:: Adjust PSPP runtime parameters. * SHOW:: Display runtime parameters. * SUBTITLE:: Provide a document subtitle. * TITLE:: Provide a document title.  File: pspp.info, Node: COMMENT, Next: DOCUMENT, Prev: Utilities, Up: Utilities 13.1 COMMENT ============ Two possibles syntaxes: COMMENT comment text ... . *comment text ... . COMMENT is ignored. It is used to provide information to the author and other readers of the PSPP syntax file. COMMENT can extend over any number of lines. Don't forget to terminate it with a dot or a blank line.  File: pspp.info, Node: DOCUMENT, Next: DISPLAY DOCUMENTS, Prev: COMMENT, Up: Utilities 13.2 DOCUMENT ============= DOCUMENT documentary_text. DOCUMENT adds one or more lines of descriptive commentary to the active file. Documents added in this way are saved to system files. They can be viewed using SYSFILE INFO or DISPLAY DOCUMENTS. They can be removed from the active file with DROP DOCUMENTS. Specify the documentary text following the DOCUMENT keyword. You can extend the documentary text over as many lines as necessary. Lines are truncated at 80 characters width. Don't forget to terminate the command with a dot or a blank line.  File: pspp.info, Node: DISPLAY DOCUMENTS, Next: DISPLAY FILE LABEL, Prev: DOCUMENT, Up: Utilities 13.3 DISPLAY DOCUMENTS ====================== DISPLAY DOCUMENTS. DISPLAY DOCUMENTS displays the documents in the active file. Each document is preceded by a line giving the time and date that it was added. *Note DOCUMENT::.  File: pspp.info, Node: DISPLAY FILE LABEL, Next: DROP DOCUMENTS, Prev: DISPLAY DOCUMENTS, Up: Utilities 13.4 DISPLAY FILE LABEL ======================= DISPLAY FILE LABEL. DISPLAY FILE LABEL displays the file label contained in the active file, if any. *Note FILE LABEL::.  File: pspp.info, Node: DROP DOCUMENTS, Next: ECHO, Prev: DISPLAY FILE LABEL, Up: Utilities 13.5 DROP DOCUMENTS =================== DROP DOCUMENTS. DROP DOCUMENTS removes all documents from the active file. New documents can be added with DOCUMENT (*note DOCUMENT::). DROP DOCUMENTS changes only the active file. It does not modify any system files stored on disk.  File: pspp.info, Node: ECHO, Next: ERASE, Prev: DROP DOCUMENTS, Up: Utilities 13.6 ECHO ========= ECHO 'arbitrary text' . Use ECHO to write arbitrary text to the output stream. The text should be enclosed in quotation marks following the normal rules for string tokens (*note Tokens::).  File: pspp.info, Node: ERASE, Next: EXECUTE, Prev: ECHO, Up: Utilities 13.7 ERASE ========== ERASE FILE file_name. 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.  File: pspp.info, Node: EXECUTE, Next: FILE LABEL, Prev: ERASE, Up: Utilities 13.8 EXECUTE ============ EXECUTE. EXECUTE causes the active file to be read and all pending transformations to be executed.  File: pspp.info, Node: FILE LABEL, Next: FINISH, Prev: EXECUTE, Up: Utilities 13.9 FILE LABEL =============== FILE LABEL file_label. FILE LABEL provides a title for the active file. This title will be saved into system files and portable files that are created during this PSPP run. file_label need not be quoted. If quotes are included, they become part of the file label.  File: pspp.info, Node: FINISH, Next: HOST, Prev: FILE LABEL, Up: Utilities 13.10 FINISH ============ FINISH. FINISH terminates the current PSPP session and returns control to the operating system. This command is not valid in interactive mode.  File: pspp.info, Node: HOST, Next: INCLUDE, Prev: FINISH, Up: Utilities 13.11 HOST ========== HOST. 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.  File: pspp.info, Node: INCLUDE, Next: PERMISSIONS, Prev: HOST, Up: Utilities 13.12 INCLUDE ============= Two possible syntaxes: INCLUDE 'filename'. @filename. INCLUDE causes the PSPP command processor to read an additional command file as if it were included bodily in the current command file. Include files may be nested to any depth, up to the limit of available memory.  File: pspp.info, Node: PERMISSIONS, Next: QUIT, Prev: INCLUDE, Up: Utilities 13.13 PERMISSIONS ================= PERMISSIONS FILE='filename' /PERMISSIONS = {READONLY,WRITEABLE}. PERMISSIONS changes the permissions of a file. There is one mandatory subcommand which specifies the permissions to which the file should be changed. If you set a file's permission to READONLY, then the file will become unwritable either by you or anyone else on the system. If you set the permission to WRITEABLE, then the file will become writeable by you; the permissions afforded to others will be unchanged. This command cannot be used if the SAFER setting is active.  File: pspp.info, Node: QUIT, Next: SET, Prev: PERMISSIONS, Up: Utilities 13.14 QUIT ========== Two possible syntaxes: QUIT. EXIT. QUIT terminates the current PSPP session and returns control to the operating system. This command is not valid within a command file.  File: pspp.info, Node: SET, Next: SHOW, Prev: QUIT, Up: Utilities 13.15 SET ========= SET (data input) /BLANKS={SYSMIS,'.',number} /DECIMAL={DOT,COMMA} /FORMAT=fmt_spec /EPOCH={AUTOMATIC,year} (program input) /ENDCMD='.' /NULLINE={ON,OFF} (interaction) /CPROMPT='cprompt_string' /DPROMPT='dprompt_string' /ERRORBREAK={OFF,ON} /MXERRS=max_errs /MXWARNS=max_warnings /PROMPT='prompt' /VIEWLENGTH={MINIMUM,MEDIAN,MAXIMUM,n_lines} /VIEWWIDTH=n_characters (program execution) /MEXPAND={ON,OFF} /MITERATE=max_iterations /MNEST=max_nest /MPRINT={ON,OFF} /MXLOOPS=max_loops /SEED={RANDOM,seed_value} /UNDEFINED={WARN,NOWARN} (data output) /CC{A,B,C,D,E}={'npre,pre,suf,nsuf','npre.pre.suf.nsuf'} /DECIMAL={DOT,COMMA} /FORMAT=fmt_spec (output routing) /ECHO={ON,OFF} /ERRORS={ON,OFF,TERMINAL,LISTING,BOTH,NONE} /INCLUDE={ON,OFF} /MESSAGES={ON,OFF,TERMINAL,LISTING,BOTH,NONE} /PRINTBACK={ON,OFF} /RESULTS={ON,OFF,TERMINAL,LISTING,BOTH,NONE} (output activation) /LISTING={ON,OFF} /PRINTER={ON,OFF} /SCREEN={ON,OFF} (output driver options) /HEADERS={NO,YES,BLANK} /LENGTH={NONE,length_in_lines} /LISTING=filename /MORE={ON,OFF} /PAGER={OFF,"pager_name"} /WIDTH={NARROW,WIDTH,n_characters} (logging) /JOURNAL={ON,OFF} [filename] /LOG={ON,OFF} [filename] (system files) /COMPRESSION={ON,OFF} /SCOMPRESSION={ON,OFF} (security) /SAFER=ON (obsolete settings accepted for compatibility, but ignored) /AUTOMENU={ON,OFF} /BEEP={ON,OFF} /BLOCK='c' /BOXSTRING={'xxx','xxxxxxxxxxx'} /CASE={UPPER,UPLOW} /COLOR=... /CPI=cpi_value /DISK={ON,OFF} /EJECT={ON,OFF} /HELPWINDOWS={ON,OFF} /HIGHRES={ON,OFF} /HISTOGRAM='c' /LOWRES={AUTO,ON,OFF} /LPI=lpi_value /MENUS={STANDARD,EXTENDED} /MXMEMORY=max_memory /PTRANSLATE={ON,OFF} /RCOLORS=... /RUNREVIEW={AUTO,MANUAL} /SCRIPTTAB='c' /TB1={'xxx','xxxxxxxxxxx'} /TBFONTS='string' /WORKDEV=drive_letter /WORKSPACE=workspace_size /XSORT={YES,NO} SET allows the user to adjust several parameters relating to PSPP's execution. Since there are many subcommands to this command, its subcommands will be examined in groups. On subcommands that take boolean values, ON and YES are synonym, and as are OFF and NO, when used as subcommand values. The data input subcommands affect the way that data is read from data files. The data input subcommands are BLANKS This is the value assigned to an item data item that is empty or contains only white space. An argument of SYSMIS or '.' will cause the system-missing value to be assigned to null items. This is the default. Any real value may be assigned. DECIMAL The default DOT setting causes the decimal point character to be `.'. A setting of COMMA causes the decimal point character to be `,'. FORMAT Allows the default numeric input/output format to be specified. The default is F8.2. *Note Input/Output Formats::. EPOCH Specifies the range of years used when a 2-digit year is read from a data file or used in a date construction expression (*note Date Construction::). If a 4-digit year is specified, then 2-digit years are interpreted starting from that year, known as the epoch. If AUTOMATIC (the default) is specified, then the epoch begins 69 years before the current date. Program input subcommands affect the way that programs are parsed when they are typed interactively or run from a script. They are ENDCMD This is a single character indicating the end of a command. The default is `.'. Don't change this. NULLINE Whether a blank line is interpreted as ending the current command. The default is ON. Interaction subcommands affect the way that PSPP interacts with an online user. The interaction subcommands are CPROMPT The command continuation prompt. The default is ` > '. DPROMPT Prompt used when expecting data input within BEGIN DATA (*note BEGIN DATA::). The default is `data> '. ERRORBREAK Whether an error causes PSPP to stop processing the current command file after finishing the current command. The default is OFF. MXERRS The maximum number of errors before PSPP halts processing of the current command file. The default is 50. MXWARNS The maximum number of warnings + errors before PSPP halts processing the current command file. The default is 100. PROMPT The command prompt. The default is `PSPP> '. VIEWLENGTH The length of the screen in lines. MINIMUM means 25 lines, MEDIAN and MAXIMUM mean 43 lines. Otherwise specify the number of lines. Normally PSPP should auto-detect your screen size so this shouldn't have to be used. VIEWWIDTH The width of the screen in characters. Normally 80 or 132. Program execution subcommands control the way that PSPP commands execute. The program execution subcommands are MEXPAND MITERATE MNEST MPRINT Currently not used. MXLOOPS The maximum number of iterations for an uncontrolled loop (*note LOOP::). SEED The initial pseudo-random number seed. Set to a real number or to RANDOM, which will obtain an initial seed from the current time of day. UNDEFINED Currently not used. Data output subcommands affect the format of output data. These subcommands are CCA CCB CCC CCD CCE Set up custom currency formats. The argument is a string which must contain exactly three commas or exactly three periods. If commas, then the grouping character for the currency format is `,', and the decimal point character is `.'; if periods, then the situation is reversed. The commas or periods divide the string into four fields, which are, in order, the negative prefix, prefix, suffix, and negative suffix. When a value is formatted using the custom currency format, the prefix precedes the value formatted and the suffix follows it. In addition, if the value is negative, the negative prefix precedes the prefix and the negative suffix follows the suffix. DECIMAL The default DOT setting causes the decimal point character to be `.'. A setting of COMMA causes the decimal point character to be `,'. FORMAT Allows the default numeric input/output format to be specified. The default is F8.2. *Note Input/Output Formats::. Output routing subcommands affect where the output of transformations and procedures is sent. These subcommands are ECHO If turned on, commands are written to the listing file as they are read from command files. The default is OFF. ERRORS INCLUDE MESSAGES PRINTBACK RESULTS Currently not used. Output activation subcommands affect whether output devices of particular types are enabled. These subcommands are LISTING Enable or disable listing devices. PRINTER Enable or disable printer devices. SCREEN Enable or disable screen devices. Output driver option subcommands affect output drivers' settings. These subcommands are HEADERS LENGTH LISTING MORE PAGER WIDTH Logging subcommands affect logging of commands executed to external files. These subcommands are JOURNAL LOG Not currently used. System file subcommands affect the default format of system files produced by PSPP. These subcommands are COMPRESSION Not currently used. SCOMPRESSION Whether system files created by SAVE or XSAVE are compressed by default. The default is ON. Security subcommands affect the operations that commands are allowed to perform. The security subcommands are SAFER Setting this option disables the following operations: * The ERASE command. * The HOST command. * The PERMISSIONS command. * Pipe filenames (filenames beginning or ending with `|'). Be aware that this setting does not guarantee safety (commands can still overwrite files, for instance) but it is an improvement. When set, this setting cannot be reset during the same session, for obvious security reasons.  File: pspp.info, Node: SHOW, Next: SUBTITLE, Prev: SET, Up: Utilities 13.16 SHOW ========== SHOW /SUBCOMMAND SHOW can be used to display the current state of PSPP's execution parameters. All of the parameters which can be changed using `SET' *Note SET::, can be examined using SHOW, by using a subcommand with the same name. In addition, `SHOW' supports the following subcommands: `WARRANTY' Show details of the lack of warranty for PSPP. `COPYING' Display the terms of PSPP's copyright licence *Note License::.  File: pspp.info, Node: SUBTITLE, Next: TITLE, Prev: SHOW, Up: Utilities 13.17 SUBTITLE ============== SUBTITLE 'subtitle_string'. or SUBTITLE subtitle_string. SUBTITLE provides a subtitle to a particular PSPP run. This subtitle appears at the top of each output page below the title, if headers are enabled on the output device. Specify a subtitle as a string in quotes. The alternate syntax that did not require quotes is now obsolete. If it is used then the subtitle is converted to all uppercase.  File: pspp.info, Node: TITLE, Prev: SUBTITLE, Up: Utilities 13.18 TITLE =========== TITLE 'title_string'. or TITLE title_string. TITLE provides a title to a particular PSPP run. This title appears at the top of each output page, if headers are enabled on the output device. Specify a title as a string in quotes. The alternate syntax that did not require quotes is now obsolete. If it is used then the title is converted to all uppercase.  File: pspp.info, Node: Not Implemented, Next: Bugs, Prev: Utilities, Up: Top 14 Not Implemented ****************** This chapter lists parts of the PSPP language that are not yet implemented. ACF Autocorrelation function ADD FILES Add files to dictionary ALSCAL Multidimensional scaling ANOVA Factorial analysis of variance CASEPLOT Plot time series CASESTOVARS Restructure complex data CCF Time series cross correlation CLUSTER Hierachial clustering CONJOINT Analyse full concept data COXREG Cox proportional hazards regression CREATE Create time series data CURVEFIT Fit curve to line plot DATE Create time series data DISCRIMINANT Linear discriminant analysis EDIT obsolete END FILE TYPE Ends complex data input FACTOR Factor analysis FILE TYPE Complex data input FIT Goodness of Fit GET TRANSLATE Read other file formats GLM General Linear Model GRAPH Draw graphs IGRAPH Interactive graphs INFO Local Documentation KEYED DATA LIST Read nonsequential data KM Kaplan-Meier LOGISTIC REGRESSION Regression Analysis MCONVERT Convert covariance/correlation matrices MULT RESPONSE Multiple reponse analysis MVA Missing value analysis NLR Non Linear Regression NONPAR CORR Nonparametric correlation NPAR TESTS Nonparametric tests NUMBERED PACF Partial autocorrelation PARTIAL CORR Partial correlation POINT Marker in keyed file PPLOT Plot time series variables PREDICT Specify forecast period PRESERVE Push settings PROCEDURE OUTPUT Specify output file PROBIT Probit analysis PROXIMITIES Pairwise similarity QUICK CLUSTER Fast clustering RANK Create rank scores REFORMAT Read obsolete files REGRESSION Compute regression coefficients REPEATING DATA Specify multiple cases per input record REPORT Pretty print working file RESTORE Restore settings ROC Receiver operating characteristic RMV Replace missing values SAVE TRANSLATE Save to foriegn format SCRIPT Run script file SPCHART Plot control charts SUMMARIZE Univariate statistics SURVIVAL Survival analysis TSET Set time sequence variables TSHOW Show time sequence variables TSPLOT Plot time sequence variables UNIANOVA Univariate analysis UNNUMBERED obsolete UPDATE Update working file VARSTOCASES Restructure complex data VERIFY Report time series  File: pspp.info, Node: Bugs, Next: Function Index, Prev: Not Implemented, Up: Top 15 Bugs ******* PSPP does have bugs. We do our best to fix them, but our limited resources mean that some may remain for a long time. Our best alternative is to make you aware of PSPP's known bugs. To see a list, visit PSPP's project webpage at `https://savannah.gnu.org/projects/pspp'. You can also submit your own bug report there: click on "Bugs," then on "Submit a Bug," and fill out the form. Alternatively, PSPP bug reports may be sent by email to . For known bugs in individual language features, see the documentation for that feature.  File: pspp.info, Node: Function Index, Next: Command Index, Prev: Bugs, Up: Top 16 Function Index ***************** [index] * Menu: * ABS: Miscellaneous Mathematics. (line 10) * ACOS: Trigonometry. (line 11) * ANY: Set Membership. (line 14) * ARCOS: Trigonometry. (line 10) * ARSIN: Trigonometry. (line 16) * ARTAN: Trigonometry. (line 21) * ASIN: Trigonometry. (line 17) * ATAN: Trigonometry. (line 22) * CDF.BERNOULLI: Discrete Distributions. (line 10) * CDF.BETA: Continuous Distributions. (line 10) * CDF.BINOMIAL: Discrete Distributions. (line 16) * CDF.CAUCHY: Continuous Distributions. (line 26) * CDF.CHISQ: Continuous Distributions. (line 33) * CDF.EXP: Continuous Distributions. (line 44) * CDF.F: Continuous Distributions. (line 58) * CDF.GAMMA: Continuous Distributions. (line 70) * CDF.GEOM: Discrete Distributions. (line 22) * CDF.HALFNRM: Continuous Distributions. (line 77) * CDF.HYPER: Discrete Distributions. (line 28) * CDF.IGAUSS: Continuous Distributions. (line 84) * CDF.LAPLACE: Continuous Distributions. (line 95) * CDF.LNORMAL: Continuous Distributions. (line 118) * CDF.LOGISTIC: Continuous Distributions. (line 111) * CDF.NEGBIN: Discrete Distributions. (line 40) * CDF.NORMAL: Continuous Distributions. (line 125) * CDF.PARETO: Continuous Distributions. (line 148) * CDF.POISSON: Discrete Distributions. (line 47) * CDF.RAYLEIGH: Continuous Distributions. (line 155) * CDF.SMOD: Continuous Distributions. (line 167) * CDF.SRANGE: Continuous Distributions. (line 172) * CDF.T: Continuous Distributions. (line 178) * CDF.T1G: Continuous Distributions. (line 188) * CDF.T2G: Continuous Distributions. (line 194) * CDF.UNIFORM: Continuous Distributions. (line 200) * CDF.VBNOR: Continuous Distributions. (line 20) * CDF.WEIBULL: Continuous Distributions. (line 211) * CDFNORM: Continuous Distributions. (line 132) * CFVAR: Statistical Functions. (line 25) * CONCAT: String Functions. (line 9) * COS: Trigonometry. (line 25) * CTIME.DAYS: Time Extraction. (line 10) * CTIME.HOURS: Time Extraction. (line 13) * CTIME.MINUTES: Time Extraction. (line 16) * CTIME.SECONDS: Time Extraction. (line 19) * DATE.DMY: Date Construction. (line 40) * DATE.MDY: Date Construction. (line 41) * DATE.MOYR: Date Construction. (line 45) * DATE.QYR: Date Construction. (line 49) * DATE.WKYR: Date Construction. (line 53) * DATE.YRDAY: Date Construction. (line 57) * EXP: Mathematics. (line 10) * IDF.BETA: Continuous Distributions. (line 11) * IDF.CAUCHY: Continuous Distributions. (line 27) * IDF.CHISQ: Continuous Distributions. (line 35) * IDF.EXP: Continuous Distributions. (line 45) * IDF.F: Continuous Distributions. (line 60) * IDF.GAMMA: Continuous Distributions. (line 71) * IDF.HALFNRM: Continuous Distributions. (line 78) * IDF.IGAUSS: Continuous Distributions. (line 85) * IDF.LAPLACE: Continuous Distributions. (line 96) * IDF.LNORMAL: Continuous Distributions. (line 119) * IDF.LOGISTIC: Continuous Distributions. (line 112) * IDF.NORMAL: Continuous Distributions. (line 126) * IDF.PARETO: Continuous Distributions. (line 149) * IDF.RAYLEIGH: Continuous Distributions. (line 156) * IDF.SMOD: Continuous Distributions. (line 168) * IDF.SRANGE: Continuous Distributions. (line 173) * IDF.T: Continuous Distributions. (line 179) * IDF.T1G: Continuous Distributions. (line 189) * IDF.T2G: Continuous Distributions. (line 195) * IDF.UNIFORM: Continuous Distributions. (line 201) * IDF.WEIBULL: Continuous Distributions. (line 212) * INDEX: String Functions. (line 14) * LAG: Miscellaneous Functions. (line 10) * LENGTH: String Functions. (line 28) * LG10: Mathematics. (line 13) * LN: Mathematics. (line 17) * LNGAMMA: Mathematics. (line 21) * LOWER: String Functions. (line 31) * LPAD: String Functions. (line 36) * LTRIM: String Functions. (line 49) * MAX: Statistical Functions. (line 30) * MEAN: Statistical Functions. (line 34) * MIN: Statistical Functions. (line 37) * MISSING: Missing Value Functions. (line 13) * MOD: Miscellaneous Mathematics. (line 13) * MOD10: Miscellaneous Mathematics. (line 19) * NCDF.BETA: Continuous Distributions. (line 14) * NCDF.CHISQ: Continuous Distributions. (line 38) * NCDF.F: Continuous Distributions. (line 63) * NCDF.T: Continuous Distributions. (line 182) * NMISS: Missing Value Functions. (line 16) * NORMAL: Continuous Distributions. (line 138) * NPDF.BETA: Continuous Distributions. (line 13) * NPDF.CHISQ: Continuous Distributions. (line 37) * NPDF.F: Continuous Distributions. (line 62) * NPDF.T: Continuous Distributions. (line 181) * NUMBER: String Functions. (line 59) * NVALID: Missing Value Functions. (line 21) * PDF.BERNOULLI: Discrete Distributions. (line 9) * PDF.BETA: Continuous Distributions. (line 9) * PDF.BINOMIAL: Discrete Distributions. (line 15) * PDF.BVNOR: Continuous Distributions. (line 19) * PDF.CAUCHY: Continuous Distributions. (line 25) * PDF.CHISQ: Continuous Distributions. (line 32) * PDF.EXP: Continuous Distributions. (line 43) * PDF.F: Continuous Distributions. (line 57) * PDF.GAMMA: Continuous Distributions. (line 69) * PDF.GEOM: Discrete Distributions. (line 21) * PDF.HALFNRM: Continuous Distributions. (line 76) * PDF.HYPER: Discrete Distributions. (line 27) * PDF.IGAUSS: Continuous Distributions. (line 83) * PDF.LANDAU: Continuous Distributions. (line 90) * PDF.LAPLACE: Continuous Distributions. (line 94) * PDF.LNORMAL: Continuous Distributions. (line 117) * PDF.LOG: Discrete Distributions. (line 34) * PDF.LOGISTIC: Continuous Distributions. (line 110) * PDF.NEGBIN: Discrete Distributions. (line 39) * PDF.NORMAL: Continuous Distributions. (line 124) * PDF.NTAIL: Continuous Distributions. (line 141) * PDF.PARETO: Continuous Distributions. (line 147) * PDF.POISSON: Discrete Distributions. (line 46) * PDF.RAYLEIGH: Continuous Distributions. (line 154) * PDF.RTAIL: Continuous Distributions. (line 161) * PDF.T: Continuous Distributions. (line 177) * PDF.T1G: Continuous Distributions. (line 187) * PDF.T2G: Continuous Distributions. (line 193) * PDF.UNIFORM: Continuous Distributions. (line 199) * PDF.WEIBULL: Continuous Distributions. (line 210) * PDF.XPOWER: Continuous Distributions. (line 51) * PROBIT: Continuous Distributions. (line 135) * RANGE: Set Membership. (line 20) * RINDEX: String Functions. (line 69) * RND: Miscellaneous Mathematics. (line 23) * RPAD: String Functions. (line 83) * RTRIM: String Functions. (line 96) * RV.BERNOULLI: Discrete Distributions. (line 11) * RV.BETA: Continuous Distributions. (line 12) * RV.BINOMIAL: Discrete Distributions. (line 17) * RV.CAUCHY: Continuous Distributions. (line 28) * RV.CHISQ: Continuous Distributions. (line 36) * RV.EXP: Continuous Distributions. (line 46) * RV.F: Continuous Distributions. (line 61) * RV.GAMMA: Continuous Distributions. (line 72) * RV.GEOM: Discrete Distributions. (line 23) * RV.HALFNRM: Continuous Distributions. (line 79) * RV.HYPER: Discrete Distributions. (line 29) * RV.IGAUSS: Continuous Distributions. (line 86) * RV.LANDAU: Continuous Distributions. (line 91) * RV.LAPLACE: Continuous Distributions. (line 97) * RV.LEVY: Continuous Distributions. (line 101) * RV.LNORMAL: Continuous Distributions. (line 120) * RV.LOG: Discrete Distributions. (line 35) * RV.LOGISTIC: Continuous Distributions. (line 113) * RV.LVSKEW: Continuous Distributions. (line 105) * RV.NEGBIN: Discrete Distributions. (line 41) * RV.NORMAL: Continuous Distributions. (line 127) * RV.NTAIL: Continuous Distributions. (line 142) * RV.PARETO: Continuous Distributions. (line 150) * RV.POISSON: Discrete Distributions. (line 48) * RV.RAYLEIGH: Continuous Distributions. (line 157) * RV.RTAIL: Continuous Distributions. (line 162) * RV.T: Continuous Distributions. (line 180) * RV.UNIFORM: Continuous Distributions. (line 202) * RV.WEIBULL: Continuous Distributions. (line 213) * RV.XPOWER: Continuous Distributions. (line 52) * SD: Statistical Functions. (line 41) * SIG.CHISQ: Continuous Distributions. (line 34) * SIG.F: Continuous Distributions. (line 59) * SIN: Trigonometry. (line 28) * SQRT: Mathematics. (line 25) * STRING: String Functions. (line 105) * SUBSTR: String Functions. (line 110) * SUM: Statistical Functions. (line 44) * SYSMIS: Missing Value Functions. (line 26) * TAN: Trigonometry. (line 31) * TIME.DAYS: Time Construction. (line 10) * TIME.HMS: Time Construction. (line 13) * TRUNC: Miscellaneous Mathematics. (line 27) * UNIFORM: Continuous Distributions. (line 207) * UPCASE: String Functions. (line 125) * VALUE: Missing Value Functions. (line 32) * VARIANCE: Statistical Functions. (line 47) * XDATE.DATE: Date Extraction. (line 19) * XDATE.HOUR: Date Extraction. (line 25) * XDATE.JDAY: Date Extraction. (line 31) * XDATE.MDAY: Date Extraction. (line 35) * XDATE.MINUTE: Date Extraction. (line 39) * XDATE.MONTH: Date Extraction. (line 43) * XDATE.QUARTER: Date Extraction. (line 47) * XDATE.SECOND: Date Extraction. (line 51) * XDATE.TDAY: Date Extraction. (line 55) * XDATE.TIME: Date Extraction. (line 58) * XDATE.WEEK: Date Extraction. (line 63) * XDATE.WKDAY: Date Extraction. (line 67) * XDATE.YEAR: Date Extraction. (line 71) * YRMODA: Miscellaneous Functions. (line 22)  File: pspp.info, Node: Command Index, Next: Concept Index, Prev: Function Index, Up: Top 17 Command Index **************** [index] * Menu: * *: COMMENT. (line 6) * @: INCLUDE. (line 6) * ADD VALUE LABELS: ADD VALUE LABELS. (line 6) * AGGREGATE: AGGREGATE. (line 6) * APPLY DICTIONARY: APPLY DICTIONARY. (line 6) * AUTORECODE: AUTORECODE. (line 6) * BEGIN DATA: BEGIN DATA. (line 6) * BREAK: BREAK. (line 6) * CLEAR TRANSFORMATIONS: CLEAR TRANSFORMATIONS. (line 6) * COMMENT: COMMENT. (line 6) * COMPUTE: COMPUTE. (line 6) * COUNT: COUNT. (line 6) * CROSSTABS: CROSSTABS. (line 6) * DATA LIST: DATA LIST. (line 6) * DATA LIST FIXED: DATA LIST FIXED. (line 6) * DATA LIST FREE: DATA LIST FREE. (line 6) * DATA LIST LIST: DATA LIST LIST. (line 6) * DESCRIPTIVES: DESCRIPTIVES. (line 6) * DISPLAY: DISPLAY. (line 6) * DISPLAY DOCUMENTS: DISPLAY DOCUMENTS. (line 6) * DISPLAY FILE LABEL: DISPLAY FILE LABEL. (line 6) * DISPLAY VECTORS: DISPLAY VECTORS. (line 6) * DO IF: DO IF. (line 6) * DO REPEAT: DO REPEAT. (line 6) * DOCUMENT: DOCUMENT. (line 6) * DROP DOCUMENTS: DROP DOCUMENTS. (line 6) * ECHO: ECHO. (line 6) * END CASE: END CASE. (line 6) * END DATA: BEGIN DATA. (line 6) * END FILE: END FILE. (line 6) * ERASE: ERASE. (line 6) * EXAMINE: EXAMINE. (line 6) * EXECUTE: EXECUTE. (line 6) * EXPORT: EXPORT. (line 6) * FILE HANDLE: FILE HANDLE. (line 6) * FILE LABEL: FILE LABEL. (line 6) * FILTER: FILTER. (line 6) * FINISH: FINISH. (line 6) * FLIP: FLIP. (line 6) * FORMATS: FORMATS. (line 6) * FREQUENCIES: FREQUENCIES. (line 6) * GET: GET. (line 6) * HOST: HOST. (line 6) * IF: IF. (line 6) * IMPORT: IMPORT. (line 6) * INCLUDE: INCLUDE. (line 6) * INPUT PROGRAM: INPUT PROGRAM. (line 6) * LEAVE: LEAVE. (line 6) * LIST: LIST. (line 6) * LOOP: LOOP. (line 6) * MATCH FILES: MATCH FILES. (line 6) * MATRIX DATA: MATRIX DATA. (line 6) * MISSING VALUES: MISSING VALUES. (line 6) * MODIFY VARS: MODIFY VARS. (line 6) * N OF CASES: N OF CASES. (line 6) * NEW FILE: NEW FILE. (line 6) * NUMERIC: NUMERIC. (line 6) * ONEWAY: ONEWAY. (line 6) * PERMISSIONS: PERMISSIONS. (line 6) * PRINT: PRINT. (line 6) * PRINT EJECT: PRINT EJECT. (line 6) * PRINT FORMATS: PRINT FORMATS. (line 6) * PRINT SPACE: PRINT SPACE. (line 6) * PROCESS IF: PROCESS IF. (line 6) * QUIT: QUIT. (line 6) * RECODE: RECODE. (line 6) * RENAME VARIABLES: RENAME VARIABLES. (line 6) * REPEATING DATA: REPEATING DATA. (line 6) * REREAD: REREAD. (line 6) * SAMPLE: SAMPLE. (line 6) * SAVE: SAVE. (line 6) * SELECT IF: SELECT IF. (line 6) * SET: SET. (line 6) * SHOW: SHOW. (line 6) * SORT CASES: SORT CASES. (line 6) * SPLIT FILE: SPLIT FILE. (line 6) * STRING: STRING. (line 6) * SUBTITLE: SUBTITLE. (line 6) * SYSFILE INFO: SYSFILE INFO. (line 6) * T-TEST: T-TEST. (line 6) * TEMPORARY: TEMPORARY. (line 6) * TITLE: TITLE. (line 6) * VALUE LABELS: VALUE LABELS. (line 6) * VARIABLE ALIGNMENT: VARIABLE ALIGNMENT. (line 6) * VARIABLE LABELS: VARIABLE LABELS. (line 6) * VARIABLE LEVEL: VARIABLE LEVEL. (line 6) * VARIABLE WIDTH: VARIABLE WIDTH. (line 6) * VECTOR: VECTOR. (line 6) * WEIGHT: WEIGHT. (line 6) * WRITE: WRITE. (line 6) * WRITE FORMATS: WRITE FORMATS. (line 6) * XSAVE: XSAVE. (line 6)