Previous Page | Next Page

The MEANS Procedure

Example 3: Using the BY Statement with Class Variables


Procedure features:

PROC MEANS statement option:

statistic keywords

BY statement

CLASS statement

Other features:

SORT procedure

Data set: GRADE

This example


Program

 Note about code
options nodate pageno=1 linesize=80 pagesize=60;
 Note about code
proc sort data=Grade out=GradeBySection;
   by section;
run;
 Note about code
proc means data=GradeBySection min max median;
 Note about code
   by Section;
 Note about code
   var Score;
 Note about code
   class Status Year;
 Note about code
   title1 'Final Exam Scores for Student Status and Year of Graduation';
   title2 ' Within Each Section';
run;

Output

          Final Exam Scores for Student Status and Year of Graduation          1
                               Within Each Section

---------------------------------- Section=A -----------------------------------

                              The MEANS Procedure

                          Analysis Variable : Score 
 
                         N
     Status    Year    Obs         Minimum         Maximum          Median
     ---------------------------------------------------------------------
     1         97        1      85.0000000      85.0000000      85.0000000

               98        1      92.0000000      92.0000000      92.0000000

     2         97        3      82.0000000      90.0000000      88.0000000
     ---------------------------------------------------------------------


---------------------------------- Section=B -----------------------------------

                          Analysis Variable : Score 
 
                         N
     Status    Year    Obs         Minimum         Maximum          Median
     ---------------------------------------------------------------------
     1         97        2      78.0000000      91.0000000      84.5000000

               98        2      84.0000000      89.0000000      86.5000000

     2         98        1      81.0000000      81.0000000      81.0000000
     ---------------------------------------------------------------------

Previous Page | Next Page | Top of Page