Chapter Contents

Previous

Next
The MEANS Procedure

Example 11: Identifying an Extreme Value with the Output Statistics


Procedure features:
CLASS statement
OUTPUT statement options:
statistic keyword
MAXID
Other features:
PRINT procedure
Data set: CHARITY

This example


Program

options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc means data=Charity n mean range;
 Note about code
   class School Year;
 Note about code
   var MoneyRaised HoursVolunteered;
 Note about code
   output out=Prize maxid(MoneyRaised(name) 
          HoursVolunteered(name))= MostCash MostTime
          max= ;
   title 'Summary of Volunteer Work by School and Year';
run;
 Note about code
proc print data=Prize;
   title 'Best Results: Most Money Raised and Most Hours Worked';
run;


Output
The first page of output shows the output from PROC MEANS with the statistics for six class levels: one for Monroe High for the years 1992, 1993, and 1994; and one for Kennedy High for each of the three years. [HTML Output]
 [Listing Output]
The output from PROC PRINT shows the maximum MoneyRaised and HoursVolunteered values and the names of the students who are responsible for them. The first observation contains the overall results, the next three contain the results by year, the next two contain the results by school, and the final six contain the results by School and Year. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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