Chapter Contents

Previous

Next
The MEANS Procedure

Example 9: Computing Different Output Statistics for Several Variables


Procedure features:
PROC MEANS statement options:
DESCEND
NOPRINT
CLASS statement
OUTPUT statement options:
statistic keywords
Other features:
PRINT procedure
WHERE= data set option
Data set: GRADE

This example


Program

options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc means data=Grade noprint descend;
 Note about code
   class Status Year;
 Note about code
   var Score FinalGrade;
 Note about code
   output out=Sumdata (where=(status='1' or _type_=0))
          mean= median(finalgrade)=MedianGrade;
run;
 Note about code
proc print data=Sumdata;
   title 'Exam and Course Grades for Undergraduates Only';
   title2 'and for All Students';
run;


Output
The first three observations contain statistics for the class variable levels with a status of 1. The last observation contains the statistics for all the observations (no subgroup). Score contains the mean test score anf FinalGrade contains the mean final grade. [HTML Output]
 [Listing Output]


Chapter Contents

Previous

Next

Top of Page

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