Chapter Contents

Previous

Next
The MEANS Procedure

Example 11: Identifying the Top Three Extreme Values with the Output Statistics


Procedure features:
PROC MEANS statement option:
NOPRINT
CLASS statement
OUTPUT statement options:
statistic keywords
AUTONAME
IDGROUP
INHERIT
TYPES statement
Other features:
FORMAT procedure
FORMAT statement
PRINT procedure
RENAME = data set option
Data set: CHARITY

This example


Program


options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
 proc format;
   value yrFmt . = " All";
   value $schFmt ' ' = "All    ";
run;
 Note about code
proc means data=Charity noprint;
 Note about code
   class School Year;
 Note about code
   types () school year;
 Note about code
   var moneyraised;
 Note about code
   output out=top3list(rename=(_freq_=NumberStudents)) sum= mean= 
          idgroup(max(moneyraised) out[3](moneyraised name school year)=)
           /inherit autoname;
 Note about code
   format year yrfmt. school $schfmt.
          moneyraised dollar8.2;
  run;
 Note about code
proc print data=top3list;
   title1 'School Funding Raising Report';
   title2 'Top Three Students';
run;


Output
The output from PROC PRINT shows the top three values of MoneyRaised, the names of the students who raised these amounts, the schools the students attended, and the years when the money was raised. The first observation contains the overall results, the next three contain the results by year, and the final two contain the results by school. The missing class levels for School and Year are replaced with the value of ALL. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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