SAS OnlineTutor HomeFAQ PageSuggested Learning PathsContents+Searchback||next

Computing Statistics for Numeric Variables
Selecting Statistics and Variables


Specifying Statistics

The default statistics produced by the MEANS procedure (n-count, mean, standard deviation, minimum, and maximum) are not always the ones that you need. You might prefer to limit output to the mean of the values. Or you might need to compute a different statistic, such as the median or range of the values.

To specify statistics, include statistic keywords as PROC MEANS options. When you specify a statistic in the PROC MEANS statement, default statistics are not produced. For example, to see the median and range of Perm.Survey numeric values, add the MEDIAN and RANGE keywords as options.

     proc means data=perm.survey median range;
     run;

Variable Median Range
Item1
Item2
Item3
Item4
Item5
Item6
Item7
Item8
Item9
Item10
Item11
Item12
Item13
Item14
Item15
Item16
Item17
Item18
4.0000000
3.0000000
4.0000000
3.5000000
3.0000000
4.0000000
3.0000000
3.0000000
2.5000000
3.0000000
3.0000000
3.0000000
3.0000000
2.5000000
3.0000000
2.0000000
3.0000000
3.0000000
3.0000000
4.0000000
1.0000000
3.0000000
4.0000000
3.0000000
4.0000000
3.0000000
3.0000000
3.0000000
4.0000000
1.0000000
3.0000000
3.0000000
4.0000000
4.0000000
2.0000000
3.0000000



  back||next


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

Terms of Use & Legal Information | Privacy Statement