22 |
@vindex AGGREGATE |
@vindex AGGREGATE |
23 |
|
|
24 |
@display |
@display |
25 |
AGGREGATE |
AGGREGATE |
26 |
/BREAK=var_list |
OUTFILE=@{*,'filename'@} |
27 |
/PRESORTED |
/PRESORTED |
|
/OUTFILE=@{*,'filename'@} |
|
28 |
/DOCUMENT |
/DOCUMENT |
29 |
/MISSING=COLUMNWISE |
/MISSING=COLUMNWISE |
30 |
|
/BREAK=var_list |
31 |
/dest_var['label']@dots{}=agr_func(src_vars, args@dots{})@dots{} |
/dest_var['label']@dots{}=agr_func(src_vars, args@dots{})@dots{} |
32 |
@end display |
@end display |
33 |
|
|
36 |
variables called @dfn{break variables}. Several functions are available |
variables called @dfn{break variables}. Several functions are available |
37 |
for summarizing case contents. |
for summarizing case contents. |
38 |
|
|
39 |
At least one break variable must be specified on BREAK, the only |
The OUTFILE subcommand is required and must appear first. Specify a |
40 |
required subcommand. The values of these variables are used to divide |
system file by file name string or file handle (@pxref{FILE HANDLE}). |
41 |
the active file into groups to be summarized. In addition, at least |
The aggregated cases are written to this file. If @samp{*} is |
42 |
one @var{dest_var} must be specified. |
specified, then the aggregated cases replace the active file. |
43 |
|
|
44 |
By default, the active file is sorted based on the break variables |
By default, the active file will be sorted based on the break variables |
45 |
before aggregation takes place. If the active file is already sorted |
before aggregation takes place. If the active file is already sorted |
46 |
or otherwise grouped in terms of the break variables, specify |
or otherwise grouped in terms of the break variables, specify |
47 |
PRESORTED to save time. |
PRESORTED to save time. |
48 |
|
|
|
The OUTFILE subcommand specifies a system file by file name string or |
|
|
file handle (@pxref{FILE HANDLE}). The aggregated cases are written to |
|
|
this file. If OUTFILE is not specified, or if @samp{*} is specified, |
|
|
then the aggregated cases replace the active file. |
|
|
|
|
49 |
Specify DOCUMENT to copy the documents from the active file into the |
Specify DOCUMENT to copy the documents from the active file into the |
50 |
aggregate file (@pxref{DOCUMENT}). Otherwise, the aggregate file will |
aggregate file (@pxref{DOCUMENT}). Otherwise, the aggregate file will |
51 |
not contain any documents, even if the aggregate file replaces the |
not contain any documents, even if the aggregate file replaces the |
52 |
active file. |
active file. |
53 |
|
|
54 |
|
Normally, only a single case (for SD and SD., two cases) need be |
55 |
|
non-missing in each group for the aggregate variable to be |
56 |
|
non-missing. Specifying /MISSING=COLUMNWISE inverts this behavior, so |
57 |
|
that the aggregate variable becomes missing if any aggregated value is |
58 |
|
missing. |
59 |
|
|
60 |
|
If PRESORTED, DOCUMENT, or MISSING are specified, they must appear |
61 |
|
between OUTFILE and BREAK. |
62 |
|
|
63 |
|
At least one break variable must be specified on BREAK, a |
64 |
|
required subcommand. The values of these variables are used to divide |
65 |
|
the active file into groups to be summarized. In addition, at least |
66 |
|
one @var{dest_var} must be specified. |
67 |
|
|
68 |
One or more sets of aggregation variables must be specified. Each set |
One or more sets of aggregation variables must be specified. Each set |
69 |
comprises a list of aggregation variables, an equals sign (@samp{=}), |
comprises a list of aggregation variables, an equals sign (@samp{=}), |
70 |
the name of an aggregation function (see the list below), and a list |
the name of an aggregation function (see the list below), and a list |
81 |
Each set must have exactly as many source variables as aggregation |
Each set must have exactly as many source variables as aggregation |
82 |
variables. Each aggregation variable receives the results of applying |
variables. Each aggregation variable receives the results of applying |
83 |
the specified aggregation function to the corresponding source |
the specified aggregation function to the corresponding source |
84 |
variable. Most aggregation functions may be applied to numeric and |
variable. The MEAN, SD, and SUM aggregation functions may only be |
85 |
short and long string variables. Others, marked below, are restricted |
applied to numeric variables. All the rest may be applied to numeric |
86 |
to numeric values. |
and short and long string variables. |
87 |
|
|
88 |
The available aggregation functions are as follows: |
The available aggregation functions are as follows: |
89 |
|
|
182 |
(@samp{.}) between the function name and left parenthesis |
(@samp{.}) between the function name and left parenthesis |
183 |
(e.g.@: @samp{SUM.}). |
(e.g.@: @samp{SUM.}). |
184 |
|
|
|
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. |
|
|
|
|
185 |
@cmd{AGGREGATE} both ignores and cancels the current @cmd{SPLIT FILE} |
@cmd{AGGREGATE} both ignores and cancels the current @cmd{SPLIT FILE} |
186 |
settings (@pxref{SPLIT FILE}). |
settings (@pxref{SPLIT FILE}). |
187 |
|
|