27.03.2013 Views

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SPSS® 12.0 Command Syntax Reference

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Options<br />

AGGREGATE 91<br />

Aggregated File. You can produce either an SPSS-format data file or a new working file.<br />

Documentary Text. You can copy documentary text from the original file into the aggregated<br />

file using the DOCUMENT subcommand. By default, documentary text is dropped.<br />

Sorting. By default, cases in the aggregated file are sorted in ascending order of the values of<br />

each break variable. Alternatively, you can specify descending order. If the working file is<br />

already sorted by the break variables, you can skip this final sorting pass through the file<br />

using the PRESORTED subcommand.<br />

Aggregated Variables. You can create aggregated variables using any of 19 aggregate functions.<br />

The functions SUM, MEAN, and SD can aggregate only numeric variables. All other<br />

functions can use both numeric and string variables.<br />

Labels and Formats. You can specify variable labels for the aggregated variables. Variables<br />

created with the functions MAX, MIN, FIRST, and LAST assume the formats and value labels<br />

of their source variables. All other variables assume the default formats described under<br />

“Aggregate Functions” on p. 94.<br />

Basic Specification<br />

The basic specification is OUTFILE, BREAK, and at least one aggregate function and source<br />

variable. OUTFILE specifies a name for the aggregated file. BREAK names the case grouping<br />

(break) variables. The aggregate function creates a new aggregated variable.<br />

Subcommand Order<br />

• OUTFILE must be specified first.<br />

• If specified, DOCUMENT and PRESORTED must precede BREAK. No other subcommand<br />

can be specified between these two subcommands.<br />

• MISSING, if specified, must immediately follow OUTFILE.<br />

• The aggregate functions must be specified last.<br />

Operations<br />

• When AGGREGATE produces an SPSS-format data file, the working file remains unchanged<br />

and is still available for analysis. When AGGREGATE creates a new working file,<br />

it replaces the old working file. Only the new working file is available for analysis.<br />

• The aggregated file contains the break variables plus the variables created by the<br />

aggregate functions.<br />

• AGGREGATE excludes cases with missing values from all aggregate calculations except<br />

those involving functions N, NU, NMISS, and NUMISS.<br />

• Unless otherwise specified, AGGREGATE sorts cases in the aggregated file in ascending<br />

order of the values of the grouping variables.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!