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 Statements: Reference.

Syntax

PROC MEANS <option(s)> <statistic-keyword(s)>;
BY <DESCENDING> variable-1 <… <DESCENDING> variable-n><NOTSORTED>;
CLASS variable(s) </ option(s)>;
FREQ variable;
ID variable(s);
OUTPUT <OUT=SAS-data-set> <output-statistic-specification(s)>
<id-group-specification(s)> <maximum-id-specification(s)>
<minimum-id-specification(s)> </ option(s)> ;
TYPES request(s);
VAR variable(s) < / WEIGHT=weight-variable>;
WAYS list;
WEIGHT variable;

Table of Procedure Tasks

Statement Task Example
PROC MEANS Statement 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 Statement Calculate separate statistics for each BY group Ex. 3
CLASS Statement 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 Statement Identify a variable whose values represent the frequency of each observation  
ID Statement Include additional identification variables in the output data set  
OUTPUT Statement Create an output data set that contains specified statistics and identification variables Ex. 8, Ex. 9, Ex. 10, Ex. 11, Ex. 12
TYPES Statement Identify specific combinations of class variables to use to subdivide the data Ex. 2, Ex. 5, Ex. 12
VAR Statement Identify the analysis variables and their order in the results Ex. 1
WAYS Statement Specify the number of ways to make unique combinations of class variables Ex. 6
WEIGHT Statement Identify a variable whose values weight each observation in the statistical calculations Ex. 6