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<br />

AGGREGATE OUTFILE={file} [/MISSING=COLUMNWISE] [/DOCUMENT]<br />

{* }<br />

[/PRESORTED] /BREAK=varlist[({A})][varlist...]<br />

{D}<br />

/aggvar[’label’]aggvar[’label’]...=function(arguments)<br />

[/aggvar ...]<br />

Available functions:<br />

SUM Sum MEAN Mean<br />

SD Standard deviation MAX Maximum<br />

MIN Minimum PGT % of cases greater than value<br />

PLT % of cases less than value PIN % of cases between values<br />

POUT % of cases not in range FGT Fraction greater than value<br />

FLT Fraction less than value FIN Fraction between values<br />

FOUT Fraction not in range N Weighted number of cases<br />

NU Unweighted number of cases NMISS Weighted number of missing cases<br />

NUMISS Unweighted number of missing cases FIRST First nonmissing value<br />

LAST Last nonmissing value MEDIAN Median<br />

Example<br />

Overview<br />

AGGREGATE OUTFILE=AGGEMP /BREAK=LOCATN DEPT /COUNT=N<br />

/AVGSAL AVGRAISE = MEAN(SALARY RAISE)<br />

/SUMSAL SUMRAISE = SUM(SALARY RAISE)<br />

/BLACKPCT ’Percentage Black’ = PIN(RACE,1,1)<br />

/WHITEPCT ’Percentage White’ = PIN(RACE,5,5).<br />

AGGREGATE aggregates groups of cases in the working data file into single cases and<br />

creates a new, aggregated file. The values of one or more variables in the working file define<br />

the case groups. These variables are called break variables. A set of cases with identical<br />

values for each break variable is called a break group. A series of aggregate functions are<br />

applied to source variables in the working file to create new, aggregated variables that have<br />

one value for each break group.<br />

AGGREGATE is often used with MATCH FILES to add variables with summary measures<br />

(sum, mean, etc.) to a file. Transformations performed on the combined file can create<br />

composite summary measures. With the REPORT procedure, the composite variables can<br />

be used to write reports with nested composite information.<br />

90

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

Saved successfully!

Ooh no, something went wrong!