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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

AGGREGATE 93<br />

• MATCH FILES specifies a table lookup match with AGGFILE as the table file and the sorted<br />

working data file as the case file.<br />

• BY indicates that the keys for the match are LOCATN and DEPT.<br />

• KEEP specifies the subset and order of variables to be retained in the resulting file.<br />

• MAP provides a listing of the variables in the resulting file and the two input files.<br />

• The COMPUTE commands calculate the ratios of each employee’s hourly wage and raise<br />

to the department averages for wage and raise. The results are stored in the variables<br />

HOURDIF and RAISEDIF.<br />

• LIST displays the resulting file.<br />

OUTFILE Subcommand<br />

OUTFILE specifies a name for the file created by AGGREGATE. If an asterisk is specified on<br />

OUTFILE, the aggregated file replaces the working file. OUTFILE must be the first subcommand<br />

specified on AGGREGATE.<br />

• If the aggregated file replaces the working file, the file is not automatically saved on disk.<br />

To save the file, use the SAVE command.<br />

Example<br />

AGGREGATE OUTFILE=AGGEMP<br />

/BREAK=LOCATN<br />

/AVGSAL = MEAN(SALARY).<br />

• OUTFILE creates an SPSS-format data file named AGGEMP. The working file remains unchanged<br />

and is available for further analysis.<br />

• The file AGGEMP contains two variables, LOCATN and AVGSAL.<br />

BREAK Subcommand<br />

BREAK lists the grouping variables, also called break variables. Each unique combination of<br />

values of the break variables defines one break group.<br />

• The variables named on BREAK can be any combination of variables in the working data<br />

file.<br />

• Unless PRESORTED is specified, AGGREGATE sorts cases after aggregating. By default,<br />

cases are sorted in ascending order of the values of the break variables. AGGREGATE sorts<br />

first on the first break variable, then on the second break variable within the groups created<br />

by the first, and so on.<br />

• Sort order can be controlled by specifying an A (for ascending) or D (for descending) in<br />

parentheses after any break variables.<br />

• The designations A and D apply to all preceding undesignated variables.<br />

• The subcommand PRESORTED overrides all sorting specifications.

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

Saved successfully!

Ooh no, something went wrong!