MEANS Procedure
| Tip: | You can use the ATTRIB, FORMAT, LABEL, and WHERE statements. For more information, see Statements with the Same Function in Multiple Procedures. You can also use any global statement. For a list, see “Global Statements” in SAS DATA Step Statements: Reference. |
|---|
Syntax
PROC MEANS <options> <statistic-keyword(s)>;
OUTPUT <OUT=SAS-data-set> <output-statistic-specification(s)>
<id-group-specification(s)> <maximum-id-specification(s)>
<minimum-id-specification(s)> </ options> ;
<id-group-specification(s)> <maximum-id-specification(s)>
<minimum-id-specification(s)> </ options> ;
Table of Procedure Tasks and Examples
| Statement | Task | Example |
|---|---|---|
| PROC MEANS | Compute descriptive statistics for variables | Ex. 1, Ex. 2, Ex. 3, Ex. 4, Ex. 5, Ex. 6, Ex. 7, Ex. 8, Ex. 9, Ex. 10, Ex. 12, Ex. 13 |
| BY | Calculate separate statistics for each BY group | Ex. 3 |
| CLASS | Identify variables whose values define subgroups for the analysis | Ex. 2, Ex. 3, Ex. 4, Ex. 5, Ex. 6, Ex. 7, Ex. 8, Ex. 9, Ex. 10, Ex. 11, Ex. 12 |
| FREQ | Identify a variable whose values represent the frequency of each observation | |
| ID | Include additional identification variables in the output data set | |
| OUTPUT | Create an output data set that contains specified statistics and identification variables | Ex. 8, Ex. 9, Ex. 10, Ex. 11, Ex. 12 |
| TYPES | Identify specific combinations of class variables to use to subdivide the data | Ex. 2, Ex. 5, Ex. 12 |
| VAR | Identify the analysis variables and their order in the results | Ex. 1 |
| WAYS | Specify the number of ways to make unique combinations of class variables | Ex. 6 |
| WEIGHT | Identify a variable whose values weight each observation in the statistical calculations | Ex. 6 |
Last updated: September 15, 2026