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> ;

Table of Procedure Tasks and Examples

StatementTaskExample
PROC MEANSCompute descriptive statistics for variablesEx. 1, Ex. 2, Ex. 3, Ex. 4, Ex. 5, Ex. 6, Ex. 7, Ex. 8, Ex. 9, Ex. 10, Ex. 12, Ex. 13
BYCalculate separate statistics for each BY groupEx. 3
CLASSIdentify variables whose values define subgroups for the analysisEx. 2, Ex. 3, Ex. 4, Ex. 5, Ex. 6, Ex. 7, Ex. 8, Ex. 9, Ex. 10, Ex. 11, Ex. 12
FREQIdentify a variable whose values represent the frequency of each observation 
IDInclude additional identification variables in the output data set 
OUTPUTCreate an output data set that contains specified statistics and identification variablesEx. 8, Ex. 9, Ex. 10, Ex. 11, Ex. 12
TYPESIdentify specific combinations of class variables to use to subdivide the dataEx. 2, Ex. 5, Ex. 12
VARIdentify the analysis variables and their order in the resultsEx. 1
WAYSSpecify the number of ways to make unique combinations of class variablesEx. 6
WEIGHTIdentify a variable whose values weight each observation in the statistical calculationsEx. 6
Last updated: September 15, 2026