SAS
provides a variety of tools for summarizing data, including the MEANS
procedure (or SUMMARY procedure), the TABULATE procedure, the REPORT
procedure, the SQL procedure, and the DATA step.
If you summarize data
for one class variable, the tools in each of the following groups
are similar in resource usage:
-
PROC MEANS (or PROC SUMMARY), PROC
REPORT, and PROC TABULATE
-
PROC SQL and the DATA step
However, the relative
efficiency of the two groups of tools varies according to the shape
of the data.
You can use PROC MEANS
in a variety of ways to produce summary statistics for combinations
of class variables. Each combination of class variables is called
a type.
To summarize data for
all combinations of all class variables, you can use a basic PROC
MEANS step (or PROC SUMMARY step). To produce summary statistics for
specific combinations of class variables, you can use PROC MEANS in
the following ways :
-
the TYPES statement in a PROC MEANS
step
-
the NWAY option in multiple PROC
MEANS steps
-
the WHERE= output data set option
in a PROC MEANS step
These three techniques
vary in efficiency; the TYPES statement in PROC MEANS is the most
efficient.
You can also use the
WAYS statement in PROC MEANS to produce summary statistics for specific
combinations of class variables.