SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Computing Statistics for Numeric Variables
Selecting Statistics and Variables


Specifying Variables

By default, the MEANS procedure generates statistics for every numeric variable in a data set. But you'll typically want to focus on just a few variables, particularly if the data set is large. It also makes sense to exclude certain types of variables. The values of ID, for example, are unlikely to yield useful statistics.

To specify the variables that PROC MEANS analyzes, add a VAR statement and list the variable names.


General form, VAR statement:
VAR variable(s);

where variable(s) lists numeric variables on which to calculate statistics.


     proc means data=clinic.diabetes min max maxdec=0;
        var age height weight;
     run;

Variable Minimum Maximum
Age
Height
Weight
15
61
102
63
75
240


In addition to listing variables separately, you can use a numbered range of variables.
     proc means data=perm.survey mean stderr maxdec=2;
        var item1-item5;
     run;

Variable Mean Std Error
Item1
Item2
Item3
Item4
Item5
3.75
3.00
4.25
3.50
3.00
0.63
0.82
0.25
0.65
0.82



  back||next


Copyright © 2002 SAS Institute Inc., Cary, NC, USA. All rights reserved.

Terms of Use & Legal Information | Privacy Statement