Chapter Contents

Previous

Next
The MEANS Procedure

Example 8: Computing Output Statistics


Procedure features:
PROC MEANS statement option:
NOPRINT
CLASS statement
OUTPUT statement options
statistic keywords
IDGROUP
LEVELS
WAYS
Other features:
PRINT procedure
Data set: GRADE

This example


Program

options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc means data=Grade noprint;
 Note about code
   class Status Year;
 Note about code
   var finalgrade;
 Note about code
   output out=sumstat mean=AverageGrade
          idgroup (max(score) obs out (name)=BestScore)
          /ways levels;
run;
 Note about code
proc print data=sumstat noobs;
   title1 'Average Undergraduate and Graduate Course Grades';
   title2 'For Two Years';
run;


Output
The first observation contains the average course grade and the name of the student with the highest exam score over the two-year period. The next four observations contain values for each class variable value. The remaining four observations contain values for the Year and Status combination. The variables _WAY_, _TYPE_, and _LEVEL_ show how PROC MEANS created the class variable combinations. The variable _OBS_ contains the observation number in the GRADE data set that contained the highest exam score. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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