SPSS Aggregate
Contents
Usage
aggregate outfile=* mode=addvariables /Total_Sales = sum(Sales).
The new variable Total_Sales is implicitly created using the Sales variable and the sum function.
See here for the list of available AGGREGATE functions.
Break
The /BREAK subcommand specifies one or more variables to split aggregation.
Note that omitting a /BREAK subcommand is unsupported in PSPP, and unsupported in SPSS version 16 or earlier.
Presorted
If the dataset is already sorted by all variables specified on the /BREAK subcommand, use the /PRESORTED subcommand to skip re-sorting. The /PRESORTED subcommand must precede the /BREAK subcommand.
Outfile and Mode
The default behavior is OUTFILE=* and MODE=ADDVARIABLES (i.e. modify the active dataset in-place and add variables to it).
To instead populate a new dataset, try:
sort cases by VARLIST. dataset declare DUPLICATES. aggregate /outfile="DUPLICATES" /presorted /break=VARLIST /COUNT=N. execute. dataset activate DUPLICATES. select if COUNT>1.