Chapter Contents

Previous

Next
The MEANS Procedure

Overview

The MEANS procedure provides data summarization tools to compute descriptive statistics for variables across all observations and within groups of observations. For example, PROC MEANS

By default, PROC MEANS displays output. You can also use the OUTPUT statement to store the statistics in a SAS data set.

PROC MEANS and PROC SUMMARY are very similar; see The SUMMARY Procedure for an explanation of the differences.

The Default Descriptive Statistics shows the default output that PROC MEANS displays. The data set that PROC MEANS analyzes contains the integers 1 through 10. The output reports the number of observations, the mean, the standard deviation, the minimum value, and the maximum value. The statements that produce the output follow:

proc means data=OnetoTen;
run;

The Default Descriptive Statistics
[HTML Output]  [Listing Output]

Specified Statistics for Class Levels and Identification of Maximum Values shows the results of a more extensive analysis of two variables, MoneyRaised and HoursVolunteered. The analysis data set contains information about the amount of money raised and the number of hours volunteered by high-school students for a local charity. PROC MEANS uses six combinations of two categorical variables to compute the number of observations, the mean, and the range. The first variable, School, has two values and the other variable, Year, has three values. For an explanation of the program that produces the output, see Identifying an Extreme Value with the Output Statistics .

Specified Statistics for Class Levels and Identification of Maximum Values
[HTML Output]  [Listing Output]

             Best Results: Most Money Raised and Most Hours Worked             2

                                       Most     Most      Money     Hours
   Obs  School   Year  _TYPE_  _FREQ_  Cash     Time     Raised  Volunteered

     1              .     0      110   Willard  Tonya     78.65       40    
     2             26     1        1                        .          .    
     3           1992     1       31   Tonya    Tonya     55.16       40    
     4           1993     1       32   Cameron  Amy       65.44       31    
     5           1994     1       46   Willard  L.T.      78.65       33    
     6  47.33       .     2        1                        .          .    
     7  Kennedy     .     2       53   Luther   Jay       72.22       35    
     8  Monroe      .     2       56   Willard  Tonya     78.65       40    
     9  47.33      26     3        1                        .          .    
    10  Kennedy  1992     3       15   Thelma   Jay       52.63       35    
    11  Kennedy  1993     3       20   Bill     Amy       42.23       31    
    12  Kennedy  1994     3       18   Luther   Che-Min   72.22       33    
    13  Monroe   1992     3       16   Tonya    Tonya     55.16       40    
    14  Monroe   1993     3       12   Cameron  Tyra      65.44       23    
    15  Monroe   1994     3       28   Willard  L.T.      78.65       33    

In addition to the report, the program also creates an output data set (located on page 2 of the output) that identifies the students who raised the most money and who volunteered the most time over all the combinations of School and Year and within the combinations of School and Year:


Chapter Contents

Previous

Next

Top of Page

Copyright 1999 by SAS Institute Inc., Cary, NC, USA. All rights reserved.